Author: Yiming Ding
Last update: Jan 9, 2024
1) Introduction
Though the relation between BQP and NP has not been understood clearly, it is expected that quantum computation can solve problems that are intractable for classical computation. Adiabatic quantum computation (AQC) serves as one of the paradigms (computational model) for quantum computation, which utilizes the well-known quantum adiabatic theorem, and has achieved fast development in decades [1, 2].
In this page, I will take a simple satisfiability (SAT) problem as an example, to show how AQC can be implemented to mathematical problems. It is assumed that you have had some basic knowledge of quantum mechanics and quantum computing especially the unitary gates and quantum measurement. Classical simulation of quantum circuits with programming will also be introduced for validating the efficacy of our algorithm, therefore you should better have some programming experience as well.
2) SAT problem
A logical form is called a conjunctive norm form (CNF) if it takes the form like
where
When all brackets have and only have
A
As a specific example, we consider three boolean variables
One can easily determine the solution for this demo problem via enumerating and obtain the two sets of solutions
3) Quantum adiabatic theorem
The archetypal Hamiltonian of AQC is
where
Initially, we set
4) Mathematical mapping
The key idea here is to encode the solution as the ground state of
Consider the mapping
where
Notice that for
for which the case that
Simiarly, we can construct
Then our goal becomes finding the ground state of
Take
where
Therefore, under Trotter-Suzuki expansion, the evolution operator becomes
which can be rewritten by a series of rotation gates and CNOT gates.
The ground state of
which can be prepared with NOT gates and Hadamard gates.
5) Coding
Since mathematically, the operation of acting a quantum gate on a quantum state is some linear algebras, we can simulate such a process on a classical computer, which is a good way to check whether our algorithm is correct when we have no quantum computer on hand.
However, this method can simulate only up to around 30 qubits in general, which is analogous to the capacity of the exact diagonalization method in quantum many-body physics.
Here I use a popular quantum programming toolkit called QuEST, which is based on C/C++ language. You can also use other toolkits/frameworks like TensorCircuit (recommended) and Qiskit, which are all Python-based.
I will not go over the details of the related APIs of QuEST in my code which you may refer to their documents. The main target of this part is to show you the procedure of quantum programming.
First, we have to initialize the circuit. In QuEST, this can be done by
1 | int nQ = 4; // number of qubits |
where we assign 4 qubits and the 0th qubit is our ancilla:
1 |
Also we have to destroy the environment in the end of our program:
1 | destroyQureg( circ, env ); |
Regarding the circuit, initially, we prepare the state
1 | for ( int i = 0; i < 4; ++i ) { |
then evolve it with:
1 | int pair[][ 2 ] = { |
where dt
and step_size
are usually some hyperparameters to assure the adiabacticity if we have no pre-information about our Hamiltonian.
In the end, we perform the measurements
1 | int outcome; |
and one of the two possible results is
1 | Outcome of the measurement: |
which corresponds to
1 | Solutions: |
References
[1] E. Farhi et al. Quantum Computation by Adiabatic Evolution. arXiv:quant-ph/0001106.
[2] Kostas et al. A Review on Quantum Approximate Optimization Algorithm and its Variants. arXiv:2306.09198 [quant-ph].