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

Added kpoint to MO group #138

Merged
merged 7 commits into from
May 13, 2024
Merged

Added kpoint to MO group #138

merged 7 commits into from
May 13, 2024

Conversation

scemama
Copy link
Member

@scemama scemama commented Feb 15, 2024

I have added an array kpoint to the MO group.
With this modification, the users can store all the MOs of all kpoints in a single file. This is necessary because for correlated calculations (CI or CC), it is necessary to have 2-electron integrals involving MOs of different kpoints.
With this modification, it is possible to extend the format to correlated periodic calculations without breaking backwards compatibility.

trex.org Outdated
Comment on lines 1328 to 1349
| Variable | Type | Dimensions | Description |
|---------------+----------+---------------------+-----------------------------------------------------------------|
| ~type~ | ~str~ | | Type of Jastrow factor: ~CHAMP~ or ~Mu~ |
| ~en_num~ | ~dim~ | | Number of Electron-nucleus parameters |
| ~ee_num~ | ~dim~ | | Number of Electron-electron parameters |
| ~een_num~ | ~dim~ | | Number of Electron-electron-nucleus parameters |
| ~en~ | ~float~ | ~(jastrow.en_num)~ | Electron-nucleus parameters |
| ~ee~ | ~float~ | ~(jastrow.ee_num)~ | Electron-electron parameters |
| ~een~ | ~float~ | ~(jastrow.een_num)~ | Electron-electron-nucleus parameters |
| ~en_nucleus~ | ~index~ | ~(jastrow.en_num)~ | Nucleus relative to the eN parameter |
| ~een_nucleus~ | ~index~ | ~(jastrow.een_num)~ | Nucleus relative to the eeN parameter |
| ~ee_scaling~ | ~float~ | | $\kappa$ value in CHAMP Jastrow for electron-electron distances |
| ~en_scaling~ | ~float~ | ~(nucleus.num)~ | $\kappa$ value in CHAMP Jastrow for electron-nucleus distances |
| Variable | Type | Dimensions | Description |
|---------------+---------+---------------------+-----------------------------------------------------------------|
| ~type~ | ~str~ | | Type of Jastrow factor: ~CHAMP~ or ~Mu~ |
| ~en_num~ | ~dim~ | | Number of Electron-nucleus parameters |
| ~ee_num~ | ~dim~ | | Number of Electron-electron parameters |
| ~een_num~ | ~dim~ | | Number of Electron-electron-nucleus parameters |
| ~en~ | ~float~ | ~(jastrow.en_num)~ | Electron-nucleus parameters |
| ~ee~ | ~float~ | ~(jastrow.ee_num)~ | Electron-electron parameters |
| ~een~ | ~float~ | ~(jastrow.een_num)~ | Electron-electron-nucleus parameters |
| ~en_nucleus~ | ~index~ | ~(jastrow.en_num)~ | Nucleus relative to the eN parameter |
| ~een_nucleus~ | ~index~ | ~(jastrow.een_num)~ | Nucleus relative to the eeN parameter |
| ~ee_scaling~ | ~float~ | | $\kappa$ value in CHAMP Jastrow for electron-electron distances |
| ~en_scaling~ | ~float~ | ~(nucleus.num)~ | $\kappa$ value in CHAMP Jastrow for electron-nucleus distances |
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces

trex.org Outdated Show resolved Hide resolved
trex.org Outdated
Comment on lines 811 to 832
| Variable | Type | Dimensions | Description |
|------------------+---------+--------------------+--------------------------------------------------------------------------|
| ~type~ | ~str~ | | Free text to identify the set of MOs (HF, Natural, Local, CASSCF, /etc/) |
| ~num~ | ~dim~ | | Number of MOs |
| ~num~ | ~dim~ | | Number of MOs stored in the file |
| ~coefficient~ | ~float~ | ~(ao.num, mo.num)~ | MO coefficients |
| ~coefficient_im~ | ~float~ | ~(ao.num, mo.num)~ | MO coefficients (imaginary part) |
| ~class~ | ~str~ | ~(mo.num)~ | Choose among: Core, Inactive, Active, Virtual, Deleted |
| ~symmetry~ | ~str~ | ~(mo.num)~ | Symmetry in the point group |
| ~occupation~ | ~float~ | ~(mo.num)~ | Occupation number |
| ~energy~ | ~float~ | ~(mo.num)~ | For canonical MOs, corresponding eigenvalue |
| ~spin~ | ~int~ | ~(mo.num)~ | For UHF wave functions, 0 is $\alpha$ and 1 is $\beta$ |
| ~kpoint~ | ~int~ | ~(mo.num)~ | For periodic calculations, the $k$ point to which each MO belongs |

