use crate::compile::commutation::CommutationConfig;
use crate::compile::transform::decompose::unitary::TwoQubitSynthesisTarget;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct TwoQubitBlockResynthesisConfig {
pub two_qubit_target: TwoQubitSynthesisTarget,
pub max_block_ops: usize,
pub max_crossed_ops: usize,
pub max_scan_span: usize,
pub skip_labeled_ops: bool,
pub recurse_control_flow: bool,
pub commutation: CommutationConfig,
}
impl TwoQubitBlockResynthesisConfig {
pub fn normal(two_qubit_target: TwoQubitSynthesisTarget) -> Self {
Self {
two_qubit_target,
max_block_ops: 16,
max_crossed_ops: 4,
max_scan_span: 32,
skip_labeled_ops: true,
recurse_control_flow: true,
commutation: CommutationConfig {
enable_rule_oracle: true,
enable_matrix_fallback: false,
max_matrix_qubits: 4,
},
}
}
pub fn enhanced(two_qubit_target: TwoQubitSynthesisTarget) -> Self {
Self {
max_block_ops: 32,
max_crossed_ops: 8,
max_scan_span: 64,
..Self::normal(two_qubit_target)
}
}
}
impl Default for TwoQubitBlockResynthesisConfig {
fn default() -> Self {
Self::normal(TwoQubitSynthesisTarget::default())
}
}
#[cfg(test)]
#[path = "config_test.rs"]
mod config_test;