mqt.qecc.circuit_synthesis.exact.terminal¶
Terminal constraint builders for exact synthesis.
Functions¶
|
Add terminal constraints for Clifford unitary synthesis. |
|
Add terminal constraints for general Clifford isometry synthesis. |
|
Add terminal constraints for stabilizer-state preparation. |
|
Add terminal constraints for CSS CNOT isometry synthesis. |
|
Add terminal constraints for CSS state preparation. |
Module Contents¶
- add_clifford_unitary_terminal(solver: z3.Solver, n: int, tableau_x_final: numpy.typing.NDArray[object_], tableau_z_final: numpy.typing.NDArray[object_], allow_permutation: bool = True) None[source]¶
Add terminal constraints for Clifford unitary synthesis.
For k=n (no stabilizer rows), the final tableau should be identity up to qubit permutation if allowed.
- Parameters:
solver – Z3 solver instance.
n – Number of qubits.
tableau_x_final – Final X part of tableau (2n x n array of z3.BoolRef).
tableau_z_final – Final Z part of tableau (2n x n array of z3.BoolRef).
allow_permutation – Allow final qubit permutation.
- add_clifford_isometry_terminal(solver: z3.Solver, n: int, k: int, tableau_x_final: numpy.typing.NDArray[object_], tableau_z_final: numpy.typing.NDArray[object_], allow_permutation: bool = True) None[source]¶
Add terminal constraints for general Clifford isometry synthesis.
For k < n, require: - Stabilizer X-part is zero - Exactly n-k pivot columns in stabilizer Z-part - Each logical qubit selects one non-pivot column with canonical X/Z pair - Non-pivot non-selected entries vanish - Pivot columns have no logical X-support
The pivot columns (stabilizer qubits) are determined at extraction time by reading the satisfying model, so they are free to be any n-k columns. This gives the solver maximum freedom and avoids forced SWAP overhead.
- Parameters:
solver – Z3 solver instance.
n – Number of physical qubits.
k – Number of logical qubits.
tableau_x_final – Final X part of tableau (num_rows x n array of z3.BoolRef).
tableau_z_final – Final Z part of tableau (num_rows x n array of z3.BoolRef).
allow_permutation – Allow logical qubit permutation.
- add_stabilizer_state_terminal(solver: z3.Solver, n: int, tableau_x_final: numpy.typing.NDArray[object_], _tableau_z_final: numpy.typing.NDArray[object_]) None[source]¶
Add terminal constraints for stabilizer-state preparation.
For k=0, require stabilizer X-part to be zero.
- Parameters:
solver – Z3 solver instance.
n – Number of qubits.
tableau_x_final – Final X part of tableau (n x n array of z3.BoolRef).
_tableau_z_final – Final Z part of tableau (unused for stabilizer state terminal).
- add_css_isometry_terminal(solver: z3.Solver, n: int, k: int, m_x: int, matrix_final: numpy.typing.NDArray[object_]) None[source]¶
Add terminal constraints for CSS CNOT isometry synthesis.
- Parameters:
solver – Z3 solver instance.
n – Number of physical qubits.
k – Number of logical qubits.
m_x – Number of independent X-stabilizer generators (rank of H_X).
matrix_final – Final CSS matrix [L; H] (num_rows x n array of z3.BoolRef).
- add_css_state_terminal(solver: z3.Solver, n: int, m_x: int, matrix_final: numpy.typing.NDArray[object_]) None[source]¶
Add terminal constraints for CSS state preparation.
For k=0, the matrix contains only stabilizer rows. Require exactly m_x pivot columns.
- Parameters:
solver – Z3 solver instance.
n – Number of qubits.
m_x – Number of independent X-stabilizers.
matrix_final – Final CSS matrix (m_x x n array of z3.BoolRef).