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)]
Takes vector with two complex numbers (amplitudes), perform Phase Shift operation and returns new vector.