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§
Sourcefn apply_to_state(
&self,
state: &ArrayView1<'_, Complex64>,
) -> QuantRS2Result<OperationResult>
fn apply_to_state( &self, state: &ArrayView1<'_, Complex64>, ) -> QuantRS2Result<OperationResult>
Apply the operation to a state vector
Sourcefn apply_to_density_matrix(
&self,
rho: &ArrayView2<'_, Complex64>,
) -> QuantRS2Result<Array2<Complex64>>
fn apply_to_density_matrix( &self, rho: &ArrayView2<'_, Complex64>, ) -> QuantRS2Result<Array2<Complex64>>
Apply the operation to a density matrix
Sourcefn is_deterministic(&self) -> bool
fn is_deterministic(&self) -> bool
Check if the operation is deterministic