pub trait GateOp:
Debug
+ Send
+ Sync {
// Required methods
fn name(&self) -> &'static str;
fn qubits(&self) -> Vec<QubitId>;
fn matrix(&self) -> Result<Vec<Complex<f64>>, QuantRS2Error>;
fn as_any(&self) -> &(dyn Any + 'static);
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§
Sourcefn matrix(&self) -> Result<Vec<Complex<f64>>, QuantRS2Error>
fn matrix(&self) -> Result<Vec<Complex<f64>>, QuantRS2Error>
Returns the matrix representation of this gate
Sourcefn clone_gate(&self) -> Box<dyn GateOp>
fn clone_gate(&self) -> Box<dyn GateOp>
Clone the gate into a new boxed instance
Provided Methods§
Sourcefn num_qubits(&self) -> usize
fn num_qubits(&self) -> usize
Returns the number of qubits this gate acts on
Sourcefn is_parameterized(&self) -> bool
fn is_parameterized(&self) -> bool
Returns true if this gate is parameterized