Skip to content

Circuit can be composed of gate defined over different number of qubits? #83

Description

@adamglos92

It does not seem to be that big problem (everything works) but you can construct circuit with gate of different number of qubits. E.g. the code below runs without any problem

from monoprop import Circuit, ExpGate, MajoranaOperator, MajoranaPropagator

mop1 = MajoranaOperator({(0, 1): 1.0j}, 4)
mop2 = MajoranaOperator({(1, 0): 1.0j}, 5)
circuit = Circuit([ExpGate(mop1), ExpGate(mop2)], [1.0, 1.0], [0, 1])
majprop = MajoranaPropagator(mop1, [0, 1], cutoff=6)
majprop.build_graph(circuit)  # OK
MajoranaPropagator.from_circuit(circuit, mop2, cutoff=6)

Possible actions:

  • keep us is (not a bug)
  • delay decision for the future (not an issues for release IMHO)
  • explicit checking inside Circuit for num_modes. Changes a bit concept of ExpGate not knowing about in what system size it lives

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