Pauli X gate
Installation Required: This functionality requires MATLAB Support Package for Quantum Computing.
Pauli X Gate and Its Matrix Representation
Create a Pauli X gate that acts on a single qubit.
g = xGate(1)
g = SimpleGate with properties: Type: "x" ControlQubits: [1×0 double] TargetQubits: 1 Angles: [1×0 double]
Get the matrix representation of the gate.
M = getMatrix(g)
M = 0 1 1 0
Array of Pauli X Gates
Create an array of Pauli X gates that act on qubits with indices 1 to 4.
g = xGate(1:4)
g = 4×1 SimpleGate array with gates: Id Gate Control Target 1 x 1 2 x 2 3 x 3 4 x 4
targetQubit — Target qubit of gate
positive integer scalar | positive integer vector
Target qubit of the gate, specified as a positive integer scalar index or vector of qubit indices.
Matrix Representation of Pauli X Gate
The matrix representation of a Pauli X gate applied to a single qubit is
This gate maps the state to the state and maps the state to the state. This gate is also known as a bit-flip gate and is the quantum equivalent of the classical NOT gate.
Introduced in R2023a