dwavesystems / dwave-gate

dwave-gate is a software package for constructing, modifying and running quantum circuits on the provided state-vector simulator.
Apache License 2.0
15 stars 8 forks source link

Support custom multiqubit operations in simulator #52

Open thisac opened 2 months ago

thisac commented 2 months ago

Only a subset of multi-qubit gates are supported in the simulator, causing custom multi-qubit operations to fail.

bell = Circuit(2)

with bell.context as (q, c):
    ops.Hadamard(q[0])
    ops.CNOT(q[0], q[1])

Bell = create_operation(bell, "Bell")
circuit = Circuit(2)

with circuit.context as (q, c):
    Bell(q)

raises

simulator encountered unknown multi-qubit operation: Bell

Two potential solutions are: