Trait GateDecomposable

Source
pub trait GateDecomposable: GateOp {
    // Required method
    fn decompose(&self) -> QuantRS2Result<Vec<Box<dyn GateOp>>>;

    // Provided method
    fn is_decomposable(&self) -> bool { ... }
}
Expand description

Trait for gate decomposition

Required Methods§

Source

fn decompose(&self) -> QuantRS2Result<Vec<Box<dyn GateOp>>>

Decompose the gate into a sequence of simpler gates

Provided Methods§

Source

fn is_decomposable(&self) -> bool

Check if the gate can be decomposed

Implementors§

Source§

impl GateDecomposable for CRX

Implementation of GateDecomposable for CRX gate

Source§

impl GateDecomposable for CRY

Implementation of GateDecomposable for CRY gate

Source§

impl GateDecomposable for CRZ

Implementation of GateDecomposable for CRZ gate

Source§

impl GateDecomposable for Fredkin

Implementation of GateDecomposable for Fredkin gate

Source§

impl GateDecomposable for SWAP

Implementation of GateDecomposable for SWAP gate

Source§

impl GateDecomposable for Toffoli

Implementation of GateDecomposable for Toffoli gate

Source§

impl GateDecomposable for CompositeGate