New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performance of Stochastic Schrodinger Equation with sparse sc_ops #2298
Comments
The stochastic solver are not thought for a lot of noise operators. But I fail to see how you can use sparsity for speed it up in this case in particular. |
I'm not actually sure if this is the code in question, but for example in
In my case |
We don't use the same code for the sparse addition as in But I expect it to be slower for 100 additions of 50 elements since you need to allocate memory for the 100 intermediate results, while for 1 addition with 5000 elements, there is only one memory allocation. But if you want to have a go at optimizing our basic operations, we will welcome any improvements. |
Ok so as I read it currently there is no iadd_ function for CSR matrices. Am I also right that there is no add_ operation for Dense + CSR? How does the current code deal with adding a Dense to a CSR matrix (I'm looking in |
It will convert the
Also our dispatcher, the code that allocate |
I think because it is rare that the wavefunction is sparse would it be just fine to use iadd(Dense, Sparse). Would it be acceptable if I just added a reuse_first:bool argument to the current add function, to allow the reuse of the buffer? |
@Ericgig I'm just attempting some profiling with
But it doesn't appear to work. |
It will be a lot of work to add a COO format, there are a few dozens of functions to implement (add, expect, mul, matmul, ptrace, eigen, kron, ...). We had students write new data formats over a summer for GSoC a few years ago and they were mostly working by the end, but not final... Yes profiling cython is not easy, I managed once, but can't do it anymore. |
Problem Description
ssesolve
is slow when used with the "euler-maruyama" solver and a large number of sparse noise oprators.Proposed Solution
Qutip should take into account sparsity in sc_ops when used with the "euler-maruyama" solver.
Alternate Solutions
No response
Additional Context
I'm currently using
qutip.ssesolve
, however for my application I require a large number of independent noise operators. This currently causes the solver to run very slowly, however in theory increasing the number of operations should only result in a small overhead if the underlying matrix is sparse. If I add together all matrices it runs much quicker. Is this something that has already been addressed in the 5.0 refactor? I am potentially interested in making a pr to fix this but I don't want to waste effort on something which is already fixed or undesirableThe text was updated successfully, but these errors were encountered: