from dwave.gate import Circuit, Qubit
from dwave.gate.operations import SWAP
c = Circuit(1)
q2 = Qubit("q2")
with c.context as reg:
q1 = reg[0]
SWAP([q1, q2])
currently raises
ValueError: Qubit '<qubit: q2, id:q0dt>' not in circuit.
it would be nice if the qubit would be automatically added to the circuit.
Additional Considerations
This might end up adding too much complication, the error message is already super clear so the current behavior make sense as well.
currently raises
it would be nice if the qubit would be automatically added to the circuit.
Additional Considerations This might end up adding too much complication, the error message is already super clear so the current behavior make sense as well.