mimiqcircuits.backends.concrete_passes

Concrete circuit-preparation passes.

Each wraps a circuit rewrite behind the AbstractPass interface so it composes in a PassPipeline. The clustering gate-fusion pass lives in mimiqcircuits.fusion as FusePass.

Qubit reordering and SWAP removal are server-side only in Python: they have no local implementation, so a remote backend translates the corresponding reorderqubits / remove_swaps knobs into server options directly rather than through a client-side pass.

Classes

CanonicalDecomposePass()

Pass that decomposes a circuit to its canonical basis.

class CanonicalDecomposePass[source]

Bases: AbstractPass

Pass that decomposes a circuit to its canonical basis.

Wraps Circuit.decompose(). Qubit indices are unchanged, so PassResult.qubit_permutation is None.

spec()[source]

Return a PassSpec describing the pass.

Its name is how the preparation flags and MimiqRemoteBackend identify the pass.

apply(ctx, circuit)[source]

Run the pass on circuit.

Parameters:
  • ctx – The PassContext of the run.

  • circuit – The input circuit. Return a new circuit rather than changing it in place.

Returns:

A tuple (new_circuit, PassResult). A pass that relabels qubits reports it in PassResult.qubit_permutation.