Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding unknown qubits to a circuit automatically #16

Open
arcondello opened this issue Jan 3, 2023 · 0 comments
Open

Consider adding unknown qubits to a circuit automatically #16

arcondello opened this issue Jan 3, 2023 · 0 comments

Comments

@arcondello
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant