Better Together: Mitiq meets UCC
Combining error mitigation and compilation for stronger quantum performance
Error mitigation and circuit compilation are two critical components of an effective quantum computing stack. Error mitigation works to reduce the impact of unwanted physics on the results of quantum circuit runs, enabling larger achievable volumes, and more accurate expectation values. Circuit compilation reduces the overall circuit volume, which in turn reduces the number of possible errors in circuit execution — more gates means more chances of encountering an error.
While these two components of the stack are often used and studied independently, we have found that using them in conjunction can lead to even better results. In this blog post, we will walk you through our first demonstration combining quantum error mitigation and quantum circuit compilation.
mitiq
For the past five years, Unitary Foundation has developed a powerful open-source library for quantum error mitigation called Mitiq which has amassed 248k downloads on PyPI to date. Mitiq provides a suite of error mitigation techniques, including:
- Zero-Noise Extrapolation (ZNE): Extrapolates results from noisy runs at different noise levels to estimate the ideal result, and the subject of our first demonstration.
- Probabilistic Error Cancellation (PEC): Uses hardware calibration data to create modified circuits to selectively cancel out noise in resulting expectation values.
- Clifford Data Regression (CDR): Leverages the efficient simulability of Clifford circuits to train a primitive model to correct the impact of errors.
UCC
The Unitary Foundation team has a unique vantage point on the open-source quantum software landscape, and last year we decided to dive into what we see as one of the biggest missing pieces of an open-source quantum stack: a modular, cross-platform quantum circuit compiler. Last year the Unitary Foundation team decided one of the biggest missing pieces of an open-source quantum stack was a modular, cross-platform quantum circuit compiler. We set to work and launched the Unitary Compiler Collection (UCC) earlier this year.
Bringing Them Together
With UCC’s launch, and a stable interface put forth, we were excited to test how the two tools work together. Code-wise, the tools work together seamlessly. First, you compile your quantum circuit with UCC, then you pass the compiled circuit into one of Mitiq’s error mitigation routines.
E.g. with Zero-Noise Extrapolation (ZNE) the code is as simple as:
import ucc, mitiq
circuit = ... # Your quantum circuit here
# compilation
compiled_circuit = ucc.compile(circuit, target_device="ibmq_mumbai")
# mitigation
my_executor = ... # Your method of running circuits.
# e.g. a function that takes a quantum circuit
# and returns a (noisy) expectation value
# such as a Qiskit or Cirq simulation wrapper
mitigated_result = mitiq.zne.execute(
compiled_circuit,
executor=my_executor,
scale_noise=mitiq.zne.scaling.fold_gates_at_random
)
A more fleshed-out and complete example can be found in our Mitiq + UCC tutorial, but the plot below shows the important part: compiling before applying ZNE leads to the most significant reduction in error amount the four combinations of compilation and mitigation.
What’s Next?
We’re working to study further how error mitigation and circuit compilation combine to improve performance. Ongoing research can be found in Unitary Foundation’s research repository.
If you’re a quantum developer or researcher, using a workflow like this, we’d love to hear any feedback you may have. Your insights can help shape the future of these tools!
Get Involved
| Project | Repository | Documentation | Discord Channel |
|---|---|---|---|
mitiq | unitaryfoundation/mitiq | mitiq.readthedocs.io | #mitiq |
ucc | unitaryfoundation/ucc | ucc.readthedocs.io | #ucc |
Let’s build quantum tools that are greater than the sum (tensor) product of their parts.





