Closed BoxiLi closed 10 months ago
Thank you @BoxiLi for taking the time to go through the benchmark and for pointing this out! This actually looks like a remnant of an older version using piece-wise-constant functions that I forgot to update when going to the modulated Gaussian curve. I will update the repo accordingly!
Thanks again!
Dear PennyLane developers,
I came across this repo during a talk a few days ago. It is really excellent to see PennyLane including the pulse feature. This benchmarking compares the efficiency of simulating the time evolution using
PennyLane
withqiskit-dynamics
andqutip
.I was following the notebook
orward-pass_PL_QUTIP_QISKIT_i7-1260P.ipynb
to reproduce it when I noticed that there might be a problem when defining the drive coefficient for the qutip simulation. In the notebook, the time-dependent coefficient is defined as follows:This function creates a
pwc
function in every single time step in the ODE solver, which is very inefficient. In fact, most of the time is spent computing this coefficient rather than doing matrix multiplication.If I replace it with the NumPy pulse function defined in that notebook.
I got a very different plot. The simulation results are consistent with each other.
I am not completely sure what the
pwc
function does here, but it severely reduced the efficiency of the simulation.In any case, I totally agree that JIT-compiled code would be faster than the default qutip for small system sizes, let alone the GPU support and audodiff features. But just on the efficiency of the simulation, the difference is probably not as big as shown in the benchmarking here :) We are also introducing the new alpha version of
qutip 5.0.0a2
, which allows more convenient switching between the dense and sparse matrix. You are also very welcome to try out the new features.