Trait ParametricGate

Source
pub trait ParametricGate:
    Debug
    + Send
    + Sync {
    // Required methods
    fn to_concrete_gates(
        &self,
        target_indices: &[usize],
        control_indices: &[usize],
    ) -> Vec<Gate>;
    fn box_clone(&self) -> Box<dyn ParametricGate>;
}
Expand description

A trait for gates that can be parametrised.

The trait defines the to_concrete_gate method for creating a concrete gate from the parametrised gate. This is required for applying the parametrised gate in a circuit or compiling it into OpenQASM.

Required Methods§

Source

fn to_concrete_gates( &self, target_indices: &[usize], control_indices: &[usize], ) -> Vec<Gate>

Creates a concrete Gate using the current parameter values.

§Arguments
  • target_indices - The indices of the target qubits.
  • control_indices - The indices of the control qubits.
§Returns

Concrete Gate::Operator variants of the parameterised gate instance.

Source

fn box_clone(&self) -> Box<dyn ParametricGate>

Clones the trait object. This is required by the Gate trait.

Trait Implementations§

Source§

impl Clone for Box<dyn ParametricGate>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§