diff --git a/src/qiskit_qec/operators/pauli.py b/src/qiskit_qec/operators/pauli.py index e0a01889..46aac06d 100644 --- a/src/qiskit_qec/operators/pauli.py +++ b/src/qiskit_qec/operators/pauli.py @@ -521,11 +521,11 @@ def to_instruction(self): gate = {"I": IGate(), "X": XGate(), "Y": YGate(), "Z": ZGate()}[pauli] else: gate = PauliGate(pauli) - if not phase_exp[0]: + if not phase_exp: return gate # Add global phase circuit = QuantumCircuit(self.num_qubits, name=str(self)) - circuit.global_phase = -phase_exp[0] * pi / 2 + circuit.global_phase = -phase_exp * pi / 2 circuit.append(gate, range(self.num_qubits)) return circuit.to_instruction() diff --git a/tox.ini b/tox.ini index 958c0931..39a13053 100644 --- a/tox.ini +++ b/tox.ini @@ -10,10 +10,12 @@ setenv = VIRTUAL_ENV={envdir} LANGUAGE=en_US LC_ALL=en_US.utf-8 + JUPYTER_PLATFORM_DIRS=1 deps = -r requirements.txt -r requirements-dev.txt commands = pip check + jupyter --paths python -m unittest discover -s test/ -p '*test*.py' -v [testenv:lint]