mqt.qecc.circuit_synthesis.strategy¶
Factory methods for creating elimination strategies.
Functions¶
|
Create strategy for CSS code elimination. |
|
Create strategy for non-CSS stabilizer code elimination. |
|
Create strategy for non-CSS elimination with rollout. |
|
Create strategy for CSS elimination with rollout. |
Module Contents¶
- for_cnot_up_to_row_ops(n_stabs: int, n: int, optimization_criterion: str = 'gates', callback: Callable[[int, TableauOperation, mqt.qecc.circuit_synthesis.types.BinaryMatrix], None] | None = None) EliminationStrategy[source]¶
Create strategy for CSS code elimination.
- Parameters:
n_stabs – The number of stabilizers.
n – The number of qubits (columns) in the check matrix
optimization_criterion – Either “gates” (minimize gate count) or “depth” (minimize circuit depth).
callback – Optional callback function invoked after each elimination step.
- Returns:
EliminationStrategy configured for CSS code elimination.
- Raises:
ValueError – If optimization_criterion is not “gates” or “depth”.
- for_non_css(n: int, optimization_criterion: str = 'gates', callback: Callable[[int, TableauOperation, mqt.qecc.circuit_synthesis.types.BinaryMatrix], None] | None = None) EliminationStrategy[source]¶
Create strategy for non-CSS stabilizer code elimination.
- Parameters:
n – Number of qubits.
optimization_criterion – Either “gates” (minimize gate count) or “depth” (minimize circuit depth).
callback – Optional callback function invoked after each elimination step.
- Returns:
EliminationStrategy configured for non-CSS code elimination with post-processing.
- Raises:
ValueError – If optimization_criterion is not “gates” or “depth”.
- for_non_css_with_rollout(n: int, optimization_criterion: str = 'gates', rollout: int = 1, num_rollout_candidates: int | list[int] = 10, enable_early_termination: bool = True, callback: Callable[[int, TableauOperation, mqt.qecc.circuit_synthesis.types.BinaryMatrix], None] | None = None, cache_max_weight: int = 1000000, num_cached_rollout_subsequences: int = 10) EliminationStrategy[source]¶
Create strategy for non-CSS elimination with rollout.
- Parameters:
n – Number of qubits.
optimization_criterion – Either “gates” (minimize gate count) or “depth” (minimize circuit depth).
rollout – Number of steps to look ahead when selecting operations.
num_rollout_candidates – Number of top candidates to explore at each rollout layer. Can be a single int (same limit for all layers) or a list of ints (one per layer).
enable_early_termination – If True, allows early termination when no improving candidates found.
callback – Optional callback function invoked after each elimination step.
cache_max_weight – Maximum weight for cached subsequences in rollout.
num_cached_rollout_subsequences – Number of subsequences to cache for rollout.
- Returns:
EliminationStrategy configured for non-CSS code elimination with rollout and post-processing.
- Raises:
ValueError – If optimization_criterion is not “gates” or “depth”.
- for_cnot_with_rollout_up_to_row_ops(n_stabs: int, n: int, rollout: int = 1, num_rollout_candidates: int | list[int] = 10, optimization_criterion: str = 'gates', enable_early_termination: bool = True, callback: Callable[[int, TableauOperation, mqt.qecc.circuit_synthesis.types.BinaryMatrix], None] | None = None, cache_max_weight: int = 1000000, num_cached_rollout_subsequences: int = 10) EliminationStrategy[source]¶
Create strategy for CSS elimination with rollout.
- Parameters:
n_stabs – The target rank of the check matrix after elimination.
n – The number of qubits (columns) in the check matrix
rollout – Number of steps to look ahead when selecting operations.
num_rollout_candidates – Number of top candidates to explore at each rollout layer. Can be a single int (same limit for all layers) or a list of ints (one per layer).
optimization_criterion – Either “gates” or “depth” for optimization objective.
enable_early_termination – If True, allows early termination when no improving candidates found.
callback – Optional callback function invoked after each elimination step.
cache_max_weight – Maximum weight for cached subsequences in rollout.
num_cached_rollout_subsequences – Number of subsequences to cache for rollout.
- Returns:
EliminationStrategy configured for CSS code elimination with rollout.
- Raises:
ValueError – If optimization_criterion is not “gates” or “depth”.