Ang pahinang ito ay hindi pa naisalin. Nakikita mo ang orihinal na bersyon sa Ingles.
Quantum algorithms: Phase estimation
Kento Ueda (15 May 2024)
This notebook provides the fundamental concepts and implementation of the Quantum Fourier Transformation (QFT) and Quantum Phase Estimation (QPE).
Download the pdf of the original lecture. Note that some code snippets might become deprecated since these are static images.
Approximate QPU time to run this experiment is 7 seconds.
1. Introduction
Quantum Fourier Transformation (QFT)
The Quantum Fourier Transformation is the quantum counterpart of the classical discrete Fourier transform. It is a linear transformation applied to the quantum states, mapping computational bases into their Fourier basis representations. The QFT plays a key role in many quantum algorithms, offering an efficient method to extract periodicity information from quantum states. The QFT can be implemented with operations with quantum gates such as Hadamard gates and Control-Phase gates for qubits, enabling exponential speedup over classical Fourier transformation.
- Applications: It is a foundational part in quantum algorithms such as Shor's algorithm for factoring large integers and discrete logarithm.
Quantum Phase Estimation (QPE)
Quantum Phase Estimation is a quantum algorithm used to estimate the phase associated with an eigenvector of a unitary operator. This algorithm provides a bridge between the abstract mathematical properties of quantum states and their computational applications.
- Applications: It can solve problems such as finding eigenvalues of unitary matrices and simulating quantum systems.
Together, QFT and QPE form the essential backbone of many quantum algorithms solving problems that are infeasible for classical computers. By the end of this notebook, you will gain an understanding of how these techniques are implemented.
2. Basic of Quantum Fourier Transformation (QFT)
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit_aer import AerSimulator
from qiskit.visualization import plot_histogram, plot_bloch_multivector
from qiskit.quantum_info import Statevector
from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
from qiskit_ibm_runtime import Sampler
from numpy import pi
From the analogy with the discrete Fourier transform, the QFT acts on a quantum state for qubits and maps it to the quantum state .
where .
Or the unitary matrix representation:
2.1. Intuition
The quantum Fourier transform (QFT) transforms between two bases, the computational (Z) basis, and the Fourier basis. But what does the Fourier basis mean in this context? You likely recall that the Fourier transform of a function describes the convolution of onto a sinusoidal function with frequency . In Layman's terms: the Fourier transform is a function describing how much of each frequency we would need to build up a function out of sine functions (or cosine functions). To get a better sense for what the QFT means in this context, consider the stepped images below which show a number encoded in binary, using four qubits:
In the computational basis, we store numbers in binary using the states and .
Note the frequency with which the different qubits change; the leftmost qubit flips with every increment in the number, the next with every 2 increments, the third with every 4 increments, and so on.
If we apply a quantum Fourier transform to these states, we map
(We often denote states in the Fourier basis using the tilde (~)).
In the Fourier basis, we store numbers using different rotations around the Z-axis:
IFRAME
The number we want to store dictates the angle at which each qubit is rotated around the Z-axis. In the state , all qubits are in the state . As seen in the example above, to encode the state on 4 qubits, we rotated the leftmost qubit by full turns (