Basic Quantum Circuit (2)
With the foundational concepts from Basic Quantum Circuit (1), we’re now ready to explore somekey techniques and tools that expand the power of quantum circuits. In this post, we’ll discuss how quantum information is maneuvered inside a quantum computer—specifically through quantum wire swapping—and introduce two essential quantum transformations: the uniform superposition and the quantum Hadamard transform
Outline
- Quantum Wire Swapping (SWAP Gate): qubit states are exchanged within a circuit using the SWAP gate, usually implemented by a sequence of three CNOT gates.
- Uniform Superposition: generate a uniform superposition—a state where all possible computational basis states appear with equal probability—using Hadamard gates.
- Quantum Hadamard Transform: a multi-qubit extension that plays a central role in algorithms like Deutsch-Jozsa and Simon’s.
Quantum Wire Swapping (SWAP Gate)
SWAP Gate is defined as:
$$\text{SWAP} \quad \lvert a,b \rangle = \lvert b,a\rangle$$
With its matrix form as:
$$\text{SWAP} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1\end{bmatrix}$$
SWAP gate is highly important in practical quantum computing, primarily because of the limitations in real quantum hardware connectivity. Since qubits on many current quantum chips are not all directly connected to each other, it is often necessary to move quantum information between qubits to enable interactions for subsequent operations. The SWAP gate enables this by exchanging the states of two qubits, effectively moving the quantum state without altering the data itself.
Uniform Superposition
All possible basis states have the same amplitude magnitude.
For one single qubit, the uniform superposition is:
$$\lvert \psi \rangle = \dfrac{\lvert 0 \rangle + \lvert 1 \rangle}{\sqrt{2}}$$
- Both $\lvert 0 \rangle \quad \lvert 1 \rangle$ have equal amplitude magnitude $1/\sqrt{2}$
- Probability of measuing $0 = 1/2$ and $1 = 1/2$ respectively
For n qubits, there are $2^n$ basis state, and is written as:
$$\dfrac{1}{\sqrt{2^n}} \sum_{x \in \set{0, 1}^n} \lvert x \rangle$$
For two qubits, the uniform superposition is:
$$\lvert \psi \rangle = \dfrac{\lvert 00 \rangle + \lvert 01 \rangle + \lvert 10 \rangle + \lvert 11 \rangle}{2}$$
This indicates each of the 4 basis states has probability $\dfrac{1}{4}$.
The uniform superposition state holds profound significance in quantum computing beyond just being the starting point of Grover’s algorithm.
Quantum Hadamard Transform
An operation that applies the Hadamard gate to each qubit in a quantum register. This simultaneous application creates a structured superposition of states, serving as a cornerstone for many quantum algorithms.
With n qubits, the Hadamard Transform is written as:
$$H^{\otimes n} = H \otimes H \otimes \cdots \otimes H$$
Commonly acts on a computational basis state $\lvert x \rangle$ which is a n-bit string as:
$$H^{\otimes n} \lvert x \rangle = \dfrac{1}{\sqrt{2^n}} \sum_{x \in \set{0,1}^n} (-1)^{x \cdot y} \lvert x \rangle$$
- $x \cdot y = x_1y_1 + x_2y_2 + \cdots + x_ny_n \mod 2$
In summary, we have now covered the essential building blocks and concepts needed to understand virtually any quantum algorithm. By looking at these ideas from two complementary perspectives—the operation of quantum logic gates and the formation of quantum states—you can clearly see both how they work and why they matter.
With this foundation in place, we are ready to move beyond the basics. In upcoming posts, we will dive deeper into more sophisticated quantum techniques and explore well-known algorithms in detail, revealing how these concepts come together to unlock the true potential of quantum computing.