Struct quantum::gate::Gate
[−]
[src]
pub struct Gate { /* fields omitted */ }
Represents a quantum gate: a quantum regster transformation.
This gate is tagged with a width
, and contains a unitary matrix
representing the numerical transformation in the computational
basis.
This gate may be applied to a ket to update the ket's state.
Currently we do not check whether the matrix is unitary.
See Wikipedia for more information.
Methods
impl Gate
[src]
fn new(width: usize, matrix: Matrix) -> Gate
Construct a new quantum gate, given width
and computational basis matrix.
Currently we do not check whether the matrix is unitary.
Panics
We panic if the supplied matrix is non-square or not of dimension width
.
fn width(&self) -> usize
Width of the gate.
fn matrix(&self) -> &Matrix
Representative matrix.