1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2025-01-03 10:06:01 +01:00

Merge pull request #104 from TREX-CoE/gammcor

Added Cholesky decomposition of ERI and RDM
This commit is contained in:
Anthony Scemama 2022-12-01 19:15:58 +01:00 committed by GitHub
commit 0c18b60f1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 94 additions and 42 deletions

View File

@ -15,7 +15,7 @@ jobs:
get_commit_message:
name: Get commit message
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
outputs:
message: ${{ steps.commit_message.outputs.message }}
steps:
@ -34,8 +34,8 @@ jobs:
trexio_ubuntu:
runs-on: ubuntu-latest
name: x86 Ubuntu latest
runs-on: ubuntu-20.04
name: x86 Ubuntu 20.04
needs: get_commit_message
steps:
@ -101,8 +101,8 @@ jobs:
trexio_macos:
runs-on: macos-latest
name: x86 MacOS latest
runs-on: macos-11
name: x86 MacOS 11
steps:
- uses: actions/checkout@v2

View File

@ -16,7 +16,7 @@ jobs:
get_commit_message:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Get commit message
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
outputs:
message: ${{ steps.commit_message.outputs.message }}
steps:
@ -39,7 +39,7 @@ jobs:
if: >-
contains(needs.get_commit_message.outputs.message, '[wheel build]') ||
(github.repository == 'TREX-CoE/trexio' && startsWith(github.ref, 'refs/tags/v'))
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
manylinux_tag: [2010_x86_64, 2014_x86_64, 2_24_x86_64]
@ -182,7 +182,7 @@ jobs:
publish_wheels:
name: Publish all wheels on PyPI
needs: [build_linux_wheels, build_macos_wheels]
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout the branch

View File

@ -20,7 +20,7 @@ jobs:
run: sudo apt-get update
- name: install dependencies
run: sudo apt-get install emacs26
run: sudo apt-get install emacs
# this step is needed to pull the git submodule org-html-themes
#- name: initialize submodules

4
.gitmodules vendored
View File

@ -1,6 +1,6 @@
[submodule "python/examples"]
path = python/examples
url = git@github.com:TREX-CoE/trexio-tutorials.git
url = https://github.com/TREX-CoE/trexio-tutorials.git
[submodule "docs/org-html-themes"]
path = docs/org-html-themes
url = git@github.com:fniessen/org-html-themes.git
url = https://github.com/fniessen/org-html-themes.git

View File

@ -17,6 +17,8 @@ CHANGES
- Added OCaml binding
- Added spin and energy in MOs
- Added CSF group
- Added Cholesky-decomposed two-electron integrals
- Added Cholesky-decomposed RDMs for Gammcor
- Added `trexio_flush` functionality
- Optional compilation `--without-fortran`

View File

