- C20250002's blog
Quantum gates
- @ 2026-3-22 19:00:11
Reference : (cannot access in Mainland China)
Quantum Coding Site : (cannot access in Mainland China)
HGate(*args[, _force_mutable])
Single-qubit Hadamard gate.
h()
$$H=\frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}$$ ┌───┐
q_0: ┤ H ├
└───┘
IGate(*args[, _force_mutable])
Identity gate.
id()
┌───┐
q_0: ┤ I ├
└───┘
PhaseGate(theta[, label])
Single-qubit rotation about the Z axis.
p()
$$P(\theta)= \begin{pmatrix} 1 & 0 \\ 0 & e^{i\theta} \end{pmatrix}$$ ┌──────┐
q_0: ┤ P(θ) ├
└──────┘
RGate(theta, phi[, label])
Rotation around the axis.
r()
$$R(\theta,\phi)=e^{-i\frac{\theta}{2}(\cos\phi x+\sin\phi y)}= \begin{pmatrix} \cos(\frac{\theta}{2}) & -ie^{-i\phi}\sin(\frac{\theta}{2}) \\ -ie^{i\phi}\sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2}) \end{pmatrix}$$ ┌────────┐
q_0: ┤ R(θ,φ) ├
└────────┘
RXGate(theta[, label])
Single-qubit rotation about the X axis.
rx()
$$RX(\theta)=\exp(-i\frac{\theta}{2}X)= \begin{pmatrix} \cos(\frac{\theta}{2}) & -i\sin(\frac{\theta}{2}) \\ -i\sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2}) \end{pmatrix}$$ ┌───────┐
q_0: ┤ Rx(ϴ) ├
└───────┘
RYGate(theta[, label])
Single-qubit rotation about the Y axis.
ry()
$$RX(\theta)=\exp(-i\frac{\theta}{2}Y)= \begin{pmatrix} \cos(\frac{\theta}{2}) & -\sin(\frac{\theta}{2}) \\ \sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2}) \end{pmatrix}$$ ┌───────┐
q_0: ┤ Ry(ϴ) ├
└───────┘
RZGate(theta[, label])
Single-qubit rotation about the X axis.
rz()
$$RX(\phi)=\exp(-i\frac{\phi}{2}Z)= \begin{pmatrix} e^{-i\frac{\phi}{2}} & 0 \\ 0 & e^{i\frac{\phi}{2}} \end{pmatrix}$$ ┌───────┐
q_0: ┤ Rz(φ) ├
└───────┘