mqt.qecc.circuit_synthesis.cnot¶
CNOT-based candidate generation for CSS codes.
Classes¶
Generates CNOT candidates using greedy heuristic for CSS codes. |
Functions¶
|
Find a sequence of CNOT operations that reduces the weight of the tableau. |
|
Get all possible CNOT candidates for a CSS check matrix. |
Module Contents¶
- class GreedyCNOTGenerator(n_stabs: int, filters: Sequence[OperationFilter] | None = None)[source]¶
Bases:
mqt.qecc.circuit_synthesis.elimination.CandidateGeneratorGenerates CNOT candidates using greedy heuristic for CSS codes.
- get_candidates(tableau: mqt.qecc.circuit_synthesis.types.BinaryMatrix) Sequence[tuple[TableauOperation, int | tuple[int, ...]]][source]¶
Generate CNOT candidates sorted by heuristic score.
- Parameters:
tableau – The current check matrix.
- Returns:
List of (operation, score) tuples sorted by preference.
- escape_local_minimum(tableau: mqt.qecc.circuit_synthesis.types.BinaryMatrix) Sequence[TableauOperation] | None[source]¶
Generate candidates to escape local minimum.
- Parameters:
tableau – The current check matrix.
- Returns:
List of (operation, score) tuples for escaping local minimum.
- update(op: TableauOperation, tableau: mqt.qecc.circuit_synthesis.types.BinaryMatrix) None[source]¶
Update operation history and filters after applying an operation.
- Parameters:
op – The operation that was applied.
tableau – The resulting tableau after applying the operation.
- find_multi_step_reduction(tableau: CheckMatrix) Sequence[TableauOperation] | None[source]¶
Find a sequence of CNOT operations that reduces the weight of the tableau.
This is a brute-force search over all sequences of CNOTs up to a certain length. It is not efficient but should only be needed in very rare cases when we are stuck in a local minimum with no single-step improvements.