Skip to content

Commit

Permalink
add Gate to quimb.tensor namespace, other small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmgray committed Apr 30, 2024
1 parent 467df60 commit 07ca608
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions quimb/tensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Circuit,
CircuitDense,
CircuitMPS,
Gate,
)
from .circuit_gen import (
circ_ansatz_1D_brickwork,
Expand Down Expand Up @@ -252,6 +253,7 @@
"expec_TN_1D",
"FullUpdate",
"gate_TN_1D",
"Gate",
"gen_2d_bonds",
"gen_3d_bonds",
"get_contract_backend",
Expand Down
6 changes: 3 additions & 3 deletions quimb/tensor/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ def _cached_param_gate_build(fn, params):


class Gate:
"""A simple class for storing the details of a gate.
"""A simple class for storing the details of a quantum circuit gate.
Parameters
----------
Expand Down Expand Up @@ -1270,7 +1270,7 @@ def parse_to_gate(
if gate_args:
raise ValueError(
"You cannot specify ``gate_args`` for an already "
"encapsulated gate."
"encapsulated `Gate` object."
)

if any((params, qubits, controls, gate_round, parametrize)):
Expand Down Expand Up @@ -1573,7 +1573,7 @@ def apply_gate(
qubits=None,
controls=None,
gate_round=None,
parametrize=False,
parametrize=None,
**gate_opts,
):
"""Apply a single gate to this tensor network quantum circuit. If
Expand Down
2 changes: 1 addition & 1 deletion quimb/tensor/tensor_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def canonicalize(
"""
mps = self if inplace else self.copy()

if isinstance(where, int):
if isinstance(where, Integral):
i = j = where
else:
i, j = min(where), max(where)
Expand Down

0 comments on commit 07ca608

Please sign in to comment.