Variational quantum eigensolver approach to prime factorization on IBM's noisy intermediate scale quantum computer

Mona Sobhani, Yahui Chai, Tobias Hartung, Karl JansenPhysical 2024

TL;DR

This paper explores a hybrid quantum-classical approach to prime factorization using the Variational Quantum Eigensolver (VQE) on IBM's noisy intermediate-scale quantum (NISQ) devices. They successfully factorized numbers up to 253 on real hardware and 1,048,561 on a simulator, demonstrating the potential of VQE for practical applications despite current hardware limitations.

What Problem Does This Paper Address?

Prime factorization, the process of finding the prime numbers that multiply together to give an original number, is a cornerstone of modern cryptography (like RSA). While Shor's algorithm offers a theoretical exponential speedup for this task on quantum computers, current quantum hardware is too small and noisy to implement it for cryptographically relevant numbers. This paper addresses the challenge of performing prime factorization on Noisy Intermediate-Scale Quantum (NISQ) devices, which are the current generation of quantum computers. They aim to leverage hybrid quantum-classical algorithms, specifically the Variational Quantum Eigensolver (VQE), to tackle this problem in a way that is more feasible for near-term quantum hardware.

Methods

The core of the paper is the application of the Variational Quantum Eigensolver (VQE) to the prime factorization problem. VQE is a hybrid algorithm that uses a parameterized quantum circuit to prepare a quantum state, and a classical optimizer to adjust the parameters of this circuit to minimize a cost function.

Here's a breakdown of their approach:

  • Problem Encoding: The prime factorization problem (finding $p$ and $q$ such that $n = p \times q$) is mapped to an optimization problem. The cost function used is $(n - pq)^2$, where the minimum value of 0 is achieved when the correct prime factors are found.
  • Hamiltonian Construction: This cost function is then encoded into a Hamiltonian. The authors construct this Hamiltonian by substituting binary representations of $p$ and $q$ into the cost function and mapping these binary variables to Pauli-Z operators.
  • Quantum Circuit: They employ a "hardware-efficient ansatz" with linear CNOT entanglement layers. This means the circuit is designed to be relatively simple and compatible with current hardware architectures.
  • Cost Function Evaluation: Instead of solely relying on the expectation value of the Hamiltonian, they introduce the Conditional Value at Risk (CVaR). CVaR considers a percentile of the lowest-energy measurement outcomes, which is argued to be more suitable for problems where observing the solution even once is sufficient, as is the case in factorization. This helps to mitigate the impact of high-energy, non-solution states.
  • Classical Optimization: The COBYLA (Constrained Optimization BY Linear Approximation) algorithm is used as the classical optimizer to adjust the parameters of the quantum circuit based on the CVaR cost function.

Datasets

The paper uses synthetic datasets for evaluation. The "datasets" consist of various integers $n$ that are factorized. These integers are chosen such that they require a specific number of qubits ($N$) for their factorization. The paper presents a table of these integers, ranging from $n=15$ (requiring 3 qubits) up to $n=1,048,561$ (requiring 27 qubits).

Key Insights and Ideas

  • CVaR as a Superior Cost Function: The paper strongly advocates for using CVaR over the standard expectation value for factorization. They argue that CVaR, by focusing on the lower percentiles of measurement outcomes, improves the probability of observing the correct solution, which is crucial for factorization.
  • Ansatz Choice Matters Significantly: The choice of the quantum circuit's structure (ansatz) has a substantial impact on performance. They observed that linear CNOT ansätze generally perform better than parallel CNOT ansätze for this problem.
  • Small Differences in Prime Factors Don't Necessarily Simplify: Contrary to classical intuition where primes with similar bit-lengths are harder to factor, the paper found that the difference between prime factors $p$ and $q$ has a minimal impact on the success rate of their VQE approach.
  • Finite Shots Introduce Trade-offs: While ideal simulations with infinite shots show high success rates for smaller $\alpha$ (CVaR parameter), real hardware with finite shots reveals a trade-off. A smaller $\alpha$ can lead to a larger statistical error in the CVaR estimation, potentially hindering the optimizer. They suggest a balance is needed, with $\alpha=0.01$ showing good performance in their experiments.
  • Alternative Cost Functions for Finite Shots: For finite shots, the standard Hamiltonian cost function can lead to very large eigenvalues, making it difficult to estimate accurately. They explored logarithmic and inverse cost functions, finding the inverse type to be particularly promising for improving success rates, especially with the NFT optimizer.

Key Results

  • Successful Factorization on Real Hardware: The VQE approach successfully factorized the number 253 using 9 qubits on an IBM quantum computer.
  • Successful Factorization on Simulator: On a classical simulator, they were able to factorize the much larger number 1,048,561 using 27 qubits.
  • High Success Rates with Optimal Parameters: With optimal parameters (e.g., $\alpha=0.01$, $L=4$ layers), the success rate approached 100% for many problem sizes in ideal simulations.
  • Faster Convergence with CVaR: The CVaR coefficient $\alpha=0.01$ not only led to a higher success rate but also achieved faster convergence (fewer iterations) compared to $\alpha=0.1$.
  • Inverse Cost Function Shows Promise: For finite shots, the inverse cost function, particularly when used with the NFT optimizer, demonstrated significantly higher success rates compared to the standard Hamiltonian cost function.

Limitations and Future Work

  • Hardware Limitations: The paper acknowledges the limitations of NISQ devices, including noise and limited qubit counts, which restrict the size of numbers that can be factored on real hardware.
  • Barren Plateaus: The authors raise the possibility that logarithmic and inverse cost functions might be related to global operators, potentially leading to the "barren plateau" problem, where gradients vanish and optimization becomes difficult.
  • Future Work:
    • Investigating suitable initial parameters for the inverse cost function to overcome potential barren plateaus and reduce optimization time.
  • Exploring the relationship between cost functions and global observables.
  • Developing more efficient ansätze for prime factorization.
  • Further research into finding the optimal balance for the CVaR parameter $\alpha$ for different problem instances and shot counts.

Summary updated

BibTeX
@inproceedings{sobhani2024variational,
  author = {Mona Sobhani and Yahui Chai and Tobias Hartung and Karl Jansen},
  title = {{Variational quantum eigensolver approach to prime factorization on IBM's noisy intermediate scale quantum computer}},
  booktitle = {Physical},
  year = {2024},
}
Figure