Trait QuantumOperation

Source
pub trait QuantumOperation:
    Debug
    + Send
    + Sync {
    // Required methods
    fn apply_to_state(
        &self,
        state: &ArrayView1<'_, Complex64>,
    ) -> QuantRS2Result<OperationResult>;
    fn apply_to_density_matrix(
        &self,
        rho: &ArrayView2<'_, Complex64>,
    ) -> QuantRS2Result<Array2<Complex64>>;
    fn qubits(&self) -> Vec<QubitId>;
    fn is_deterministic(&self) -> bool;
}
Expand description

Trait for quantum operations (both unitary and non-unitary)

Required Methods§

Source

fn apply_to_state( &self, state: &ArrayView1<'_, Complex64>, ) -> QuantRS2Result<OperationResult>

Apply the operation to a state vector

Source

fn apply_to_density_matrix( &self, rho: &ArrayView2<'_, Complex64>, ) -> QuantRS2Result<Array2<Complex64>>

Apply the operation to a density matrix

Source

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

Get the qubits this operation acts on

Source

fn is_deterministic(&self) -> bool

Check if the operation is deterministic

Implementors§