Multi-product formulas (MPF)
Multi-product formulas (MPF) can be used to more accurately simulate the dynamics of a quantum system, at the cost of increased circuit executions. This is a post-processing technique that mitigates the error of expectation values for time-evolved states.
Classical computing is used to solve a system of linear equations that provides coefficients to a weighted combination of several circuit executions. Using this weighted combination can reduce the error associated with simulating time evolution, given a good selection of Trotter steps. The MPF tool will ingest a selection of data --- including the number of Trotter steps and the order of the Trotter approximation --- to prepare and solve (or approximate the solution of) the associated system of linear equations, which you can then use to post-process expectation value measurements of a time-evolved state.
Install the MPF package
There are two ways to install the MPF package: via PyPI and building from source. It is recommended to install in a virtual environment to ensure separation between package dependencies.
Install from PyPI
The most straightforward way to install the qiskit-addon-mpf
package is via PyPI.
pip install qiskit-addon-mpf
Build from source
Users who wish to develop in the repository or who want to install it manually may do so by first cloning the repository:
git clone git@github.com:Qiskit/qiskit-addon-mpf.git
and install the package via pip
. The repository also contains a number of optional dependencies that enable certain features.
Adjust the options to suit your needs.
pip install tox notebook -e '.[notebook-dependencies,dev]'
Theoretical background
MPFs can reduce the Trotter approximation error associated with simulating the dynamics of quantum systems through a weighted combination of several circuit executions. This weighted sum is defined as:
where are the weighting coefficients, is the density matrix that corresponds to the pure state obtained by evolving the initial state via a product formula approximating the time-evolution operator using Trotter steps, and indexes each product formula used in the sum.
Generally, however, the goal of simulating quantum dynamics is to measure some observable , which is a function of time. When using MPFs, multiple circuits -- each using Trotter steps -- are executed to obtain several measurements of the target observable . The measurement of the target observable is then obtained by computing:
In essence, you can reduce the overall Trotter error by approximating the time-evolution operator using several product formulas with a variable number of Trotter steps instead of a single product formula. You construct a circuit for each term in the weighted sum, which evolves the system according to each of the number of Trotter steps. Each circuit is then executed separately on a QPU to reconstruct the results in a post-processing step. The utility of this technique can be viewed from two perspectives:
- For a fixed number of Trotter steps that you execute, you can obtain results with a Trotter error that is smaller in total.
- For a number of Trotter steps that result in deep circuits, you can use MPF to find several shorter-depth circuits to run, which results in a similar Trotter approximation error.
Determine MPF coefficients
The core functionality of the qiskit-addon-mpf
package lies in determining the MPF coefficients (which may be time-dependent). The process to obtain each involves solving a system of linear equations where is the vector of coefficients to be determined, is a matrix that depends on each of the and the product formula used (as in, the approximation order and number of Trotter steps), and is a vector of constraints. This system of equations can be solved either exactly or with an approximate model that minimizes the 1-norm of the coefficients. Additionally, the choice for each is a heuristic process, but can be bounded by the following constraints:
- The largest value is bounded by the highest depth of circuit that can be reliably executed
- The smallest should satisfy since that is where the Trotter error is most well behaved
- None of the coefficients should be close to since this would imply they don't contribute much to the MPF
- Similarly, the coefficient associated with the largest value should not dominate, since this implies that you are using a single product formula
- Lastly, the norm of the coefficients obtained should be small, as this indicates a well-conditioned MPF 1
Next steps
- Read the page on getting started with MPF.
References
- A. Carrera Vazquez, D. J. Egger, D. Ochsner, and S. Wörner, "Well-conditioned multi-product formulas for hardware-friendly Hamiltonian simulation", Quantum 7, 1067 (2023).
- S. Zhuk, N. Robertson, and S. Bravyi, "Trotter error bounds and dynamic multi-product formulas for Hamiltonian simulation", Phys. Rev. Research 6, 033309 (2024).
- N. Robertson, et al. "Tensor Network enhanced Dynamic Multiproduct Formulas", arXiv:2407.17405v2 [quant-ph].