Z, S, and CZ#
from qualtran import Bloq, CompositeBloq, BloqBuilder, Signature, Register
from qualtran import QBit, QInt, QUInt, QAny
from qualtran.drawing import show_bloq, show_call_graph, show_counts_sigma
from typing import *
import numpy as np
import sympy
import cirq
ZGate
#
The Z gate.
This causes a phase flip: Z|+> = |-> and vice-versa.
from qualtran.bloqs.basic_gates import ZGate
Example Instances#
zgate = ZGate()
Graphical Signature#
from qualtran.drawing import show_bloqs
show_bloqs([zgate],
['`zgate`'])
SGate
#
The S gate.
The unitary matrix of SGate
is
$$
(1)#\[\begin{bmatrix}
1 & 0 \\
0 & i
\end{bmatrix}\]
$$
It is the ‘square root’ of the Z gate: \(S\cdot S = Z\).
Registers#
q
: The qubit
from qualtran.bloqs.basic_gates import SGate
Example Instances#
s_gate = SGate()
Graphical Signature#
from qualtran.drawing import show_bloqs
show_bloqs([s_gate],
['`s_gate`'])
CZ
#
Two-qubit controlled-Z gate.
Registers#
ctrl
: One-bit control register.target
: One-bit target register.
from qualtran.bloqs.basic_gates import CZ
Example Instances#
cz = CZ()
Graphical Signature#
from qualtran.drawing import show_bloqs
show_bloqs([cz],
['`cz`'])