Trait OptimizationPass

Source
pub trait OptimizationPass {
    // Required methods
    fn optimize(
        &self,
        gates: Vec<Box<dyn GateOp>>,
    ) -> QuantRS2Result<Vec<Box<dyn GateOp>>>;
    fn name(&self) -> &str;

    // Provided method
    fn is_applicable(&self, gates: &[Box<dyn GateOp>]) -> bool { ... }
}
Expand description

Trait for optimization passes

Required Methods§

Source

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

Apply the optimization pass to a sequence of gates

Source

fn name(&self) -> &str

Get the name of this optimization pass

Provided Methods§

Source

fn is_applicable(&self, gates: &[Box<dyn GateOp>]) -> bool

Check if this pass is applicable to the given gates

Implementors§