@ -651,15 +651,25 @@ prim_factor =
** Two-electron integrals (~mo_2e_int~ group)
The operators as the same as those defined in the
The operators are the same as those defined in the
[[#ao_two_e][AO two-electron integrals section]]. Here, the integrals are given in
the basis of molecular orbitals.
The Cholesky decomposition of the integrals can also be stored:
\[
\A_{ijkl} = \sum_{\alpha} G_{il\alpha} G_{jl\alpha}
\]
#+NAME: mo_2e_int
| Variable | Type | Dimensions | Description |
|----------+----------------+------------------------------------+-----------------------------------------|
|-----------------------+----------------+-----------------------------------------+-----------------------------------------------|
| ~eri~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | Electron repulsion integrals |
| ~eri_lr~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | Long-range Electron repulsion integrals |
| ~eri_cholesky_num~ | ~dim~ | | Number of Cholesky vectors for ERI |
| ~eri_cholesky~ | ~float sparse~ | ~(mo.num, mo.num, rdm.2e_cholesky_num)~ | Cholesky decomposition of the ERI |
| ~eri_lr_cholesky_num~ | ~dim~ | | Number of Cholesky vectors for long range ERI |
| ~eri_lr_cholesky~ | ~float sparse~ | ~(mo.num, mo.num, rdm.2e_cholesky_num)~ | Cholesky decomposition of the long range ERI |
#+CALL: json(data=mo_2e_int, title="mo_2e_int")
@ -669,6 +679,10 @@ prim_factor =
"mo_2e_int": {
"eri" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
, "eri_lr" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
, "eri_cholesky_num" : [ "dim" , [] ]
, "eri_cholesky" : [ "float sparse", [ "rdm.2e_cholesky_num", "mo.num", "mo.num" ] ]
, "eri_lr_cholesky_num" : [ "dim" , [] ]
, "eri_lr_cholesky" : [ "float sparse", [ "rdm.2e_cholesky_num", "mo.num", "mo.num" ] ]
} ,
#+end_src
:end:
@ -833,9 +847,25 @@ prim_factor =
\frac{1}{2} \sum_{ijlk} \Gamma_{ijkl} \langle k l | i j \rangle
\]
To compress the storage, the Cholesky decomposition of the RDMs can
be stored:
\[
\Gamma_{ijkl} = \sum_{\alpha} G_{ij\alpha} G_{kl\alpha}
\]
Warning: as opposed to electron repulsion integrals, the
decomposition is made such that the Cholesky vectors are expanded
in a two-electron basis
$f_{ij}(\mathbf{r}_1,\mathbf{r}_2) = \phi_i(\mathbf{r}_1) \phi_j(\mathbf{r}_2)$,
whereas in electron repulsion integrals each Cholesky vector is
expressed in a basis of a one-electron function
$g_{ik}(\mathbf{r}_1) = \phi_i(\mathbf{r}_1) \phi_k(\mathbf{r}_1)$.
#+NAME: rdm
| Variable | Type | Dimensions | Description |
|-----------+----------------+------------------------------------+-----------------------------------------------------------------------|
|------------------------+----------------+----------------------------------------------+-----------------------------------------------------------------------|
| ~1e~ | ~float~ | ~(mo.num, mo.num)~ | One body density matrix |
| ~1e_up~ | ~float~ | ~(mo.num, mo.num)~ | \uparrow-spin component of the one body density matrix |
| ~1e_dn~ | ~float~ | ~(mo.num, mo.num)~ | \downarrow-spin component of the one body density matrix |
@ -844,6 +874,16 @@ prim_factor =
| ~2e_dndn~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | \downarrow\downarrow component of the two-body reduced density matrix |
| ~2e_updn~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | \uparrow\downarrow component of the two-body reduced density matrix |
| ~2e_dnup~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | \downarrow\uparrow component of the two-body reduced density matrix |
| ~2e_cholesky_num~ | ~dim~ | | Number of Cholesky vectors |
| ~2e_cholesky~ | ~float sparse~ | ~(mo.num, mo.num, rdm.2e_cholesky_num)~ | Cholesky decomposition of the Two-body RDM (spin trace) |
| ~2e_upup_cholesky_num~ | ~dim~ | | Number of Cholesky vectors |
| ~2e_upup_cholesky~ | ~float sparse~ | ~(mo.num, mo.num, rdm.2e_upup_cholesky_num)~ | Cholesky decomposition of the Two-body RDM (\uparrow\uparrow) |
| ~2e_dndn_cholesky_num~ | ~dim~ | | Number of Cholesky vectors |
| ~2e_dndn_cholesky~ | ~float sparse~ | ~(mo.num, mo.num, rdm.2e_dndn_cholesky_num)~ | Cholesky decomposition of the Two-body RDM (\downarrow\downarrow) |
| ~2e_updn_cholesky_num~ | ~dim~ | | Number of Cholesky vectors |
| ~2e_updn_cholesky~ | ~float sparse~ | ~(mo.num, mo.num, rdm.2e_updn_cholesky_num)~ | Cholesky decomposition of the Two-body RDM (\uparrow\downarrow) |
| ~2e_dnup_cholesky_num~ | ~dim~ | | Number of Cholesky vectors |
| ~2e_dnup_cholesky~ | ~float sparse~ | ~(mo.num, mo.num, rdm.2e_dnup_cholesky_num)~ | Cholesky decomposition of the Two-body RDM (\downarrow\uparrow) |
#+CALL: json(data=rdm, title="rdm")
@ -859,6 +899,16 @@ prim_factor =
, "2e_dndn" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
, "2e_updn" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
, "2e_dnup" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
, "2e_cholesky_num" : [ "dim" , [] ]
, "2e_cholesky" : [ "float sparse", [ "rdm.2e_cholesky_num", "mo.num", "mo.num" ] ]
, "2e_upup_cholesky_num" : [ "dim" , [] ]
, "2e_upup_cholesky" : [ "float sparse", [ "rdm.2e_upup_cholesky_num", "mo.num", "mo.num" ] ]
, "2e_dndn_cholesky_num" : [ "dim" , [] ]
, "2e_dndn_cholesky" : [ "float sparse", [ "rdm.2e_dndn_cholesky_num", "mo.num", "mo.num" ] ]
, "2e_updn_cholesky_num" : [ "dim" , [] ]
, "2e_updn_cholesky" : [ "float sparse", [ "rdm.2e_updn_cholesky_num", "mo.num", "mo.num" ] ]
, "2e_dnup_cholesky_num" : [ "dim" , [] ]
, "2e_dnup_cholesky" : [ "float sparse", [ "rdm.2e_dnup_cholesky_num", "mo.num", "mo.num" ] ]
} ,
#+end_src
:end: