Skip to content

Commit

Permalink
Merge pull request #496 from moritzgubler/azora_all_potentials
Browse files Browse the repository at this point in the history
Atomic Zora Relativity
  • Loading branch information
ilfreddy authored Nov 7, 2024
2 parents aa3868b + 764eb22 commit 72cb685
Show file tree
Hide file tree
Showing 112 changed files with 17,654 additions and 39 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ include(${PROJECT_SOURCE_DIR}/cmake/custom/mpi.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/custom/omp.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/custom/sad_basis.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/custom/hirshfeld.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/custom/azora_potentials.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/custom/main.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/custom/feature_summary.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/custom/tests.cmake)
Expand Down
7 changes: 7 additions & 0 deletions cmake/custom/azora_potentials.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set(AZORA_POTENTIALS_SOURCE_DIR ${PROJECT_SOURCE_DIR}/share/azora_potentials CACHE STRING "Path to azora potentials")
set(AZORA_POTENTIALS_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/azora_potentials)
install(
DIRECTORY share/azora_potentials
DESTINATION share/${PROJECT_NAME}
)

10 changes: 8 additions & 2 deletions doc/users/user_ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,14 @@ User input reference

**Default** ``True``

:relativity: Set method for relativistic treatment. ``ZORA`` for fully self-consistent ZORA potential, by default including all potentials (``V_nuc``, ``J``, ``V_xc``) but this can be overwritten in the ``ZORA`` section. ``nZORA`` is shortcut for nuclear-ZORA, i.e. only ``V_nuc`` is included (this keyword takes precedence over keywords in the ``ZORA`` section).
:relativity: Set method for relativistic treatment. ``ZORA`` for fully self-consistent ZORA potential, by default including all potentials (``V_nuc``, ``J``, ``V_xc``) but this can be overwritten in the ``ZORA`` section. ``nZORA`` is shortcut for nuclear-ZORA, i.e. only ``V_nuc`` is included (this keyword takes precedence over keywords in the ``ZORA`` section). ``azora`` uses atomic ZORA potentials, which are precomputed and read from the directory specified in the ``azora_potential_path`` keyword.

**Type** ``str``

**Default** ``none``

**Predicates**
- ``value.lower() in ['none', 'zora', 'nzora']``
- ``value.lower() in ['none', 'zora', 'nzora', 'azora']``

:environment: Set method for treatment of environment. ``none`` for vacuum calculation. ``PCM`` for Polarizable Continuum Model, which will activate the ``PCM`` input section for further parametrization options. The ``PB`` and ``LPB`` variants add the Poisson-Boltzmann and Linearized Poisson-Boltzmann solvers, respectively.

Expand Down Expand Up @@ -374,6 +374,12 @@ User input reference

**Default** ``True``

:azora_potential_path: Path to the directory containing the AZORA potentials. If not specified, the default potentials will be used. Look into the readme file in the share/azora_potentials directory for information about the potential file format.

**Type** ``str``

**Default** ``none``

:DFT: Define the exchange-correlation functional in case of DFT.

:red:`Keywords`
Expand Down
43 changes: 31 additions & 12 deletions python/mrchem/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,19 @@ def write_scf_fock(user_dict, wf_dict, origin):
"include_nuclear": user_dict["ZORA"]["include_nuclear"],
"include_coulomb": user_dict["ZORA"]["include_coulomb"],
"include_xc": user_dict["ZORA"]["include_xc"],
"isAZORA": False,
"azora_potential_path": user_dict["ZORA"]["azora_potential_path"]
}
# AZORA
if user_dict["WaveFunction"]["relativity"].lower() == "azora":
fock_dict["zora_operator"] = {
"include_nuclear": False,
"include_coulomb": False,
"include_xc": False,
"isAZORA": True
}
if user_dict["ZORA"]["azora_potential_path"].lower() != "none":
fock_dict["zora_operator"]["azora_potential_path"] = user_dict["ZORA"]["azora_potential_path"]

# Kinetic
fock_dict["kinetic_operator"] = {"derivative": user_dict["Derivatives"]["kinetic"]}
Expand Down Expand Up @@ -513,12 +525,21 @@ def parse_wf_method(user_dict):

# Determine relativity name label for print outs to the output file
relativity_name = "None"
wf_dict = dict()
if user_dict["WaveFunction"]["relativity"].lower() in ["none"]:
user_dict["WaveFunction"]["relativity"] = "off"
user_dict["ZORA"]["include_nuclear"] = False
user_dict["ZORA"]["include_coulomb"] = False
user_dict["ZORA"]["include_xc"] = False

if user_dict["WaveFunction"]["relativity"].lower() in ["azora"]:
relativity_name = "AZORA"
user_dict["WaveFunction"]["relativity"] = "azora"
user_dict["ZORA"]["include_nuclear"] = False
user_dict["ZORA"]["include_coulomb"] = False
user_dict["ZORA"]["include_xc"] = False
user_dict["ZORA"]["isAZORA"] = True

if user_dict["WaveFunction"]["relativity"].lower() in ["nzora"]:
user_dict["WaveFunction"]["relativity"] = "zora"
user_dict["ZORA"]["include_nuclear"] = True
Expand All @@ -541,10 +562,10 @@ def parse_wf_method(user_dict):
else:
raise RuntimeError("ZORA selected, but no ZORA potential included")

