Skip to content
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

Possibilities to utilize symmetry in opt_einsum #185

Closed
Lancashire3001 opened this issue Apr 28, 2022 · 1 comment
Closed

Possibilities to utilize symmetry in opt_einsum #185

Lancashire3001 opened this issue Apr 28, 2022 · 1 comment

Comments

@Lancashire3001
Copy link

Lancashire3001 commented Apr 28, 2022

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], where B[:,:,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
cyclops-community/ctf#136

If my observation is true, that would affect symtensor, which adopts ctf as the backend
https://github.com/yangcal/symtensor

If so, and I use f2py etc to make a Fortran-python interface, how complicated to use it to the backend of opt_einsum? Or is there any available options already? (even I use ctf as the backend, presumably I still need to mark symmetries for the tensors used in opt_einsum)

@Lancashire3001 Lancashire3001 changed the title Possibilies to utilize symmetry in opt_einsum Possibilities to utilize symmetry in opt_einsum Apr 28, 2022
@dgasmith
Copy link
Owner

dgasmith commented May 1, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants