HyQD / coupled-cluster

Upstream coupled cluster code
MIT License
3 stars 3 forks source link

Replace np.einsum with contract from opt_einsum #75

Closed haakoek closed 3 years ago

haakoek commented 3 years ago

This pull request replaces all occurences of np.einsum with contract from opt_einsum, which should result in a nice speed up for somewhat larger systems for those methods that rely on np.einsum for the right hand sides.

Additionally, explicit construction of the Hvvvv intermediate is avoided in the computation of the l2 right hand sides in rccd and rccsd.

haakoek commented 3 years ago

From what I have seen np.tensordot is as fast as contract. On the other hand, I think contract is more readable (nice interface). Apart from that, it does not matter which one we use in my opinion.

Schoyen commented 3 years ago

I added two extra commits to remove numpy as a dependency for RCCSD and DIIS.

Schoyen commented 3 years ago

We can leave tensordot for now then.