Skip to main content

BatchGateOp

Trait BatchGateOp 

Source
pub trait BatchGateOp: GateOp {
    // Required method
    fn apply_batch(
        &self,
        batch: &mut BatchStateVector,
        target_qubits: &[QubitId],
    ) -> QuantRS2Result<()>;

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

Trait for batch-optimized gates

Required Methods§

Source

fn apply_batch( &self, batch: &mut BatchStateVector, target_qubits: &[QubitId], ) -> QuantRS2Result<()>

Apply this gate to a batch of states

Provided Methods§

Source

fn has_batch_optimization(&self) -> bool

Check if this gate has batch optimization

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl BatchGateOp for Hadamard

Source§

impl BatchGateOp for PauliX

Batch-optimized Pauli-X gate