mqt.qecc.circuit_synthesis.exact.encoding_depth

Depth encoding builders for exact synthesis.

Functions

encode_clifford_depth(target, k, max_depth[, ...]) → mqt.qecc.circuit_synthesis.exact.vars.CliffordDepthVars

Encode Clifford isometry synthesis with depth optimization.

encode_css_depth(target, k, m_x, max_depth[, gate_set]) → tuple[z3.Solver, list[list[z3.BoolRef]], list[list[z3.BoolRef]]]

Encode CSS CNOT isometry synthesis with depth optimization.

Module Contents

encode_clifford_depth(target: StabilizerTableau, k: int, max_depth: int, allow_qubit_permutation: bool = True, gate_set: dict[str, type[SymbolicGateOperation]] | None = None) → CliffordDepthVars[source]

Encode Clifford isometry synthesis with depth optimization.

Uses the provided gate set to dynamically support registered Clifford gates. Defaults to {H, S, CX, ID} if no gate set is provided. Pass a gate set containing "CZ" to also allow CZ gates.

Parameters:
  • target – Target stabilizer tableau (2k+m rows, where m=n-k stabilizers).

  • k – Number of logical qubits.

  • max_depth – Maximum circuit depth.

  • allow_qubit_permutation – Allow final qubit permutation.

  • gate_set – Optional custom gate set. If None, uses standard {H, S, CX, ID}.

Returns:

A CliffordDepthVars container holding the solver and all SAT variables. gate_vars maps each gate name to a [layer][idx] boolean array; n holds the qubit count needed by consumers to decode pair indices.

encode_css_depth(target: CheckMatrix, k: int, m_x: int, max_depth: int, gate_set: dict[str, type[SymbolicGateOperation]] | None = None) → tuple[z3.Solver, list[list[z3.BoolRef]], list[list[z3.BoolRef]]][source]

Encode CSS CNOT isometry synthesis with depth optimization.

Supports both X-type and Z-type check matrices. For X-type targets, CNOT(ctrl, tgt) adds column ctrl to column tgt (X propagates ctrl→tgt). For Z-type targets, CNOT(ctrl, tgt) adds column tgt to column ctrl (Z propagates tgt→ctrl), so the pivot columns of the reduced matrix are the qubits initialized in |0⟩.

Uses the provided gate set to dynamically support registered CSS gates. Defaults to {CX, ID} if no gate set is provided.

Parameters:
  • target – Target CSS matrix [L; H] (X-type or Z-type).

  • k – Number of logical qubits.

  • m_x – Number of stabilizer rows (rank of the stabilizer block).

  • max_depth – Maximum circuit depth.

  • gate_set – Optional custom gate set. If None, uses standard {CX, ID}.

Returns:

Tuple of (solver, cx_vars, id_vars).