Skip to content

Support custom multiqubit operations in simulator #52

@thisac

Description

@thisac

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:

  • Add support for arbitrary unitaries in the simulator.
  • Automatically decompose custom gates before running them on the simulator.

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