Exponential#465
Conversation
lkdvos
left a comment
There was a problem hiding this comment.
We should probably discuss together how to best approach this, because I guess the question is if we want to implement the MatrixAlgebraKit functionality and interface directly on the tensors first, like we did for the factorizations.
I didn't even remember we have exp!, which is as far as I can tell defined in TensorKit itself, which means we could in principle indeed decide to use that for exp!((tau, t)), although my initial feeling seems to gravitate more towards just overloading the MatrixAlgebraKit versions.
That would then also at least expose the algorithm selection and in-place versions a little better?
|
I can definitely get behind just overloading the |
This changes the current way of calculating the exponential (using
LinearAlgebra) to the one recently implemented inMatrixAlgebraKit(see QuantumKitHub/MatrixAlgebraKit.jl#94). This will not yet work, since there is no new version of MatrixAlgebraKit tagged yet. I just wanted to start the discussion here already.I added both
exp!(t)andexp!(tau, t). I added the special case where t is real and tau is complex, whenexp!cannot overwrite the original tensor and instead a new one is allocated. Suggestions on how to best do this are definitely appreciated.I still need to add some tests. We can definitely add some tests on whether the output tensor has the expected
scalartype, and whetherexp!(copy(a)) == exp!((1.0, copy(a)), but suggestions on more nontrivial tests are also welcome.