-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to get the QASM string representation of a BQSKit circuit? #214
Comments
Hi Jagatheesan, You can save circuits using
|
I think I found the function that I am looking for at Circuit.to I'm calling it as [Update] I tested out reading a small QASM 2.0 file which contains a Controlled-U1 gate and converting to QASM string again using the code below: QASM file - test_circuit.qasm OPENQASM 2.0;
include "qelib1.inc";
qreg q[2];
cu1(0) q[0], q[1]; Code for testing from bqskit import Circuit
circuit = Circuit.from_file('qasm/test_circuit.qasm')
circuit.to('qasm') However, I'm getting the error |
Yes, the Thanks for reporting this bug. We should always be able to save a qasm file that we read. This happens because the |
Hi @edyounis , noted. I tried to see if I can do a workaround by converting the BQSKit to Qiskit and then use the from bqskit import Circuit
from bqskit.ext import bqskit_to_qiskit
circuit = Circuit.from_file('qasm/test_circuit.qasm')
qc = bqskit_to_qiskit(circuit)
qc.qasm() If you know any workaround for this issue, please kindly let me know. It seems to me that I cannot have "non-specialised" controlled gates in the BQSKit circuit and convert the resulting circuit to QASM. |
There is really no low-effort workaround here, but @mtweiden put up a PR that we will get merged in shortly. |
Bqskit code in benchmark generator was not properly setup. Test cases were also not properly setup. This commit fixes both. Note that the test convert bqskit circuit to qiskit is commented out because of the bug in bqskit BQSKit/bqskit#214
Hi,
Is it possible to get the QASM string representation of a BQSKit circuit?
The text was updated successfully, but these errors were encountered: