I want to calculate the trace of something like
Tr(ΓRGdΓLG†d)
In order to optimise my code, I found something like this Faster trace of product of two matrices, which greatly reduces calculation time for trace.
My question is - Is it possible to generalize this somehow to the above case? I tried looking at the Wikipedia with no luck
https://en.wikipedia.org/wiki/Trace_%28linear_algebra%29#Trace_of_a_product
Or is the most time efficient way just to say
M1=ΓrGdM2=ΓLG†d
and then use the trick in the link and Wikipedia.
Comments
Post a Comment