Everyone knows that a suit from a tailor cannot be compared to a suit made off the rack. Tailored algorithms can also be made to perfectly fit problems.
Following recent results obtained with the Quantum Approximate Optimization Algorithm (QAOA1
)[2] by Boulebnane and Montanaro[3] showing quantum advantage, we empirical benchmark QAOA1
against a tailored QAOA
approach on the 1-in-3 SAT
problem, showing superpolynomial improvement for an exponential fit on both approaches.
B&M
train QAOA1
on size k-SAT
problems. They compared their results for 8-SAT
to WalkSAT
and found a slight quantum advantage with
Specifically, we see the exponent reduce from
Other contributions from our work:
- A testbed of
1-in-3 SAT
instances varying from size$12$ to$21$ . - A practical perspective for optimizing
QAOA
parameters. - Replicable experiments on testbeds.
- Demonstration of applying a tailored ansatz on a feasibility problem.
- Early versions of
GPU
andCPU
optimized code for such tasks. - Exploration of an understudied class of optimization problems mendable to Quantum Advantage
This Hackathon is work for a future publication based in part on the results gathered here. Our project is about benchmarking an exciting tailored Quantum Alternating Operator Ansatz (QAOA
)[1] approach for solving 1-in-3 SAT
.
Given the promising recent results obtained with the Quantum Approximate Optimization Algorithm (QAOA1
)[2] by Boulebnane and Montanaro[3] showing quantum advantage, we wish to understand what computational benefit tailored QAOA can bring on Boolean Satisfiability problems.
QAOA
can show massive reductions in the search space considered by quantum devices in place of QAOA1
by tailoring the mixing and phase-separating operators to smaller subspace[1][4]. This includes superpolynomial reductions in the resulting search space and such a reduction will be seen here as well.
We generate a collection of 1-in-3 SAT
instances of increasing sizes in the phase transition (see below for more details), following the example set by their paper. While they considered k-SAT
problems, we will see that our approach has a more meaningful impact for 1-in-3 SAT
style problems.
Primarily, we will train our QAOA
and QAOA1
on instances of size 12
within the band of angles prescribed by B&M
and utilize this to solve instances of increasing size up to 20
. We will implement CPU
and CUDA
GPU
functions in Julia
to accomplish this task.
We also use a brute-force solver to find the entire solution space and generate a collection of 1-in-3 SAT
instances in JSON
that holds essential information about the instances to be able to benchmark our approach.
Here we describe QAOA1
at a high level. Let
The cost of a clause is given by satisfying one literal and unsatisfying the other literals for 1-in-k SAT
:
Then the phase-separating operator
, given a specific
Let plus
state over qubit mixing operator
, we have the X
rotations per qubit for
Notice we place the negative sign for the exponent of the mixing operator and the positive sign for the exponent of the phase-separating operator.
The initial wavefunction is:
And so the final wavefunction is:
Here we describe our approach at a high level. Given m
clauses n
variables maximum disjoint set
of clauses over the n
variables.
Let
We find solutions
Then the phase-separating operator, given a specific
For the mixing operator, we have a diffusor associated with each disjoint solution to the
and the ordinary single qubit diffusor (X
rotation) on the variables in
Then the overall mixing operator
is:
The initial state is then a uniform superposition overall disjoint clauses, which is easy to prepare. Thus reducing the search space significantly with the tailored ansatz.
With instances of size p
set to B&M
).
- Sweep over different starting values for overall coefficient
a
andb
(10 each) and two choices for evolving- Constant:
$\alpha = (a, \ldots, a, a), \beta = (b, \ldots, b)$ (B&M
used this) - Linear:
$\alpha = (a / p, \ldots, a(p-1)/p, a), \beta = (b, \ldots, 2 b / p, b/p)$
- Constant:
- For each sweep, do
500
rounds of finite difference gradient descent - Take the best and run
50000
rounds of gradient descent
Given a collection of m
clauses, each with n
variables such that one and exactly one of the literals in each clause is satisfied. So
The transition [5] from likely to be satisfiable to likely to be unsatisfiable for random 1-in-k
SAT problems occurs with 1-in-3
SAT, this occurs with n/3
clauses.
We benchmark QAOA1
and our approach with B&M
, from size
Check-out plots
for higher resolution plots!
Our QAOA1
as green
and our tailored approach (tQAOA
) as blue
. We see a significant uplift from the tailoring!
Fitting an exponential curve on the data with CurveFit.jl
shows QAOA
grows as tQAOA
grows as
Our QAOA1
as green
and our tailored approach (tQAOA
) as blue
. We see a significant uplift from the tailoring!
Fitting an exponential curve on the data shows QAOA
grows as tQAOA
grows as
While our focus was on 1-in-3 SAT
during this Hackathon, our code is easily amendable to exploring the same patterns for 1-in-k SAT
problems with different CUDA
works, it requires special optimization to improve and is an exciting direction to push our experiments further.
[1] Hadfield, S., Wang, Z., O’gorman, B., Rieffel, E. G., Venturelli, D., & Biswas, R. (2019). From the quantum approximate optimization algorithm to a quantum alternating operator ansatz. Algorithms, 12(2), 34.
[2] Farhi, E., Goldstone, J., & Gutmann, S. (2014). A quantum approximate optimization algorithm. arXiv preprint arXiv:1411.4028.
[3] Boulebnane, S., & Montanaro, A. (2022). Solving boolean satisfiability problems with the quantum approximate optimization algorithm. arXiv preprint arXiv:2208.06909.
[4] Leipold, H., Spedalieri, F. M., & Rieffel, E. (2022). Tailored Quantum Alternating Operator Ansätzes for Circuit Fault Diagnostics. Algorithms, 15(10), 356.
[5] Achlioptas, D., Chtcherba, A., Istrate, G., & Moore, C. (2001, January). The phase transition in 1-in-k SAT and NAE 3-SAT. In Proceedings of the twelfth annual ACM-SIAM symposium on Discrete algorithms (pp. 721-722).