Trait ParametricGate

Source
pub trait ParametricGate: GateOp {
    // Required methods
    fn parameters(&self) -> Vec<Parameter>;
    fn parameter_names(&self) -> Vec<String>;
    fn with_parameters(
        &self,
        params: &[Parameter],
    ) -> QuantRS2Result<Box<dyn ParametricGate>>;
    fn with_parameter_at(
        &self,
        index: usize,
        param: Parameter,
    ) -> QuantRS2Result<Box<dyn ParametricGate>>;
    fn assign(
        &self,
        values: &[(String, f64)],
    ) -> QuantRS2Result<Box<dyn ParametricGate>>;
    fn bind(
        &self,
        values: &[(String, f64)],
    ) -> QuantRS2Result<Box<dyn ParametricGate>>;
}
Expand description

Trait for parametric gates that extends GateOp with parameter-related functionality

Required Methods§

Source

fn parameters(&self) -> Vec<Parameter>

Returns the parameters of the gate

Source

fn parameter_names(&self) -> Vec<String>

Returns the names of the parameters

Source

fn with_parameters( &self, params: &[Parameter], ) -> QuantRS2Result<Box<dyn ParametricGate>>

Returns a new gate with updated parameters

Source

fn with_parameter_at( &self, index: usize, param: Parameter, ) -> QuantRS2Result<Box<dyn ParametricGate>>

Returns a new gate with updated parameter at the specified index

Source

fn assign( &self, values: &[(String, f64)], ) -> QuantRS2Result<Box<dyn ParametricGate>>

Assigns values to symbolic parameters

Source

fn bind( &self, values: &[(String, f64)], ) -> QuantRS2Result<Box<dyn ParametricGate>>

Returns the gate with all parameters set to the specified values

Implementors§