docs: Fix markup in docstrings
This commit is contained in:
@@ -7,15 +7,16 @@ 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`.
|
||||
A concrete example on how the modes are populated for a 7-site MPS is provided below:
|
||||
A concrete example on how the modes are populated for a 7-site MPS is provided
|
||||
below::
|
||||
|
||||
0 2 4 6 8 10 12 14
|
||||
bra -----A-----B-----C-----D-----E-----F-----G-----
|
||||
| | | | | | |
|
||||
1| 3| 5| 7| 9| 11| 13|
|
||||
| | | | | | |
|
||||
ket -----a-----b-----c-----d-----e-----f-----g-----
|
||||
15 16 17 18 19 20 21 22
|
||||
0 2 4 6 8 10 12 14
|
||||
bra -----A-----B-----C-----D-----E-----F-----G-----
|
||||
| | | | | | |
|
||||
1| 3| 5| 7| 9| 11| 13|
|
||||
| | | | | | |
|
||||
ket -----a-----b-----c-----d-----e-----f-----g-----
|
||||
15 16 17 18 19 20 21 22
|
||||
|
||||
|
||||
The follwing compute quantities are supported:
|
||||
|
||||
@@ -6,7 +6,7 @@ from cuquantum.cutensornet.experimental import contract_decompose
|
||||
|
||||
|
||||
def initial(num_qubits, dtype):
|
||||
"""Generate the MPS with an initial state of |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
|
||||
@@ -19,7 +19,7 @@ def mps_site_right_swap(mps_tensors, i, **kwargs):
|
||||
"ipj,jqk->iqj,jpk",
|
||||
*mps_tensors[i : i + 2],
|
||||
algorithm=kwargs.get("algorithm", None),
|
||||
options=kwargs.get("options", None)
|
||||
options=kwargs.get("options", None),
|
||||
)
|
||||
mps_tensors[i : i + 2] = (a, b)
|
||||
return mps_tensors
|
||||
@@ -64,7 +64,7 @@ def apply_gate(mps_tensors, gate, qubits, **kwargs):
|
||||
*mps_tensors[i : i + 2],
|
||||
gate,
|
||||
algorithm=kwargs.get("algorithm", None),
|
||||
options=kwargs.get("options", None)
|
||||
options=kwargs.get("options", None),
|
||||
)
|
||||
mps_tensors[i : i + 2] = (a, b) # in-place update
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user