Quantum Gates on Dynex
Quantum gates are the building blocks of quantum circuits. Each gate performs a specific unitary operation on one or more qubits, altering their probability amplitudes and phases. Dynex supports all standard gates via PennyLane, Qiskit, and OpenQASM.Single-Qubit Gates
Pauli-X (NOT gate)
Flips the qubit state: X|0⟩ = |1⟩, X|1⟩ = |0⟩.| Framework | Syntax |
|---|---|
| PennyLane | qml.PauliX(wires=0) |
| OpenQASM | x q[0]; |
| Qiskit | qc.x(0) |
Pauli-Y
Phase flip then bit flip: Y|0⟩ = i|1⟩, Y|1⟩ = −i|0⟩.| Framework | Syntax |
|---|---|
| PennyLane | qml.PauliY(wires=0) |
| OpenQASM | y q[0]; |
| Qiskit | qc.y(0) |
Pauli-Z
Phase flip: Z|0⟩ = |0⟩, Z|1⟩ = −|1⟩.| Framework | Syntax |
|---|---|
| PennyLane | qml.PauliZ(wires=0) |
| OpenQASM | z q[0]; |
| Qiskit | qc.z(0) |
Hadamard (H)
Creates equal superposition: H|0⟩ = (|0⟩ + |1⟩)/√2.| Framework | Syntax |
|---|---|
| PennyLane | qml.Hadamard(wires=0) |
| OpenQASM | h q[0]; |
| Qiskit | qc.h(0) |
T Gate
Applies a π/4 phase shift. Non-Clifford gate essential for universal quantum computation.| Framework | Syntax |
|---|---|
| PennyLane | qml.T(wires=0) |
| OpenQASM | t q[0]; |
| Qiskit | qc.t(0) |
Rotation Gates
RX, RY, RZ
Single-axis rotations by angleθ.
| Gate | PennyLane | Qiskit |
|---|---|---|
| RX | qml.RX(theta, wires=0) | qc.rx(theta, 0) |
| RY | qml.RY(theta, wires=0) | qc.ry(theta, 0) |
| RZ | qml.RZ(theta, wires=0) | qc.rz(theta, 0) |
Two-Qubit Gates
CNOT (CX)
Flips target qubit if control qubit is |1⟩.| Framework | Syntax |
|---|---|
| PennyLane | qml.CNOT(wires=[0, 1]) |
| OpenQASM | cx q[0], q[1]; |
| Qiskit | qc.cx(0, 1) |
Controlled-Z (CZ)
Applies Z to target if control is |1⟩.| Framework | Syntax |
|---|---|
| PennyLane | qml.CZ(wires=[0, 1]) |
| OpenQASM | cz q[0], q[1]; |
| Qiskit | qc.cz(0, 1) |
SWAP (Fredkin)
Exchanges the states of two qubits.| Framework | Syntax |
|---|---|
| PennyLane | qml.SWAP(wires=[0, 1]) |
| OpenQASM | swap q[0], q[1]; |
| Qiskit | qc.swap(0, 1) |
Controlled Rotations (CRX, CRY, CRZ)
Apply rotation to target qubit if control is |1⟩.| Gate | PennyLane | Qiskit |
|---|---|---|
| CRX | qml.CRX(theta, wires=[0, 1]) | qc.crx(theta, 0, 1) |
| CRY | qml.CRY(theta, wires=[0, 1]) | qc.cry(theta, 0, 1) |
| CRZ | qml.CRZ(theta, wires=[0, 1]) | qc.crz(theta, 0, 1) |
Controlled Phase Shift
Applies phase shift to target if control is |1⟩.| Framework | Syntax |
|---|---|
| PennyLane | qml.ControlledPhaseShift(theta, wires=[0, 1]) |
| Qiskit | qc.cp(theta, 0, 1) |
Three-Qubit Gates
Toffoli (CCNOT)
Flips target if both control qubits are |1⟩.| Framework | Syntax |
|---|---|
| PennyLane | qml.Toffoli(wires=[0, 1, 2]) |
| OpenQASM | ccx q[0], q[1], q[2]; |
| Qiskit | qc.ccx(0, 1, 2) |