mirror of
https://github.com/TREX-CoE/trexio.git
synced 2025-01-03 18:16:22 +01:00
Merge pull request #104 from TREX-CoE/gammcor
Added Cholesky decomposition of ERI and RDM
This commit is contained in:
commit
0c18b60f1d
10
.github/workflows/actions.yml
vendored
10
.github/workflows/actions.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
|||||||
|
|
||||||
get_commit_message:
|
get_commit_message:
|
||||||
name: Get commit message
|
name: Get commit message
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
outputs:
|
outputs:
|
||||||
message: ${{ steps.commit_message.outputs.message }}
|
message: ${{ steps.commit_message.outputs.message }}
|
||||||
steps:
|
steps:
|
||||||
@ -34,8 +34,8 @@ jobs:
|
|||||||
|
|
||||||
trexio_ubuntu:
|
trexio_ubuntu:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
name: x86 Ubuntu latest
|
name: x86 Ubuntu 20.04
|
||||||
needs: get_commit_message
|
needs: get_commit_message
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -101,8 +101,8 @@ jobs:
|
|||||||
|
|
||||||
trexio_macos:
|
trexio_macos:
|
||||||
|
|
||||||
runs-on: macos-latest
|
runs-on: macos-11
|
||||||
name: x86 MacOS latest
|
name: x86 MacOS 11
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
6
.github/workflows/build-wheels.yml
vendored
6
.github/workflows/build-wheels.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
|||||||
get_commit_message:
|
get_commit_message:
|
||||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||||
name: Get commit message
|
name: Get commit message
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
outputs:
|
outputs:
|
||||||
message: ${{ steps.commit_message.outputs.message }}
|
message: ${{ steps.commit_message.outputs.message }}
|
||||||
steps:
|
steps:
|
||||||
@ -39,7 +39,7 @@ jobs:
|
|||||||
if: >-
|
if: >-
|
||||||
contains(needs.get_commit_message.outputs.message, '[wheel build]') ||
|
contains(needs.get_commit_message.outputs.message, '[wheel build]') ||
|
||||||
(github.repository == 'TREX-CoE/trexio' && startsWith(github.ref, 'refs/tags/v'))
|
(github.repository == 'TREX-CoE/trexio' && startsWith(github.ref, 'refs/tags/v'))
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
manylinux_tag: [2010_x86_64, 2014_x86_64, 2_24_x86_64]
|
manylinux_tag: [2010_x86_64, 2014_x86_64, 2_24_x86_64]
|
||||||
@ -182,7 +182,7 @@ jobs:
|
|||||||
publish_wheels:
|
publish_wheels:
|
||||||
name: Publish all wheels on PyPI
|
name: Publish all wheels on PyPI
|
||||||
needs: [build_linux_wheels, build_macos_wheels]
|
needs: [build_linux_wheels, build_macos_wheels]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the branch
|
- name: Checkout the branch
|
||||||
|
2
.github/workflows/gh-pages.yml
vendored
2
.github/workflows/gh-pages.yml
vendored
@ -20,7 +20,7 @@ jobs:
|
|||||||
run: sudo apt-get update
|
run: sudo apt-get update
|
||||||
|
|
||||||
- name: install dependencies
|
- 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
|
# this step is needed to pull the git submodule org-html-themes
|
||||||
#- name: initialize submodules
|
#- name: initialize submodules
|
||||||
|
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -1,6 +1,6 @@
|
|||||||
[submodule "python/examples"]
|
[submodule "python/examples"]
|
||||||
path = 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"]
|
[submodule "docs/org-html-themes"]
|
||||||
path = 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
|
||||||
|
@ -17,6 +17,8 @@ CHANGES
|
|||||||
- Added OCaml binding
|
- Added OCaml binding
|
||||||
- Added spin and energy in MOs
|
- Added spin and energy in MOs
|
||||||
- Added CSF group
|
- Added CSF group
|
||||||
|
- Added Cholesky-decomposed two-electron integrals
|
||||||
|
- Added Cholesky-decomposed RDMs for Gammcor
|
||||||
- Added `trexio_flush` functionality
|
- Added `trexio_flush` functionality
|
||||||
- Optional compilation `--without-fortran`
|
- Optional compilation `--without-fortran`
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# TREXIO_INCLUDE_DIRS - The TREXIO include directories;
|
# TREXIO_INCLUDE_DIRS - The TREXIO include directories;
|
||||||
# TREXIO_LIBRARIES - The libraries needed to use TREXIO;
|
# TREXIO_LIBRARIES - The libraries needed to use TREXIO;
|
||||||
|
|
||||||
# If TREXIO has been installed in a non-standard location, one can set an
|
# If TREXIO has been installed in a non-standard location, one can set an
|
||||||
# environment variable $TREXIO_DIR in the current shell:
|
# environment variable $TREXIO_DIR in the current shell:
|
||||||
# $ export TREXIO_DIR=<custom_path>
|
# $ export TREXIO_DIR=<custom_path>
|
||||||
# to indicate the prefix used during the TREXIO installation
|
# to indicate the prefix used during the TREXIO installation
|
||||||
@ -45,13 +45,13 @@ set(TREXIO_SEARCH_PATHS
|
|||||||
/opt
|
/opt
|
||||||
)
|
)
|
||||||
|
|
||||||
find_path(TREXIO_INCLUDE_DIR
|
find_path(TREXIO_INCLUDE_DIR
|
||||||
NAMES trexio.h
|
NAMES trexio.h
|
||||||
HINTS $ENV{TREXIO_DIR}
|
HINTS $ENV{TREXIO_DIR}
|
||||||
PATH_SUFFIXES include/trexio include
|
PATH_SUFFIXES include/trexio include
|
||||||
PATHS ${TREXIO_SEARCH_PATHS}
|
PATHS ${TREXIO_SEARCH_PATHS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# No need to specify platform-specific prefix (e.g. libtrexio on Unix) or
|
# No need to specify platform-specific prefix (e.g. libtrexio on Unix) or
|
||||||
# suffix (e.g. .so on Unix or .dylib on MacOS) in NAMES. CMake takes care of that.
|
# suffix (e.g. .so on Unix or .dylib on MacOS) in NAMES. CMake takes care of that.
|
||||||
@ -70,8 +70,8 @@ INCLUDE(FindPackageHandleStandardArgs)
|
|||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TREXIO DEFAULT_MSG TREXIO_LIBRARY TREXIO_INCLUDE_DIR )
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TREXIO DEFAULT_MSG TREXIO_LIBRARY TREXIO_INCLUDE_DIR )
|
||||||
MARK_AS_ADVANCED(TREXIO_INCLUDE_DIR TREXIO_LIBRARY)
|
MARK_AS_ADVANCED(TREXIO_INCLUDE_DIR TREXIO_LIBRARY)
|
||||||
|
|
||||||
# Mot setting _INCLUDE_DIR and _LIBRARIES is considered a bug,
|
# Mot setting _INCLUDE_DIR and _LIBRARIES is considered a bug,
|
||||||
# see https://gitlab.kitware.com/cmake/community/-/wikis/doc/tutorials/How-To-Find-Libraries
|
# see https://gitlab.kitware.com/cmake/community/-/wikis/doc/tutorials/How-To-Find-Libraries
|
||||||
set(TREXIO_LIBRARIES ${TREXIO_LIBRARY})
|
set(TREXIO_LIBRARIES ${TREXIO_LIBRARY})
|
||||||
set(TREXIO_INCLUDE_DIRS ${TREXIO_INCLUDE_DIR})
|
set(TREXIO_INCLUDE_DIRS ${TREXIO_INCLUDE_DIR})
|
||||||
|
|
||||||
|
100
trex.org
100
trex.org
@ -651,15 +651,25 @@ prim_factor =
|
|||||||
|
|
||||||
** Two-electron integrals (~mo_2e_int~ group)
|
** 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
|
[[#ao_two_e][AO two-electron integrals section]]. Here, the integrals are given in
|
||||||
the basis of molecular orbitals.
|
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
|
#+NAME: mo_2e_int
|
||||||
| Variable | Type | Dimensions | Description |
|
| Variable | Type | Dimensions | Description |
|
||||||
|----------+----------------+------------------------------------+-----------------------------------------|
|
|-----------------------+----------------+-----------------------------------------+-----------------------------------------------|
|
||||||
| ~eri~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | Electron repulsion integrals |
|
| ~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_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")
|
#+CALL: json(data=mo_2e_int, title="mo_2e_int")
|
||||||
|
|
||||||
@ -667,8 +677,12 @@ prim_factor =
|
|||||||
:results:
|
:results:
|
||||||
#+begin_src python :tangle trex.json
|
#+begin_src python :tangle trex.json
|
||||||
"mo_2e_int": {
|
"mo_2e_int": {
|
||||||
"eri" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
|
"eri" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
|
||||||
, "eri_lr" : [ "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_src
|
||||||
:end:
|
:end:
|
||||||
@ -833,17 +847,43 @@ prim_factor =
|
|||||||
\frac{1}{2} \sum_{ijlk} \Gamma_{ijkl} \langle k l | i j \rangle
|
\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
|
#+NAME: rdm
|
||||||
| Variable | Type | Dimensions | Description |
|
| Variable | Type | Dimensions | Description |
|
||||||
|-----------+----------------+------------------------------------+-----------------------------------------------------------------------|
|
|------------------------+----------------+----------------------------------------------+-----------------------------------------------------------------------|
|
||||||
| ~1e~ | ~float~ | ~(mo.num, mo.num)~ | One body density matrix |
|
| ~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_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 |
|
| ~1e_dn~ | ~float~ | ~(mo.num, mo.num)~ | \downarrow-spin component of the one body density matrix |
|
||||||
| ~2e~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | Two-body reduced density matrix (spin trace) |
|
| ~2e~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | Two-body reduced density matrix (spin trace) |
|
||||||
| ~2e_upup~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | \uparrow\uparrow component of the two-body reduced density matrix |
|
| ~2e_upup~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | \uparrow\uparrow component of the two-body reduced density matrix |
|
||||||
| ~2e_dndn~ | ~float sparse~ | ~(mo.num, mo.num, mo.num, mo.num)~ | \downarrow\downarrow component of the two-body reduced density matrix |
|
| ~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_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_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")
|
#+CALL: json(data=rdm, title="rdm")
|
||||||
|
|
||||||
@ -851,14 +891,24 @@ prim_factor =
|
|||||||
:results:
|
:results:
|
||||||
#+begin_src python :tangle trex.json
|
#+begin_src python :tangle trex.json
|
||||||
"rdm": {
|
"rdm": {
|
||||||
"1e" : [ "float" , [ "mo.num", "mo.num" ] ]
|
"1e" : [ "float" , [ "mo.num", "mo.num" ] ]
|
||||||
, "1e_up" : [ "float" , [ "mo.num", "mo.num" ] ]
|
, "1e_up" : [ "float" , [ "mo.num", "mo.num" ] ]
|
||||||
, "1e_dn" : [ "float" , [ "mo.num", "mo.num" ] ]
|
, "1e_dn" : [ "float" , [ "mo.num", "mo.num" ] ]
|
||||||
, "2e" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
|
, "2e" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
|
||||||
, "2e_upup" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
|
, "2e_upup" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
|
||||||
, "2e_dndn" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
|
, "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_updn" : [ "float sparse", [ "mo.num", "mo.num", "mo.num", "mo.num" ] ]
|
||||||
, "2e_dnup" : [ "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_src
|
||||||
:end:
|
:end:
|
||||||
|
Loading…
Reference in New Issue
Block a user