-
Notifications
You must be signed in to change notification settings - Fork 40
Description
There's currently a sparsematrix.jl file here and a sparse.jl file in QuantumInterface with functions extending SparseArrays with:
- some
gemm!andgemv!functions _permutedimswhich works on arrays with ndims > 2 asSparseArraysonly implementspermutedimsfor ndims = 2ptrace
I wasn't able to find much evidence that SparseArrays has plans to support anything other than vectors and matrices. The docs even list some external packages that handle multidimensional arrays. Several of these seem to offer interfaces that could help simplify the code we have here. For example, anything offering an Einstein summation notation interface would make ptrace a one-liner.
Finch.jl is perhaps the most interesting one on the list for our use cases and potential to offer significant speedups. Also it might be possible to use its lazy feature as part of the Lazy{Ket,Product,Sum,Tensor}. However, it's still lacking some basic features we would want here like reshape.
A better library for multidimensional sparse arrays would be especially helpful for having cleaner code for the all the superoperator support I'm working on as it would hopefully avoid issues like this (relevant issue: JuliaSparse/SparseArrays.jl#24).