diff --git a/src/qibotn/mps_contraction_helper.py b/src/qibotn/mps_contraction_helper.py index fbf0285..ccdc0fa 100644 --- a/src/qibotn/mps_contraction_helper.py +++ b/src/qibotn/mps_contraction_helper.py @@ -7,7 +7,7 @@ class MPSContractionHelper: """A helper class to compute various quantities for a given MPS. Interleaved format is used to construct the input args for `cuquantum.contract`. - + Reference: https://github.com/NVIDIA/cuQuantum/blob/main/python/samples/cutensornet/tn_algorithms/mps_algorithms.ipynb The following compute quantities are supported: diff --git a/src/qibotn/mps_utils.py b/src/qibotn/mps_utils.py index 62c3f93..f37f1df 100644 --- a/src/qibotn/mps_utils.py +++ b/src/qibotn/mps_utils.py @@ -3,9 +3,8 @@ from cuquantum import contract from cuquantum.cutensornet.experimental import contract_decompose - def initial(num_qubits, dtype): - """Generate the MPS with an initial state of :math:`\ket{00...00}`""" + r"""Generate the MPS with an initial state of :math:`\ket{00...00}`""" state_tensor = cp.asarray([1, 0], dtype=dtype).reshape(1, 2, 1) mps_tensors = [state_tensor] * num_qubits return mps_tensors @@ -26,9 +25,9 @@ def mps_site_right_swap(mps_tensors, i, **kwargs): def apply_gate(mps_tensors, gate, qubits, **kwargs): """Apply the gate operand to the MPS tensors in-place. - + # Reference: https://github.com/NVIDIA/cuQuantum/blob/main/python/samples/cutensornet/tn_algorithms/mps_algorithms.ipynb - + Args: mps_tensors: A list of rank-3 ndarray-like tensor objects. The indices of the ith tensor are expected to be the bonding index to the i-1 tensor,