Simulation of quantum systems is one of the most promising applications for quantum computers [1]. In the current version of this benchmark, we compare the quantum simulation against a classical simultion of the same circuit in order to report our fidelity. This works well for small circuit sizes, but is not scalable past a certain number of qubits. Additionally, we can now only run specific circuits, rather than random ones, limiting the ability of this benchmark to completely characterize real uses cases of the Hamiltonian simulation algorithm. We have some suggested modifications to this benchmark which we outline and explain why we did not chose to use them at this time in the section Proposed Improvements.
This benchmark is written as a simulation of a non-trivial Hamiltonian. It is constrained to model a linear chain of interacting bodies with an open boundary condition. Our Hamiltonian of interest is the Heisenberg model with disordered fields and an open boundary condition
Where is the strength of the interaction, is the strength of the disordered fields, and give the strength of the x and z disorded fields at site , and are the usual Pauli operators acting on site . We will use the notation interchangably throughout this explanation.
We start the system in an easily preparable classical state and aim to evolve the system for time according to the solution to the Schrödinger equation with constant,
where we set here and elsewhere.
The Hamiltonian Simulation algorithm is benchmarked by running just a single circuit. This circuit is repeated a number of times denoted by num_shots
. We then run the algorithm circuit for numbers of qubits between min_qubits
and max_qubits
, inclusive. The test returns the averages of the circuit creation times, average execution times, fidelities, and circuit depths, like all of the other algorithms. For this algorithm's fidelity calculation, we compare against the results returned from classical simulation using our noise-normalized fidelity calculation.
We calculate these expected distributions in the jupyter notebook precalculated_data.ipynb
, which stores the results for up to 20 qubits in the precalculated_data.json
data file. The python code then imports the distributions from the json
file. This is a less than ideal fidelity calculation as it does not scale to any size of qubits. It requires the classical simulation of matrix products, which requires resources exponential in number of qubits.
Much effort has been done in the field of many-body physics to understand the approximate behaviors of Hamiltonians like the one we have here. However, to calculate the evolution of an excited state through exact diagonalization scales approximately as for qubits, quite poor scaling [2]. This quickly becomes intractible even utilizing extremely powerful classical supercomputers.
To run this algorithm on our quantum computer, we need to find a way to apply the unitary through a combination of quantum gates. In order to approximate this operator, we use Trotterization [3], where we note that Lie product formula gives
If we take to be finite, this is called Trotterization. This has a gate complexity of , which is an exponential speedup. We can then apply successive layers of by exponentiating the individual terms in the Hamiltonian to approximate the evolution of any state. This makes the simulation easier, as it is much easier to calculate the gates which apply and than to find the gates which apply . This process can be visualized in the circuit diagram below with a single step.
We chose in this benchmark to have the strength of the disorder to be , the total evolution time to be , and the number of Trotter steps to be . These parameters are all set in the precalculated_data.ipynb
file in the Hamiltonian simulation _common
folder.
Fig 1. Example of circuit with 1 Trotter step. We can see that our and turned into Rx and Ry gates, while the two qubit interactions turned into the gates that result from exponentiating these terms in the Hamiltonian. Note that this circuit application is less efficient than applying the XX, YY, and ZZ operations all at once.
Fig 2. Circuit with 2 Trotter steps and the optimal XXYYZZ operator.
-
Build the Trotter step layer.
-
Apply the Trotter step layer for as many Trotter steps were chosen.
-
Measure out all of the qubits
There are two options of circuit creation for this simulation:
-
Default: Optimal implementation of , used as the default. See [4] for reasoning for why this is the optimal application of gates.
-
use_XX_YY_ZZ_gates: Simple implementation of , , and , provided for reference purposes and validation of the optimal implementation. In essence, we initially generate using two CNOT gates and an RZ gate. We then apply the XX and YY versions of this gate by providing a basis change from Z to X and from Z to Y, using Hadamard gates for the X transformation and using S and Hadamard gates for the Y transformation respectively. These circuits are below. It is possible to use this type of gates by passing
use_XX_YY_ZZ_gates=True
to therun()
function.
Fig 3. Optimal gate which applies .
Our suggested method of modifying this benchmark involves a topic taken from condensed matter called many-body localization [2] [5]. The essence of this phenomenon is that for certain closed quantum systems, some excited states fail to thermalize as expected.
The parameters that we use for the current Hamiltonian simulation benchmark already put us in the many-body localization regime. After evolving the system for a suitibly long time, with , we can then take a look at a parameter called imbalance to characterize this property. The imbalance compares the percentage of measured 1's on the even versus odd sites. We see that for our Heisenberg Hamiltonian, when averaging over many random choices for and , the imbalance will converge to a constant value for increasing circuit width. We could then set our fidelity calculation as the deviation from the expected imbalance value. This benchmark is outlined in the mbl_benchmark.py
file in the qiskit WIP_benchmarks
folder.
While we have already coded this benchmark, we are not using it as a benchmark because some of the parameters required are not feasible on current computers. Because of our comparatively large value of , we need to have a large number of Trotter steps so our simulation is close to the actual evolution of the Hamiltonian. This results in circuits that are thousands of gates long. Then, because the imbalance converging is a feature that occurs on average, we need to average over more than 100 different circuits for the fidelity calculation to capture just the hardware error, not the algorithmic error. All of these factors make it such that running the benchmark is difficult on simulators, and exceedingly expensive and/or time-intensive to run on hardware. In the future, when hardware is more accessible, these downsides might not be as big of an issue, and many-body-localization can be utilized as an effective benchmark.
[1] Feynman, RP. (1982) Simulating physics with computers. Int J Theor Phys 21:467–488.
[2] Andrew M. Childs, Dmitri Maslov, Yunseong Nam, Neil J. Ross, Yuan Su. (2017).
Toward the first quantum simulation with quantum speedup.
arXiv:1711.10980
[3] Naomichi Hatano, Masuo Suzuki. (2005).
Finding Exponential Product Formulas of Higher Orders
arXiv:math-ph/0506007
[4] Farrokh Vatan, Colin Williams. (2004).
Optimal Quantum Circuits for General Two-Qubit Gates.
arXiv:quant-ph/0308006
[5] D. Zhu, S. Johri, N. H. Nguyen, C. Huerta Alderete, K. A. Landsman, N. M. Linke, C. Monroe, A. Y. Matsuura. (2021).
Probing many-body localization on a noisy quantum computer.
arXiv:2006.12355