- Join over
**1.5M+ people** - Join over
**100K+ communities** - Free
**without limits** - Create
**your own community**

A JuliaQuantum package for solving dynamical equations in quantum mechanics.

hello @ntezak ! It would be really helpful to hear your insights and thoughts on speeding up on the current implementation of

`lindblad_op`

... There is a issue reference here JuliaQuantum/QuDynamics.jl#32 ... It would be nice to hear from you if you have any specific thoughts on this ... Hoping to hear from you :-)
Hi @amitjamadagni, yeah, the code that klickverbot has in there is pretty much what both the original MATLAB quantum optics toolbox and QuTiP are doing.

I think that’s definitely a good way to start. For very large systems (say the tensor product of two Fock spaces of 80 photons each) even this sparse approach is problematic as the super operator matrices are of size (D^2 * D^2) where D is the Hilbert space dimension (D=80^2 for the above example) but that’s where QuantumTensors.jl can make a huge difference.

I think that’s definitely a good way to start. For very large systems (say the tensor product of two Fock spaces of 80 photons each) even this sparse approach is problematic as the super operator matrices are of size (D^2 * D^2) where D is the Hilbert space dimension (D=80^2 for the above example) but that’s where QuantumTensors.jl can make a huge difference.

My proposal would be to implement klickverbot’s code first and then have different separate backends that one can compile symbolic operator (and super operator) definitions to.

I will try to contribute to this with actual code soon but I don’t know if I will be able to deliver much code until the summer, after my thesis defense (July 1)

I guess if you would like me to turn his comment into a pull request I can help out with that

yeah in sense we wanted to know what better approaches are available other than the one already mentioned

similar to how PDEs such as heat equations are solved

For complex models given in symbolic form one would like to automatically translate the expressions to such nested loops and compile them

and regarding the PR it would be nice if we could discuss how to integrate QuantumTensors.jl that can be used to solve large systems ... that is may be creating a hybrid version of klickverbot's code and some integration using QuantumTensors.jl !

For large dimensional systems there is a huge performance penalty to allocating memory to store a system state inside the propagator loop

Instead one should pre-allocate some memory and keep reusing it

For any type of operator or super operator the primitive matvec operation that needs to be implemented is

y_k <- b * y_k + a * \sum_j A_kj * x_j

I.e., an in-place application of the operator with coefficients a, b

so that for every time step in the propagator the pre initialized array is over written for time dependent cases ... for time independent cases this allocation is done once and used over and over again !

if your hamiltonian is f(t)*H1 + g(t)*H2 you can just reuse H1 and H2 and just use the scalar multiplication of the above matrix vector product

as I get it in the current PR we are creating a new array always for each time step which is not efficient and can be avoided !

please refer to the recent comments as the initial comment takes a anonymous function in the type construct !