if user_dict["ZORA"]["include_xc"] and not restricted:
raise RuntimeError(
"ZORA (V_xc) not available for unrestricted wavefunctions"
)
# if user_dict["ZORA"]["include_xc"] and not restricted:
# raise RuntimeError(
# "ZORA (V_xc) not available for unrestricted wavefunctions"
# )

# Determine environment name label for print outs to the output file
environment_name = "None"
Expand All @@ -567,14 +588,12 @@ def parse_wf_method(user_dict):
# Labels to aggregate
external_name = f"Electric field ({x}, {y}, {z})"

wf_dict = {
"relativity_name": relativity_name,
"environment_name": environment_name,
"external_name": external_name,
"method_name": method_name,
"method_type": method_type,
"dft_funcs": dft_funcs,
}
wf_dict["relativity_name"] = relativity_name
wf_dict["environment_name"] = environment_name
wf_dict["external_name"] = external_name
wf_dict["method_name"] = method_name
wf_dict["method_type"] = method_type
wf_dict["dft_funcs"] = dft_funcs
return wf_dict


Expand Down
8 changes: 6 additions & 2 deletions python/mrchem/input_parser/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ def stencil() -> JSONDict:
'predicates': [ 'value.lower() '
"in ['none', "
"'zora', "
"'nzora']"],
"'nzora', "
"'azora']"],
'type': 'str'},
{ 'default': 'none',
'name': 'environment',
Expand Down Expand Up @@ -326,7 +327,10 @@ def stencil() -> JSONDict:
'type': 'bool'},
{ 'default': True,
'name': 'include_xc',
'type': 'bool'}],
'type': 'bool'},
{ 'default': 'none',
'name': 'azora_potential_path',
'type': 'str'}],
'name': 'ZORA'},
{ 'keywords': [ { 'default': 0.0,
'name': 'density_cutoff',
Expand Down
10 changes: 8 additions & 2 deletions python/mrchem/input_parser/docs/user_ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,14 @@ User input reference

**Default** ``True``

:relativity: Set method for relativistic treatment. ``ZORA`` for fully self-consistent ZORA potential, by default including all potentials (``V_nuc``, ``J``, ``V_xc``) but this can be overwritten in the ``ZORA`` section. ``nZORA`` is shortcut for nuclear-ZORA, i.e. only ``V_nuc`` is included (this keyword takes precedence over keywords in the ``ZORA`` section).
:relativity: Set method for relativistic treatment. ``ZORA`` for fully self-consistent ZORA potential, by default including all potentials (``V_nuc``, ``J``, ``V_xc``) but this can be overwritten in the ``ZORA`` section. ``nZORA`` is shortcut for nuclear-ZORA, i.e. only ``V_nuc`` is included (this keyword takes precedence over keywords in the ``ZORA`` section). ``azora`` uses atomic ZORA potentials, which are precomputed and read from the directory specified in the ``azora_potential_path`` keyword.

**Type** ``str``

**Default** ``none``

**Predicates**
- ``value.lower() in ['none', 'zora', 'nzora']``
- ``value.lower() in ['none', 'zora', 'nzora', 'azora']``

:environment: Set method for treatment of environment. ``none`` for vacuum calculation. ``PCM`` for Polarizable Continuum Model, which will activate the ``PCM`` input section for further parametrization options. The ``PB`` and ``LPB`` variants add the Poisson-Boltzmann and Linearized Poisson-Boltzmann solvers, respectively.

Expand Down Expand Up @@ -374,6 +374,12 @@ User input reference

**Default** ``True``

:azora_potential_path: Path to the directory containing the AZORA potentials. If not specified, the default potentials will be used. Look into the readme file in the share/azora_potentials directory for information about the potential file format.

**Type** ``str``

**Default** ``none``

:DFT: Define the exchange-correlation functional in case of DFT.

:red:`Keywords`
Expand Down
10 changes: 9 additions & 1 deletion python/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,14 @@ sections:
type: str
default: none
predicates:
- value.lower() in ['none', 'zora', 'nzora']
- value.lower() in ['none', 'zora', 'nzora', 'azora']
docstring: |
Set method for relativistic treatment. ``ZORA`` for fully self-consistent ZORA potential, by default
including all potentials (``V_nuc``, ``J``, ``V_xc``) but this can be overwritten in the ``ZORA`` section.
``nZORA`` is shortcut for nuclear-ZORA, i.e. only ``V_nuc`` is included (this keyword takes precedence
over keywords in the ``ZORA`` section).
``azora`` uses atomic ZORA potentials, which are precomputed and read from the directory
specified in the ``azora_potential_path`` keyword.
- name: environment
type: str
default: none
Expand Down Expand Up @@ -335,6 +337,12 @@ sections:
default: true
docstring: |
Include the XC potential ``V_xc`` in the ZORA potential.
- name: azora_potential_path
type: str
default: none
docstring: |
Path to the directory containing the AZORA potentials. If not specified, the default potentials will be used.
Look into the readme file in the share/azora_potentials directory for information about the potential file format.
- name: DFT
docstring: |
Define the exchange-correlation functional in case of DFT.
Expand Down
Loading

0 comments on commit 72cb685

Please sign in to comment.