Class Gates::PhaseShifter
In: rquantum.rb
Parent: Object

The phase shifter gate. It takes one parameter - theta - which is phase shift.

 q = Qubit.new
 q.not
 g = Gates::PhaseShifter 0.2
 q.to_vector                # -> Vector[Complex(0, 0), Complex(1, 0)]
 g.compute q.to_vector      # -> Vector[Complex(0, 0), Complex(1.0, -4.89842541528951e-16)]

Methods

compute   new  

Public Class methods

Creates new phase shifter gate, using given value as theta.

Public Instance methods

Takes vector with two complex numbers (amplitudes), perform Phase Shift operation and returns new vector.

[Validate]