PySTE vs. QuTiP

To benchmark against QuTiP we plot the runtime against infidelity for evolving a state vector for \(T=10\) units of time under the Hamiltonian

\[ H_1(t)=H_0+H_c\cos(2\pi t), \]

where \(H_0\) and \(H_c\) are randomly generated using

import numpy as np
H = np.random.rand(DIM, DIM)+1j*np.random.rand(DIM, DIM)
H = H + H.T.conj()

To estimate the infidelity we evolve the system for these 10 seconds and then evolve the system under the Hamiltonian:

\[ H_2(t)=-H_0-H_c\cos(2\pi [T-t]), \]

This will leave the unitary describing the full evolution as the identity. We then calculate the infidelity of the final state \(\left|\psi_f\right\rangle\) to the initial state \(\left|\psi_i\right\rangle\)

\[ \mathcal I=1-\left|\left\langle\psi_f\middle|\psi_i\right\rangle\right|^2 \]

We plot the runtime for the evolution of \(H_1(t)\) against the infidelity \(\mathcal I\) for each trial.

For our initial state we use a state randomly generated by

import numpy as np
state = np.random.rand(DIM).astype(np.complex128)
state /= np.linalg.norm(state)

The QuTiP optimisers we compare to are:

To obtain the best performance from QuTiP we use their String (Cython) coefficients (see QuTiP documentation).

Below we present the data for vector space dimensions 2, 4, 8, 16, and 32. We find that PySTE has a a worse asymptotic scaling with both infidelity and dimension that QuTiP’s integrators. However, PySTE appears to have a smaller perfector allowing for runtime accelerations by up to a factor of 100 for small systems. As much of current day quantum research focuses on gaining intuition for small systems we believe this non-asymptotic speed-up is useful and can accelerate research. If you are simulating larger systems then QuTiP likely suits your use case better.

2-dimensional

results/plots/benchmark_against_qutip.png

4-dimensional

results/plots/benchmark_against_qutip_dim_4.png

8-dimensional

results/plots/benchmark_against_qutip_dim_8.png

16-dimensional

results/plots/benchmark_against_qutip_dim_16.png

32-dimensional

results/plots/benchmark_against_qutip_dim_32.png