Technical blog

Quantum phase estimation with Fire Opal

May 23, 2023
Written by
Rowen Wu
Rowen Wu

Quantum phase estimation (QPE) is an essential building block of many quantum algorithms.

It has many applications in quantum chemistry, cryptography, and other areas of research, meaning that users exploring how quantum computing can help solve their most important problems often encounter this subroutine.

In Shor's algorithm—a groundbreaking quantum algorithm that has widespread implications in cryptography—phase estimation is used to factor large numbers efficiently and hence break public key cryptosystems. In quantum chemistry, phase estimation helps calculate the electronic structure of molecules. This is important for understanding chemical reactions and developing new materials.

Despite the promising applications, the limitations of today’s hardware make QPE difficult to implement on real quantum computersthe quantum phase estimation algorithm tends to fail due to the large number of operations required (measured by something called circuit depth) and the fact that quantum logic operations are highly error-prone.

Fire Opal’s error suppression pipeline improves the execution of QPE circuits by combatting sources of error encountered on real hardware, allowing you to run deeper circuits without facing the typical limitations encountered on today’s systems.

Realities of hardware implementations

Device coherence is a major limitation when running quantum phase estimation on real quantum hardware. Without error suppression, you can only run shallow (short) QPE circuits which makes it difficult to evolve gradually enough to extract the correct output (formally, to project well onto one of the eigenstates such that the corresponding eigenvalue can be inferred).

QPE circuits are complex and long because of the inclusion of an expensive quantum Fourier transform (QFT) process, and the need to repeatedly apply a controlled unitary. While the accuracy of phase estimation increases with the number of qubits, that also yields more opportunities for hardware error to arise.

The challenges of implementing QPE on real hardware have driven researchers to seek out modified forms of QPE that replace QFT with classical post-processing and limit the number of applications of the controlled unitary. These methods are lower fidelity, more compute-intensive, and less generalizable than the original form of QPE.

Ultimately, methods that enable the execution of deeper and wider phase estimation circuits with improved accuracy are necessary in order to take full advantage of QPE in quantum algorithms.

Improving phase estimation with Fire Opal

Fire Opal’s error suppression pipeline has been benchmarked to improve accuracy across various algorithms by orders of magnitude on real hardware, and these algorithmic enhancements similarly apply to QPE.

One of the main benefits Fire Opal offers to QPE is enabling growth in circuit width (measured by the number of qubits) without loss of accuracy. The algorithm uses qubits for two purposes: one set of qubits (known as counting qubits) is used as a control and the other is used to perform operations. Adding more qubits for control means better phase estimation, however, it also increases the likelihood of the device succumbing to errors. However, if error suppression works well, you can reap the benefits of adding more qubits without having to worry about accuracy.

The following results compare the results of phase estimation on hardware with and without using Fire Opal to the ideal output probability distribution, while increasing the number of qubits from three to six. In the absence of noise, the output distribution measured after execution on a real device would be the same as the ideal, and the quality of the phase estimation would improve with qubit count, but that is rarely the case in general (i.e. without Fire Opal).

Starting with three counting qubits, it’s clear that the bare-metal execution on IBM default (light gray) does not yield the correct result. The distribution of the IBM default plot is random, with an incorrect bitstring showing as the most prominent result. On the other hand, the distribution of the Fire Opal (purple) results closely resembles the ideal measurement outcome.

Figure 1. The probability distribution of an execution of quantum phase estimation with three counting qubits, a single-qubit unitary, and a phase gate P(\(\psi\)) with a 2*ℼ*\(\psi\)=1/3 rotation executed on IBM’s 7-qubit Lagos device. The top graph represents the ideal distribution, the bottom light gray is IBM default, and the purple is Fire Opal. The correct bitstring is highlighted in red.

The next set of graphs shows the measurement outcomes using four counting qubits. Here the ideal case provides a more refined estimate of the phase than the previous demonstration. But as decoherence and error increase with qubit count, the IBM default measurement reverts to something approximating a completely random and evenly distributed output. Again, the Fire Opal distribution closely resembles the ideal, and the correct bitstring is still clearly identifiable across the plot.

Figure 2. The probability distribution of an execution of quantum phase estimation with four counting qubits, a single-qubit unitary, and a phase gate P(\(\psi\)) with a 2*ℼ*\(\psi\)=1/3 rotation executed on IBM’s 7-qubit Lagos device.

Increasing the number of counting qubits to five follows the same pattern. While the IBM default increases in stochasticity, Fire Opal delivers the correct result loud and clear.

Figure 3. The probability distribution of an execution of quantum phase estimation with four counting qubits, a single-qubit unitary, and a phase gate P(\(\psi\)) with a 2*ℼ*\(\psi\)=1/3 rotation executed on IBM’s 7-qubit Lagos device.

None of the distributions achieved using default settings on IBM default hardware result in the correct outcome, and the plots grow noisier as more qubits are added, which is to be expected when users try to perform “better” QPE by increasing circuit width. Fire Opal, however, continues to deliver the correct solution bitstring as the highest count outcome, and the results look very similar to the ideal.

Another way of interpreting the data is to analyze success rate—the percentage of runs where the most likely output from the measured distribution matches the ideal output.

Figure 4. The success rates of IBM default and Fire Opal when running circuits with three to six counting qubits. For each unit of counting qubits, ten phases were averaged with two runs per phase.

With Fire Opal in use to suppress errors, the success rate remains high all the way to six counting qubits, meaning that the correct bitstring is consistently being returned through Fire Opal’s executions.

On the runs performed without Fire Opal (Default), using three and six qubits, the success rate is effectively zero, meaning that none of the runs performed resulted in the correct highest count bitstring. The best success rate achieved with default settings on IBM is only around 20% with four counting qubits, which is still quite low.

Enabling broader applications on today’s quantum hardware

Quantum phase estimation is critical to many quantum algorithms. However, it cannot be applied when device coherence imposes oppressive limitations on circuit depth and qubit count.

The core technology behind Fire Opal enables you to run deeper and wider circuits with a high degree of accuracy and consistency. This also allows you to leverage complex subroutines like QPE in algorithms with a higher degree of precision.

Ultimately, this enables you more flexibility to use QPE in broader applications, such as quantum chemistry or cryptography, without worrying about device coherence or implementing workarounds. 

Learn how to run quantum phase estimation with Fire Opal and experience the benefits firsthand!

Latest news and updates