Skip to content

Commit

Permalink
fixed a bug that prevented circuit execution on virtual qiskit backen…
Browse files Browse the repository at this point in the history
…ds for some backends
  • Loading branch information
positr0nium committed Feb 1, 2024
1 parent 7fd7348 commit 8dfe530
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = qrisp
version = 0.4.2
version = 0.4.3
author = Raphael Seidel
author_email = raphael.seidel@fokus.fraunhofer.de
description = A high-level quantum programming language
Expand Down
11 changes: 9 additions & 2 deletions src/qrisp/interface/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,16 @@ def run(qasm_str, shots, token = ""):

qiskit_qc = QuantumCircuit.from_qasm_str(qasm_str)

from qiskit import transpile

#Make circuit with one monolithic register
new_qiskit_qc = QuantumCircuit(len(qiskit_qc.qubits), len(qiskit_qc.clbits))
for instr in qiskit_qc:
new_qiskit_qc.append(instr.operation,
[qiskit_qc.qubits.index(qb) for qb in instr.qubits],
[qiskit_qc.clbits.index(cb) for cb in instr.clbits])

qiskit_qc = transpile(qiskit_qc, backend=backend)
from qiskit import transpile
qiskit_qc = transpile(new_qiskit_qc, backend=backend)
# Run Circuit on the Qiskit backend
qiskit_result = backend.run(qiskit_qc, shots=shots).result().get_counts()
# Remove the spaces in the qiskit result keys
Expand Down

0 comments on commit 8dfe530

Please sign in to comment.