Class | Gates::PauliZ |
In: |
rquantum.rb
|
Parent: | Object |
PauliZ gate - changes the sign of the second amplitude.
q = Qubit.new q.reset q.not g = Gates::PauliY.new q.to_vector # -> Vector[Complex(0, 0), Complex(1, 0)] g.compute q.to_vector # -> Vector[Complex(0, 0), Complex(-1, 0)]
Takes vector with two complex numbers (amplitudes), perform PauliZ operation and returns new vector.