GateOp

Trait GateOp 

Source
pub trait GateOp:
    Debug
    + Send
    + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn qubits(&self) -> Vec<QubitId>;
    fn matrix(&self) -> QuantRS2Result<Vec<Complex64>>;
    fn as_any(&self) -> &dyn Any;
    fn clone_gate(&self) -> Box<dyn GateOp>;

    // Provided methods
    fn num_qubits(&self) -> usize { ... }
    fn is_parameterized(&self) -> bool { ... }
}
Expand description

Trait for quantum gate operations

Required Methods§

Source

fn name(&self) -> &'static str

Returns the name of the gate

Source

fn qubits(&self) -> Vec<QubitId>

Returns the qubits that this gate acts on

Source

fn matrix(&self) -> QuantRS2Result<Vec<Complex64>>

Returns the matrix representation of this gate

Source

fn as_any(&self) -> &dyn Any

Downcast to concrete gate type

Source

fn clone_gate(&self) -> Box<dyn GateOp>

Clone the gate into a new boxed instance

Provided Methods§

Source

fn num_qubits(&self) -> usize

Returns the number of qubits this gate acts on

Source

fn is_parameterized(&self) -> bool

Returns true if this gate is parameterized

Trait Implementations§

Source§

impl Clone for Box<dyn GateOp>

Implement Clone for Box<dyn GateOp>

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§

Source§

impl GateOp for ControlledGate

Source§

impl GateOp for FredkinGate

Source§

impl GateOp for MultiControlledGate

Source§

impl GateOp for ToffoliGate

Source§

impl GateOp for CompositeGate

Source§

impl GateOp for HolonomicGateOp

Source§

impl GateOp for CustomGate

Source§

impl GateOp for ParametricCRX

Source§

impl GateOp for ParametricPhaseShift

Source§

impl GateOp for ParametricRotationX

Source§

impl GateOp for ParametricRotationY

Source§

impl GateOp for ParametricRotationZ

Source§

impl GateOp for ParametricU

Source§

impl GateOp for VariationalGate

Source§

impl GateOp for GlobalPhase

Source§

impl GateOp for RGate

Source§

impl GateOp for CH

Source§

impl GateOp for CNOT

Source§

impl GateOp for CRX

Source§

impl GateOp for CRY

Source§

impl GateOp for CRZ

Source§

impl GateOp for CS

Source§

impl GateOp for CSX

Source§

impl GateOp for CY

Source§

impl GateOp for CZ

Source§

impl GateOp for DCX

Source§

impl GateOp for ECR

Source§

impl GateOp for Fredkin

Source§

impl GateOp for ISwap

Source§

impl GateOp for RXX

Source§

impl GateOp for RYY

Source§

impl GateOp for RZX

Source§

impl GateOp for RZZ

Source§

impl GateOp for SWAP

Source§

impl GateOp for Toffoli

Source§

impl GateOp for XXMinusYY

Source§

impl GateOp for XXPlusYY

Source§

impl GateOp for Hadamard

Source§

impl GateOp for Identity

Source§

impl GateOp for PGate

Source§

impl GateOp for PauliX

Source§

impl GateOp for PauliY

Source§

impl GateOp for PauliZ

Source§

impl GateOp for Phase

Source§

impl GateOp for PhaseDagger

Source§

impl GateOp for RotationX

Source§

impl GateOp for RotationY

Source§

impl GateOp for RotationZ

Source§

impl GateOp for SqrtX

Source§

impl GateOp for SqrtXDagger

Source§

impl GateOp for T

Source§

impl GateOp for TDagger

Source§

impl GateOp for UGate