**Warning**: ~mo.num~ is the total number of MOs stored in the file.
For periodic calculations, this group contains all the MOs
belonging to all $k$ points so ~mo.num~ will be the sum of the
numbers of MOs in each $k$ point. For UHF wave functions, ~mo.num~
is the number of spin-orbitals, twice the number of spatial orbitals.

#+CALL: json(data=mo, title="mo")

#+RESULTS:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The modification is here

trex.org Outdated
Comment on lines 842 to 853
, "occupation" : [ "float", [ "mo.num" ] ]
, "energy" : [ "float", [ "mo.num" ] ]
, "spin" : [ "int" , [ "mo.num" ] ]
, "kpoint" : [ "int" , [ "mo.num" ] ]
} ,
#+end_src
:end:


*** One-electron integrals (~mo_1e_int~ group)

The operators as the same as those defined in the
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and here

trex.org Outdated
Comment on lines 326 to 354
*** Data definitions

#+NAME: basis
| Variable | Type | Dimensions | Description | |
|---------------------+---------+----------------------------------------------+------------------------------------------------------------------------------+---|
| ~type~ | ~str~ | | Type of basis set: "Gaussian", "Slater", "Numerical" or "PW" for plane waves | |
| ~prim_num~ | ~dim~ | | Total number of primitives | |
| ~shell_num~ | ~dim~ | | Total number of shells | |
| ~nao_grid_num~ | ~dim~ | | Total number of grid points for numerical orbitals | |
| ~interp_coeff_cnt~ | ~dim~ | | Number of coefficients for the numerical orbital interpolator | |
| ~nucleus_index~ | ~index~ | ~(basis.shell_num)~ | One-to-one correspondence between shells and atomic indices | |
| ~shell_ang_mom~ | ~int~ | ~(basis.shell_num)~ | One-to-one correspondence between shells and angular momenta | |
| ~shell_factor~ | ~float~ | ~(basis.shell_num)~ | Normalization factor of each shell ($\mathcal{N}_s$) | |
| ~r_power~ | ~int~ | ~(basis.shell_num)~ | Power to which $r$ is raised ($n_s$) | |
| ~nao_grid_start~ | ~index~ | ~(basis.shell_num)~ | Index of the first data point for a given numerical orbital | |
| ~nao_grid_size~ | ~dim~ | ~(basis.shell_num)~ | Number of data points per numerical orbital | |
| ~shell_index~ | ~index~ | ~(basis.prim_num)~ | One-to-one correspondence between primitives and shell index | |
| ~exponent~ | ~float~ | ~(basis.prim_num)~ | Exponents of the primitives ($\gamma_{ks}$) | |
| ~coefficient~ | ~float~ | ~(basis.prim_num)~ | Coefficients of the primitives ($a_{ks}$) | |
| ~prim_factor~ | ~float~ | ~(basis.prim_num)~ | Normalization coefficients for the primitives ($f_{ks}$) | |
| ~e_cut~ | ~float~ | | Energy cut-off for plane-wave calculations | |
| ~nao_grid_radius~ | ~float~ | ~(basis.nao_grid_num)~ | Radii of grid points for numerical orbitals | |
| ~nao_grid_phi~ | ~float~ | ~(basis.nao_grid_num)~ | Wave function values for numerical orbitals | |
| ~nao_grid_grad~ | ~float~ | ~(basis.nao_grid_num)~ | Radial gradient of numerical orbitals | |
| ~nao_grid_lap~ | ~float~ | ~(basis.nao_grid_num)~ | Laplacian of numerical orbitals | |
| ~interpolator_kind~ | ~str~ | | Kind of spline, e.g. "Polynomial" | |
| ~interpolator_phi~ | ~float~ | ~(basis.interp_coeff_cnt,basis.nao_grid_num)~ | Coefficients for numerical orbital interpolation function | |
| ~interpolator_grad~ | ~float~ | ~(basis.interp_coeff_cnt,basis.nao_grid_num)~ | Coefficients for numerical orbital gradient interpolation function | |
| ~interpolator_lap~ | ~float~ | ~(basis.interp_coeff_cnt,basis.nao_grid_num)~ | Coefficients for numerical orbital laplacian interpolation function | |
| Variable | Type | Dimensions | Description |
|---------------------+---------+-----------------------------------------------+------------------------------------------------------------------------------|
| ~type~ | ~str~ | | Type of basis set: "Gaussian", "Slater", "Numerical" or "PW" for plane waves |
| ~prim_num~ | ~dim~ | | Total number of primitives |
| ~shell_num~ | ~dim~ | | Total number of shells |
| ~nao_grid_num~ | ~dim~ | | Total number of grid points for numerical orbitals |
| ~interp_coeff_cnt~ | ~dim~ | | Number of coefficients for the numerical orbital interpolator |
| ~nucleus_index~ | ~index~ | ~(basis.shell_num)~ | One-to-one correspondence between shells and atomic indices |
| ~shell_ang_mom~ | ~int~ | ~(basis.shell_num)~ | One-to-one correspondence between shells and angular momenta |
| ~shell_factor~ | ~float~ | ~(basis.shell_num)~ | Normalization factor of each shell ($\mathcal{N}_s$) |
| ~r_power~ | ~int~ | ~(basis.shell_num)~ | Power to which $r$ is raised ($n_s$) |
| ~nao_grid_start~ | ~index~ | ~(basis.shell_num)~ | Index of the first data point for a given numerical orbital |
| ~nao_grid_size~ | ~dim~ | ~(basis.shell_num)~ | Number of data points per numerical orbital |
| ~shell_index~ | ~index~ | ~(basis.prim_num)~ | One-to-one correspondence between primitives and shell index |
| ~exponent~ | ~float~ | ~(basis.prim_num)~ | Exponents of the primitives ($\gamma_{ks}$) |
| ~coefficient~ | ~float~ | ~(basis.prim_num)~ | Coefficients of the primitives ($a_{ks}$) |
| ~prim_factor~ | ~float~ | ~(basis.prim_num)~ | Normalization coefficients for the primitives ($f_{ks}$) |
| ~e_cut~ | ~float~ | | Energy cut-off for plane-wave calculations |
| ~nao_grid_radius~ | ~float~ | ~(basis.nao_grid_num)~ | Radii of grid points for numerical orbitals |
| ~nao_grid_phi~ | ~float~ | ~(basis.nao_grid_num)~ | Wave function values for numerical orbitals |
| ~nao_grid_grad~ | ~float~ | ~(basis.nao_grid_num)~ | Radial gradient of numerical orbitals |
| ~nao_grid_lap~ | ~float~ | ~(basis.nao_grid_num)~ | Laplacian of numerical orbitals |
| ~interpolator_kind~ | ~str~ | | Kind of spline, e.g. "Polynomial" |
| ~interpolator_phi~ | ~float~ | ~(basis.interp_coeff_cnt,basis.nao_grid_num)~ | Coefficients for numerical orbital interpolation function |
| ~interpolator_grad~ | ~float~ | ~(basis.interp_coeff_cnt,basis.nao_grid_num)~ | Coefficients for numerical orbital gradient interpolation function |
| ~interpolator_lap~ | ~float~ | ~(basis.interp_coeff_cnt,basis.nao_grid_num)~ | Coefficients for numerical orbital laplacian interpolation function |
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces

@scemama scemama changed the title sAdded kpoint to MO group Added kpoint to MO group Feb 16, 2024
@q-posev
Copy link
Member

q-posev commented Feb 16, 2024

I let @kousuke-nakano decide. He will know if it posses issues for the files produced in the past where we had TREXIO file per k-point.

Also, it is not clear to me how you want to arrange the data with the new mo_num. For example, the mo_coefficient matrix: one has to be extremely careful not to screw up the data ordering if all k-points go in the same array.

@scemama
Copy link
Member Author

scemama commented Mar 1, 2024

@kousuke-nakano ping!

trex.org Outdated Show resolved Hide resolved
trex.org Outdated Show resolved Hide resolved
trex.org Outdated Show resolved Hide resolved
@scemama
Copy link
Member Author

scemama commented May 13, 2024

@q-posev : I think we can merge this branch now...

@q-posev q-posev merged commit 1117a5b into master May 13, 2024
3 checks passed
@q-posev q-posev deleted the kpoint branch May 13, 2024 15:06
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

Successfully merging this pull request may close these issues.

4 participants