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
When reimporting a simple circuit containing a StatePreparation with qiskit.qpy, one gets the error qiskit.exceptions.QiskitError: 'The num_qubits parameter to StatePreparation should only be used when params is an integer'.
How can we reproduce the issue?
Minimal example:
#!/usr/bin/python3
import qiskit
import qiskit.qpy
print(qiskit.__qiskit_version__)
qc = qiskit.QuantumCircuit(1)
qc.prepare_state([0,1], [0])
with open("tmp.qpy", "wb") as file:
qiskit.qpy.dump(qc, file)
with open("tmp.qpy", "rb") as file:
new_qc = qiskit.qpy.load(file)
#qiskit.exceptions.QiskitError: 'The num_qubits parameter to StatePreparation should only be used when params is an integer'
What should happen?
Reimporting a circuit with qiskit.qpy should be possible.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered:
This may be akin to issue #7847 wherein the serializer has an issue with a non-standard gate. Fixing this would require specifying the 'StatePreparation' here:
Environment
What is happening?
When reimporting a simple circuit containing a StatePreparation with
qiskit.qpy
, one gets the errorqiskit.exceptions.QiskitError: 'The num_qubits parameter to StatePreparation should only be used when params is an integer'
.How can we reproduce the issue?
Minimal example:
What should happen?
Reimporting a circuit with qiskit.qpy should be possible.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: