I have been working on some code that does integration, some manipulation, and then more integration.
Here is the code (thanks @JRichardSnape!).
Basically this code solves a matrix equation, which is what mesolve
does. It takes in a Hamiltonian (a key physical matrix), an initial density matrix, rho0
, and a tlist of times to evaluate rho(t) at (what we are solving for) and the collapse operators, L1, L2, L3, L4, L5, L6, L7
. Then I extract the results and multiply by two other arrays and plot it.
I use the qutip quantum mechanics module since they have the solver I need: mesolve
. The qutip module requires all matrices to be converted into a quantum object, which is done by Qobj(x).
I have added a line defining rho0=L1 right after the collapse operators definition. When this happens, it gives me an Index error:
IndexError: index 0 is out of bounds for axis 0 with size 0
I have tried to find out what is wrong. It goes wrong during the definition of f_t. The problem is when it is trying to index the array (n.data is a single element array of a complex128 number). What is going on?