-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
bugSomething isn't workingSomething isn't workingmod: qpyRelated to QPY serializationRelated to QPY serialization
Description
Environment
- Qiskit Terra version:
0.25.0
- Python version:
3.10
- Operating system:
Ubuntu
What is happening?
When a delay gate is created with units that are not dt
, qpy doesn't keep track of the units.
How can we reproduce the issue?
import qiskit
from qiskit import qpy
qc = qiskit.QuantumCircuit(1)
qc.delay(10, unit="s")
print(qc)
# prints
# ┌──────────────┐
# q: ┤ Delay(10[s]) ├
# └──────────────┘
# c: 1/════════════════
with open('delay.qpy', 'wb') as fd:
qpy.dump(qc, fd)
with open('delay.qpy', 'rb') as fd:
new_qc = qpy.load(fd)[0]
print(new_qc)
# prints
# ┌───────────────┐
# q: ┤ Delay(10[dt]) ├
# └───────────────┘
# c: 1/═════════════════
print(str(qc) == str(new_qc))
# prints
# False
What should happen?
print(str(qc) == str(new_qc))
should print True
Any suggestions?
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingmod: qpyRelated to QPY serializationRelated to QPY serialization