BQSKit / bqskit

Berkeley Quantum Synthesis Toolkit
Other
106 stars 31 forks source link

CU1 gate cannot be printed to qasm #233

Open bachbao opened 3 months ago

bachbao commented 3 months ago

It occurs to me that when using ControlledGate(U1Gate()), the feature to output qasm file is having issue.

edyounis commented 1 month ago

Thanks for making this bug report. To clarify, we should be able to build a ControlledGate(U1Gate()) and save to qasm, load that same qasm, and have the same gate.

from bqskit.ir.gates import ControlledGate, U1Gate
g = ControlledGate(U1Gate())

from bqskit import Circuit
c = Circuit(2)
c.append_gate(g, (0, 1))
c.to('qasm')

This seems to be printing fine. @bachbao, do you have a case where this isn't working?