## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
Amit
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 :-)
Nikolas Tezak
@ntezak
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.
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
Amit
Sure ! I seem to understand what you are saying
yeah in sense we wanted to know what better approaches are available other than the one already mentioned
Nikolas Tezak
@ntezak
Well, if you have a very specific model with sufficiently sparse operators you can often just write explicit nested for-loops that directly implement the matrix vector products without storing any matrix representation of the operator
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
Amit
oh okay ... I guess this is similar to what we have done with Lindblad operator construct in monte carlo solver
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 !
Nikolas Tezak
@ntezak
yeah, so one major issue that may affect a lot of existing code is how memory is allocated and reused
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
Amit
yup ! I am getting what you are saying ... my initial implementation would be on the lines of having an overwriting operator either in QuBase or QuDynamics
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 !
Nikolas Tezak
@ntezak
Yeah, so for time-dependent cases it is often enough to just allow scalar time dependent coefficients
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
Amit