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

What's the best practice to build 3c2e tensors? #300

Open
John-zzh opened this issue Jan 7, 2025 · 1 comment
Open

What's the best practice to build 3c2e tensors? #300

John-zzh opened this issue Jan 7, 2025 · 1 comment

Comments

@John-zzh
Copy link

John-zzh commented Jan 7, 2025

Hi developers,

I'm trying to implement TDDFT-ris with density fitting. In general, I need T_pqP,
which is contraced through

" Puv, up,vq - >   Ppq" , eri3c, coeff_p, coeff_q

coeff_p, coeff_q referes to either occupied or virtual blocks of coefficeint matrix, C[:,:nocc], C[:,nocc:]. (could be both)
P being the auxbf dimension, smallest dimension here (compared to u v p q)

How to implement it on GPU?

CPU code is relatively easy, I can build full eri3c given enough memory. Or slice it along the P dimension with limied memory.
I belive GPU memory is more valuable, so I guess there must be some memory-efficeint way to code up this procesure?

@wxj6000
Copy link
Collaborator

wxj6000 commented Jan 7, 2025

Hi Zehao,
Yes, GPU memory is quite limited. In GPU4PySCF, CDERI is stored in a sparse format, and is automatically transferred to CPU memory. When it is needed, the sparse CDERI is unpacked into CDERI slices for usage.

Here is an example of performing Lji,jk->Lki.
https://github.com/pyscf/gpu4pyscf/blob/master/gpu4pyscf/df/df_jk.py#L293

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