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§
Sourcefn apply_to_gates(
&self,
gates: Vec<Box<dyn GateOp>>,
cost_model: &dyn CostModel,
) -> QuantRS2Result<Vec<Box<dyn GateOp>>>
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§
Sourcefn should_apply(&self) -> bool
fn should_apply(&self) -> bool
Check if this pass should be applied