OptimizationPass

Trait OptimizationPass 

Source
pub trait OptimizationPass: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn apply_to_gates(
        &self,
        gates: Vec<Box<dyn GateOp>>,
        cost_model: &dyn CostModel,
    ) -> QuantRS2Result<Vec<Box<dyn GateOp>>>;

    // Provided method
    fn should_apply(&self) -> bool { ... }
}
Expand description

Trait for optimization passes (object-safe version)

Required Methods§

Source

fn name(&self) -> &str

Name of the optimization pass

Source

fn apply_to_gates( &self, gates: Vec<Box<dyn GateOp>>, cost_model: &dyn CostModel, ) -> QuantRS2Result<Vec<Box<dyn GateOp>>>

Apply the optimization pass to a gate list

Provided Methods§

Source

fn should_apply(&self) -> bool

Check if this pass should be applied

Implementors§