Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 4, 2024
1 parent f295bfd commit cda817f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/qibotn/mps_contraction_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 follwing compute quantities are supported:
Expand Down
7 changes: 3 additions & 4 deletions src/qibotn/mps_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
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
Expand All @@ -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,
Expand Down

0 comments on commit cda817f

Please sign in to comment.