Skip to content

Consider adding unknown qubits to a circuit automatically #16

@arcondello

Description

@arcondello
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions