Multi-product formulas to reduce Trotter error
Tato stránka zatím nebyla přeložena do češtiny. Zobrazujete původní anglickou verzi.
Estimated QPU usage:Four minutes on a Heron r2 processor (NOTE: This is an estimate only. Your runtime might vary.)
Background
This tutorial demonstrates how to use a Multi-Product Formula (MPF) to achieve a lower Trotter error on our observable compared to the one incurred by the deepest Trotter circuit that we will actually execute. MPFs reduce the Trotter error of Hamiltonian dynamics through a weighted combination of several circuit executions. Consider the task of finding observable expectation values for the quantum state with the Hamiltonian . One can use Product Formulas (PFs) to approximate the time-evolution by doing the following:
- Write the Hamiltonian as where are Hermitian operators such that each corresponding unitary can be efficiently implemented on a quantum device.
- Approximate the terms that do not commute with each other.
Then, the first-order PF (Lie-Trotter formula) is:
which has a quadratic error term . One can also use higher-order PFs (Lie-Trotter-Suzuki formulas), which converge faster, and are defined recursively as:
where is the order of the symmetric PF and . For long time-evolutions, one can split the time interval into intervals, called Trotter steps, of duration and approximate the time-evolution in each interval with a order product formula . Thus, the PF of order for time-evolution operator over Trotter steps is:
where the error term decreases with the number of Trotter steps and the order of the PF.
Given an integer and a product formula , the approximate time-evolved state can be obtained from by applying iterations of the product formula .
is an approximation for with the Trotter approximation error ||. If we consider a linear combination of Trotter approximations of :
where are our weighting coefficients, is the density matrix corresponding to the pure state obtained by evolving the initial state with the product formula, , involving Trotter steps, and indexes the number of PFs that make up the MPF. All the terms in use the same product formula as its base. The goal is to improve upon || by finding with even lower .
- needs not be a physical state as need not be positive. The goal here is to minimize the error in the expectation value of the observables and not to find a physical replacement for .
- determines both the circuit depth and level of Trotter approximation. Smaller values of lead to shorter circuits, which incur fewer circuit errors but will be a less accurate approximation to the desired state.
The key here is that the remaining Trotter error given by is smaller than the Trotter error that one would obtain by simply using the largest value.
You can view the usefulness of this from two perspectives:
- For a fixed budget of Trotter steps that you can execute, you can obtain results with a Trotter error that is smaller in total.
- Given some target number of Trotter steps that is too large to execute, you can use the MPF to find a collection of lower-depth circuits to run that results in a similar Trotter error.
Requirements
Before starting this tutorial, ensure that you have the following installed:
- Qiskit SDK v1.0 or later, with visualization support
- Qiskit Runtime v0.22 or later (
pip install qiskit-ibm-runtime) - MPF Qiskit addons (
pip install qiskit_addon_mpf) - Qiskit addons utils (
pip install qiskit_addon_utils) - Quimb library (
pip install quimb) - Qiskit Quimb library (
pip install qiskit-quimb) - Numpy v0.21 for compatibility across packages (
pip install numpy==0.21)
Part I. Small-scale example
Explore the stability of MPF
There is no obvious restriction on the choice of number of Trotter steps that make up the MPF state . However, these must be picked carefully to avoid instabilities in the resulting expectation values calculated from . A good general rule is to set the smallest Trotter step so that . If you want to learn more about this and how to choose your other values, refer to the How to choose the Trotter steps for an MPF guide.
In the example below we explore the stability of the MPF solution by calculating the expectation value of the magnetization for a range of times using different time-evolved states. Specifically, we compare the expectation values calculated from each of the approximate time-evolutions implemented with the corresponding Trotter steps and the various MPF models (static and dynamic coefficients) with the exact values of the time-evolved observable. First, let's define the parameters for the Trotter formulas and the evolution times
# Added by doQumentation — required packages for this notebook
!pip install -q matplotlib numpy qiskit qiskit-addon-mpf qiskit-addon-utils qiskit-aer qiskit-ibm-runtime rustworkx scipy
import numpy as np
mpf_trotter_steps = [1, 2, 4]
order = 2
symmetric = False
trotter_times = np.arange(0.5, 1.55, 0.1)
exact_evolution_times = np.arange(trotter_times[0], 1.55, 0.05)
For this example we will use the Neel state as the initial state and the Heisenberg model on a line of 10 sites for the Hamiltonian governing the time-evolution