From 239a9c9db5c93d7d62b01194969b9713f1a55457 Mon Sep 17 00:00:00 2001 From: Grace Date: Tue, 19 Sep 2023 12:15:17 -0400 Subject: [PATCH] jupyter paths --- src/qiskit_qec/operators/pauli.py | 4 ++-- tox.ini | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) 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]