QuantumGates

Trait QuantumGates 

Source
pub trait QuantumGates {
    // Required methods
    fn gate_identity() -> Self;
    fn gate_x() -> Self;
    fn gate_y() -> Self;
    fn gate_z() -> Self;
    fn gate_hadamard() -> Self;
    fn gate_s() -> Self;
    fn gate_t() -> Self;
}
Expand description

A suite of standard Quantum Gates (Unitary Operators). These are constructed as elements of the algebra (End(A)).

Mapping logic for Cl(0, n) metric:

  • Pauli X ~ i * Gamma_1
  • Pauli Y ~ i * Gamma_2
  • Pauli Z ~ i * Gamma_1 * Gamma_2

(The factor of ‘i’ is required because Gamma^2 = -1 in Spin(10), but Pauli Matrices must square to +1).

Required Methods§

Source

fn gate_identity() -> Self

The Identity Operator (No-op)

Source

fn gate_x() -> Self

Pauli-X (NOT Gate). Flips |0> to |1>.

Source

fn gate_y() -> Self

Pauli-Y. Maps |0> -> i|1> and |1> -> -i|0>.

Source

fn gate_z() -> Self

Pauli-Z (Phase Flip). Leaves |0> unchanged, maps |1> -> -|1>.

Source

fn gate_hadamard() -> Self

Hadamard Gate (H). Creates Superposition: |0> -> (|0> + |1>)/sqrt(2). Definition: H = (X + Z) / sqrt(2).

Source

fn gate_s() -> Self

Phase Gate (S). Z-rotation by 90 degrees.

Source

fn gate_t() -> Self

T Gate (pi/8). Z-rotation by 45 degrees.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§