Individual qubits can be manipulated as isolated systems, using gates like Hadamard and Pauli-X, with results often visualized on the Bloch Sphere. The true power of quantum computing does not, however, lie in manipulating single particles in isolation. It arises when connecting multiple qubits to perform parallel operations. To describe a system with more than one qubit, a mathematical method is needed to combine their vector spaces. This method is the tensor product.
In classical computing, if you have two bits, the state of the system is described by the state of the first bit and the state of the second bit. For example, if bit A is 0 and bit B is 1, the system is in the state "01".
In quantum mechanics, we cannot simply list the states side-by-side. Instead, we combine the vector space of the first qubit with the vector space of the second qubit to create a new, larger vector space. We use the tensor product operation, denoted by the symbol , to achieve this.
If qubit is in state and qubit is in state , the collective state of the system is written as:
Often, this is abbreviated as or simply .
For a single qubit, our standard basis vectors are and . When we introduce a second qubit, we take the tensor product of every combination of these basis vectors. This results in four possible computational basis states for a two-qubit system:
Notice that a single qubit lives in a 2-dimensional complex vector space (). A two-qubit system lives in a 4-dimensional space (). This pattern continues exponentially. A three-qubit system lives in an 8-dimensional space (). This exponential scaling is a fundamental characteristic of quantum systems.
Mapping individual qubit basis states to the composite state space basis.
For those more accustomed to linear algebra, the tensor product is best understood through its matrix representation, often called the Kronecker product.
If we have two vectors, and :
The tensor product is calculated by multiplying each element of the first vector by the entire second vector:
Let us look at a concrete example. Suppose we have two qubits. The first is in state and the second is in state . We want to find the vector representation of the combined state .
Recall the column vectors for the basis states:
Now we apply the tensor product operation:
The resulting vector has a 1 in the second position (index 1), which corresponds to the binary value .
In a single qubit system, we visualized states using two amplitudes ( and ). In a two-qubit system, our state vector contains four amplitudes. If the system is in a superposition, such as applying a Hadamard gate to both qubits, the state vector will have non-zero entries in all four positions.
Consider the state where both qubits are in perfect superposition (). The resulting vector has a value of in every position (since ).
Equal probability distribution for a two-qubit system after Hadamard gates are applied to both qubits.
Numpy provides a direct method for calculating tensor products: np.kron. This function stands for the Kronecker product.
When building quantum simulators from scratch, you will use this function frequently to combine state vectors and unitary matrices.
import numpy as np
# Define standard basis states as column vectors
ket_0 = np.array([[1], [0]])
ket_1 = np.array([[0], [1]])
# Calculate |0⟩ ⊗ |1⟩
# Expected result: [0, 1, 0, 0]^T
state_01 = np.kron(ket_0, ket_1)
print(f"State |01⟩ vector:\n{state_01}")
# Calculate |1⟩ ⊗ |1⟩
# Expected result: [0, 0, 0, 1]^T
state_11 = np.kron(ket_1, ket_1)
print(f"State |11⟩ vector:\n{state_11}")
Understanding tensor products is the prerequisite for working with multi-qubit gates. Just as we expanded the state vectors, we must also expand our gate matrices. A single-qubit gate like the Pauli-X is a matrix. To apply it to a two-qubit system, we must expand it into a matrix using the tensor product.
For example, if we want to apply an X gate to the second qubit while leaving the first qubit unchanged (applying the Identity matrix ), the operation on the full system is represented as .
This mathematical framework allows us to define interactions where the state of one qubit influences another, which is the foundation for the CNOT gate and quantum entanglement discussed later in this chapter.
Was this section helpful?
© 2026 ApX Machine LearningEngineered with