mqt.qecc.circuit_synthesis.exact.extraction¶
Circuit extraction from SAT models.
Functions¶
|
Extract Clifford circuit from gate-count SAT model. |
|
Extract Clifford circuit from depth SAT model. |
|
Extract CNOT circuit from gate-count SAT model. |
|
Extract CNOT circuit from depth SAT model. |
Module Contents¶
- extract_clifford_gate_count_circuit(model: z3.ModelRef, n: int, max_gates: int, enc: CliffordGateCountVars, k: int, pivot_qubits: list[int] | None = None) CliffordIsometry[source]¶
Extract Clifford circuit from gate-count SAT model.
The synthesis builds the circuit in reverse (reducing target to identity), so we invert and reverse the gate sequence using each gate class’s
inverse_stim_gate().- Parameters:
model – Z3 model from satisfiable formula.
n – Number of qubits.
max_gates – Maximum number of gates.
enc – Variable container returned by
encode_clifford_gate_count().k – Number of logical qubits.
pivot_qubits – Qubits to reset (stabilizer/ancilla qubits). Determined from the satisfying model; defaults to range(k, n) if not provided.
- Returns:
Extracted CliffordIsometry circuit.
- extract_clifford_depth_circuit(model: z3.ModelRef, n: int, max_depth: int, enc: CliffordDepthVars, k: int, pivot_qubits: list[int] | None = None) CliffordIsometry[source]¶
Extract Clifford circuit from depth SAT model.
The synthesis builds the circuit in reverse (reducing target to identity), so we invert and reverse the layer sequence.
The variable index structure recorded in
enc.gate_varsis decoded by inspecting the number of booleans per layer:nentries → single-qubit gate; the index equals the qubit.n*(n-1)entries → ordered two-qubit gate (CX-like); the pair(ctrl, tgt)is decoded fromctrl*(n-1) + (tgt if tgt < ctrl else tgt-1).n*(n-1)//2entries → symmetric two-qubit gate (CZ-like); the pair(i, j)withi < jis decoded fromi*(2n-i-1)//2 + (j-i-1).
- Parameters:
model – Z3 model from satisfiable formula.
n – Number of qubits.
max_depth – Maximum depth.
enc – Variable container returned by
encode_clifford_depth().k – Number of logical qubits.
pivot_qubits – Qubits to reset (stabilizer/ancilla qubits). Determined from the satisfying model; defaults to range(k, n) if not provided.
- Returns:
Extracted CliffordIsometry circuit.
- extract_cnot_gate_count_circuit(model: z3.ModelRef, n: int, max_gates: int, alpha_vars: list[z3.BitVecRef], beta_vars: list[z3.BitVecRef], init_x: list[int], init_z: list[int]) CNOTCircuit[source]¶
Extract CNOT circuit from gate-count SAT model.
The synthesis builds the circuit in reverse (reducing target to identity), so we need to reverse the CNOT sequence.
- Parameters:
- Returns:
Extracted CNOTCircuit.
- extract_cnot_depth_circuit(model: z3.ModelRef, n: int, max_depth: int, cx_vars: list[list[z3.BoolRef]], init_x: list[int], init_z: list[int]) CNOTCircuit[source]¶
Extract CNOT circuit from depth SAT model.
The synthesis builds the circuit in reverse (reducing target to identity), so we need to reverse the layer sequence.