Closed Lancashire3001 closed 2 years ago
We haven't attempted to add symmetry as, in practice, different kinds of symmetries have different performances as the binary product level. The lack of symmetry is fairly hard coded into the current code as we have optimized the tensor contractor cost and associated path finding tech for performance over flexibility.
Adding another backend to opt_einsum
isn't enabled through functionality out of the box, but adding a new backend isn't particularly troublesome: https://github.com/dgasmith/opt_einsum/blob/master/opt_einsum/backends/dispatch.py
I am wondering if there is any approach can adapt symmetry in tensor contraction in opt_einsum. E.g.,
A[a,b] B[b,c,d,e] = C[a,c,d,e]
, whereB[:,:,d,e] = B[:,:,e,d]
, or various tensor contractions in the correlated methods (perturbation, coupled-cluster etc)From my experience,
ctf
gets useful when there are many symmetries, but the efficiency is less than nested loops in Fortran https://github.com/cyclops-community/ctf/issues/136If my observation is true, that would affect
symtensor
, which adoptsctf
as the backend https://github.com/yangcal/symtensorIf so, and I use
f2py
etc to make a Fortran-python interface, how complicated to use it to the backend ofopt_einsum
? Or is there any available options already? (even I usectf
as the backend, presumably I still need to mark symmetries for the tensors used inopt_einsum
)