You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example: Take the cdr case. We want to generate clifford training data with the input as qiskit quantum circuit. This fails with the error as 'QuantumCircuit' object has no attribute 'qasm'
How to Reproduce
Minimum steps
from qiskit import QuantumCircuit
from mitiq.cdr import generate_training_circuits
qc = QuantumCircuit(3)
qc.h(0)
qc.cx(0,1)
qc.cx(1,2)
cd = generate_training_circuits(qc, 10, 0.1)
This generates following error
AttributeError: 'QuantumCircuit' object has no attribute 'qasm'
Root Cause
QuantumCircuit object from qiskit 1.0.1 no longer has qasm as an attribute
Possible solutions and workarounds
Fix - Replace circuit.qasm() in from_qiskit function with qiskit.qasm2.dumps(circuit)
This fix also works with qiskit 0.45
Environment Context
Use the about() function to summarize information on operating system, python version and dependencies.
frommitiqimportaboutabout()
Additional Python Environment Details (pip freeze or conda list):
Mitiq version 0.34
Qiskit 1.0.1
Copy and paste the output of `pip freeze` or `conda list` here.
The text was updated successfully, but these errors were encountered:
Hello @hrushikesh890, thank you for your interest in Mitiq!
If this is a bug report, please provide screenshots and/or minimum viable code to reproduce your issue, so we can do our best to help get it fixed. If you have any questions in the meantime, you can also ask us on the Unitary Fund Discord.
@hrushikesh890 Thank you for creating this issue. Yes, we are aware of the errors related to qiskit 1.0.1#2207. Our next release should hopefully fix these.
Until then, you will have to switch to an earlier version as specified in the dependencies of the project.
Issue Description
Example: Take the cdr case. We want to generate clifford training data with the input as qiskit quantum circuit. This fails with the error as
'QuantumCircuit' object has no attribute 'qasm'
How to Reproduce
Minimum steps
This generates following error
Root Cause
QuantumCircuit object from qiskit 1.0.1 no longer has qasm as an attribute
Possible solutions and workarounds
Fix - Replace circuit.qasm() in from_qiskit function with qiskit.qasm2.dumps(circuit)
This fix also works with qiskit 0.45
Environment Context
Use the
about()
function to summarize information on operating system, python version and dependencies.Additional Python Environment Details (
pip freeze
orconda list
):Mitiq version 0.34
Qiskit 1.0.1
The text was updated successfully, but these errors were encountered: