From 9931193eeffa1ab75ead613ea741a97f4435b37b Mon Sep 17 00:00:00 2001 From: Ed Younis Date: Tue, 27 Feb 2024 19:13:48 -0500 Subject: [PATCH 1/2] Updated .qasm() to qasm2.dumps --- bqskit/ext/qiskit/translate.py | 3 ++- tests/ext/test_qiskit.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/bqskit/ext/qiskit/translate.py b/bqskit/ext/qiskit/translate.py index 20e791115..b447d06e4 100644 --- a/bqskit/ext/qiskit/translate.py +++ b/bqskit/ext/qiskit/translate.py @@ -5,13 +5,14 @@ if TYPE_CHECKING: from qiskit import QuantumCircuit +from qiskit import qasm2 from bqskit.ir.circuit import Circuit from bqskit.ir.lang.qasm2 import OPENQASM2Language def qiskit_to_bqskit(qc: QuantumCircuit) -> Circuit: """Convert Qiskit's QuantumCircuit `qc` to a BQSKit Circuit.""" - circuit = OPENQASM2Language().decode(qc.qasm()) + circuit = OPENQASM2Language().decode(qasm2.dumps(qc)) # circuit.renumber_qudits(list(reversed(range(circuit.num_qudits)))) return circuit # TODO: support gates not captured by qasm diff --git a/tests/ext/test_qiskit.py b/tests/ext/test_qiskit.py index 54252ae46..db8b932f2 100644 --- a/tests/ext/test_qiskit.py +++ b/tests/ext/test_qiskit.py @@ -44,21 +44,21 @@ def bqskit_circuit(self) -> Circuit: @pytest.fixture def qiskit_circuit(self) -> QuantumCircuit: circuit = QuantumCircuit(3) - circuit.cnot(0, 1) + circuit.cx(0, 1) circuit.u(1, 2, 3, 0) circuit.u(1, 2, 3, 1) circuit.u(1, 2, 3, 2) - circuit.cnot(0, 1) - circuit.cnot(0, 2) - circuit.cnot(0, 2) + circuit.cx(0, 1) + circuit.cx(0, 2) + circuit.cx(0, 2) circuit.u(1, 2.4, 3, 0) circuit.u(1, 2.2, 3, 1) circuit.u(1, 2.1, 3, 2) circuit.u(1, 2.1, 3, 2) - circuit.cnot(0, 2) - circuit.cnot(0, 2) - circuit.cnot(0, 1) - circuit.cnot(0, 2) + circuit.cx(0, 2) + circuit.cx(0, 2) + circuit.cx(0, 1) + circuit.cx(0, 2) circuit.u(1, 2.4, 3, 0) circuit.u(1, 2.2, 3, 1) circuit.u(1, 2.1, 3, 2) From 328da422ef243e55c23f3ba3c21e80f12fb38a01 Mon Sep 17 00:00:00 2001 From: Ed Younis Date: Mon, 15 Apr 2024 10:29:27 -0400 Subject: [PATCH 2/2] 1.1.2 --- bqskit/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bqskit/version.py b/bqskit/version.py index 8483b5a1b..b035796df 100644 --- a/bqskit/version.py +++ b/bqskit/version.py @@ -1,4 +1,4 @@ """This module contains the version information for BQSKit.""" from __future__ import annotations -__version_info__ = ('1', '1', '1') +__version_info__ = ('1', '1', '2') __version__ = '.'.join(__version_info__[:3]) + ''.join(__version_info__[3:])