Skip to content

Commit

Permalink
Convert default radii to bohr when input units are not angstrom (#473)
Browse files Browse the repository at this point in the history
* Convert default radii to bohr when input units are not angstrom
* Update template.yml (formatting and documentation)
* Refine fix for unit conversion of cavity params, add tests
  • Loading branch information
robertodr committed Nov 20, 2023
1 parent f0d0560 commit 2dcd68d
Show file tree
Hide file tree
Showing 23 changed files with 929 additions and 78 deletions.
6 changes: 3 additions & 3 deletions doc/users/user_ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ User input reference
:Cavity: Define the interlocking spheres cavity.

:red:`Keywords`
:mode: Determines how to set up the interlocking spheres cavity. ``atoms``: centers are taken from the molecular geometry, radii taken from tabulated data (van der Waals radius), and rescaled using the parameters ``alpha``, ``beta`` and ``sigma`` (R_i <- alpha*R_i + beta*sigma). Default spheres can be modified and/or extra spheres added, using the `$spheres` section, see documentation. ``explicit``: centers and radii given explicitly in the ``spheres`` block.
:mode: Determines how to set up the interlocking spheres cavity. ``atoms``: centers are taken from the molecular geometry, radii taken from tabulated data (van der Waals radius), and rescaled using the parameters ``alpha``, ``beta`` and ``sigma`` (R_i <- alpha*R_i + beta*sigma). Default spheres can be modified and/or extra spheres added, using the ``$spheres`` section, see documentation. ``explicit``: centers and radii given explicitly in the ``spheres`` block.

**Type** ``str``

Expand All @@ -872,7 +872,7 @@ User input reference
**Predicates**
- ``value.lower() in ['atoms', 'explicit']``

:spheres: This input parameter affects the list of spheres used to generate the cavity. In all cases, values for the radius, the radius scaling factor (``alpha``), the width (``sigma``), and the width scaling factor (``beta``) can be modified. If they are not specified their global default values are used. In ``atoms`` mode, we *modify* the default list of spheres, built with centers from the molecular geometry and radii from internal tabulated van der Waals values. To *substitute* a sphere, include a line like: $spheres i R [alpha] [beta] [sigma] $end to specify that the ``i`` atom in the molecule (0-based indexing) should use radius ``R`` instead of the pre-tabulated vdW radius. To *add* a sphere, include a line like: $spheres x y z R [alpha] [beta] [sigma] $end to specify that a sphere of radius ``R`` should be added at position ``(x, y, z)``. Spheres added in this way are not aware of their parent atom, if any. They will **not** contribute to the molecular gradient. In ``explicit`` mode, we *build* the complete sphere list from scratch. You can add a line like: $spheres x y z R [alpha] [beta] [sigma] $end to specify that a sphere of radius ``R`` should be added at position ``(x, y, z)``. Spheres added in this way are not aware of their parent atom, if any. They will **not** contribute to the molecular gradient. Alternatively, you can specify a line like: $spheres i R [alpha] [beta] [sigma] $end to specify that the ``i`` atom in the molecule (0-based indexing) should use radius ``R``. Spheres added in this way are aware of their parent atom. They will contribute to the molecular gradient.
:spheres: This input parameter affects the list of spheres used to generate the cavity. In all cases, values for the radius, the radius scaling factor (``alpha``), the width (``sigma``), and the width scaling factor (``beta``) can be modified. If they are not specified their global default values are used. In ``atoms`` mode, we *modify* the default list of spheres, built with centers from the molecular geometry and radii from internal tabulated van der Waals values. To *substitute* a sphere, include a line like: `` $spheres i R [alpha] [beta] [sigma] $end `` to specify that the ``i`` atom in the molecule (0-based indexing) should use radius ``R`` instead of the pre-tabulated vdW radius. To *add* a sphere, include a line like: `` $spheres x y z R [alpha] [beta] [sigma] $end ``` to specify that a sphere of radius ``R`` should be added at position ``(x, y, z)``. Spheres added in this way are not aware of their parent atom, if any. They will **not** contribute to the molecular gradient. In ``explicit`` mode, we *build* the complete sphere list from scratch. You can add a line like: `` $spheres x y z R [alpha] [beta] [sigma] $end `` to specify that a sphere of radius ``R`` should be added at position ``(x, y, z)``. Spheres added in this way are not aware of their parent atom, if any. They will **not** contribute to the molecular gradient. Alternatively, you can specify a line like: `` $spheres i R [alpha] [beta] [sigma] $end `` to specify that the ``i`` atom in the molecule (0-based indexing) should use radius ``R``. Spheres added in this way are aware of their parent atom. They will contribute to the molecular gradient.

**Type** ``str``

Expand All @@ -890,7 +890,7 @@ User input reference

**Default** ``0.5``

:sigma: Width of cavity boundary, smaller value means sharper transition.
:sigma: Width of cavity boundary, smaller value means sharper transition. **This quantity has dimensions of length. The default value is in atomic units**.

**Type** ``float``

Expand Down
2 changes: 1 addition & 1 deletion python/mrchem/input_parser/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This file was automatically generated by parselglossy on 2023-05-21
This file was automatically generated by parselglossy on 2023-11-15
Editing is *STRONGLY DISCOURAGED*
2 changes: 1 addition & 1 deletion python/mrchem/input_parser/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

# This file was automatically generated by parselglossy on 2023-05-21
# This file was automatically generated by parselglossy on 2023-11-15
# Editing is *STRONGLY DISCOURAGED*
2 changes: 1 addition & 1 deletion python/mrchem/input_parser/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# This file was automatically generated by parselglossy on 2023-10-30
# This file was automatically generated by parselglossy on 2023-11-15
# Editing is *STRONGLY DISCOURAGED*

from copy import deepcopy
Expand Down
2 changes: 1 addition & 1 deletion python/mrchem/input_parser/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# This file was automatically generated by parselglossy on 2023-05-21
# This file was automatically generated by parselglossy on 2023-11-15
# Editing is *STRONGLY DISCOURAGED*

import argparse
Expand Down
6 changes: 3 additions & 3 deletions python/mrchem/input_parser/docs/user_ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ User input reference
:Cavity: Define the interlocking spheres cavity.

:red:`Keywords`
:mode: Determines how to set up the interlocking spheres cavity. ``atoms``: centers are taken from the molecular geometry, radii taken from tabulated data (van der Waals radius), and rescaled using the parameters ``alpha``, ``beta`` and ``sigma`` (R_i <- alpha*R_i + beta*sigma). Default spheres can be modified and/or extra spheres added, using the `$spheres` section, see documentation. ``explicit``: centers and radii given explicitly in the ``spheres`` block.
:mode: Determines how to set up the interlocking spheres cavity. ``atoms``: centers are taken from the molecular geometry, radii taken from tabulated data (van der Waals radius), and rescaled using the parameters ``alpha``, ``beta`` and ``sigma`` (R_i <- alpha*R_i + beta*sigma). Default spheres can be modified and/or extra spheres added, using the ``$spheres`` section, see documentation. ``explicit``: centers and radii given explicitly in the ``spheres`` block.

**Type** ``str``

Expand All @@ -872,7 +872,7 @@ User input reference
**Predicates**
- ``value.lower() in ['atoms', 'explicit']``

:spheres: This input parameter affects the list of spheres used to generate the cavity. In all cases, values for the radius, the radius scaling factor (``alpha``), the width (``sigma``), and the width scaling factor (``beta``) can be modified. If they are not specified their global default values are used. In ``atoms`` mode, we *modify* the default list of spheres, built with centers from the molecular geometry and radii from internal tabulated van der Waals values. To *substitute* a sphere, include a line like: $spheres i R [alpha] [beta] [sigma] $end to specify that the ``i`` atom in the molecule (0-based indexing) should use radius ``R`` instead of the pre-tabulated vdW radius. To *add* a sphere, include a line like: $spheres x y z R [alpha] [beta] [sigma] $end to specify that a sphere of radius ``R`` should be added at position ``(x, y, z)``. Spheres added in this way are not aware of their parent atom, if any. They will **not** contribute to the molecular gradient. In ``explicit`` mode, we *build* the complete sphere list from scratch. You can add a line like: $spheres x y z R [alpha] [beta] [sigma] $end to specify that a sphere of radius ``R`` should be added at position ``(x, y, z)``. Spheres added in this way are not aware of their parent atom, if any. They will **not** contribute to the molecular gradient. Alternatively, you can specify a line like: $spheres i R [alpha] [beta] [sigma] $end to specify that the ``i`` atom in the molecule (0-based indexing) should use radius ``R``. Spheres added in this way are aware of their parent atom. They will contribute to the molecular gradient.
:spheres: This input parameter affects the list of spheres used to generate the cavity. In all cases, values for the radius, the radius scaling factor (``alpha``), the width (``sigma``), and the width scaling factor (``beta``) can be modified. If they are not specified their global default values are used. In ``atoms`` mode, we *modify* the default list of spheres, built with centers from the molecular geometry and radii from internal tabulated van der Waals values. To *substitute* a sphere, include a line like: `` $spheres i R [alpha] [beta] [sigma] $end `` to specify that the ``i`` atom in the molecule (0-based indexing) should use radius ``R`` instead of the pre-tabulated vdW radius. To *add* a sphere, include a line like: `` $spheres x y z R [alpha] [beta] [sigma] $end ``` to specify that a sphere of radius ``R`` should be added at position ``(x, y, z)``. Spheres added in this way are not aware of their parent atom, if any. They will **not** contribute to the molecular gradient. In ``explicit`` mode, we *build* the complete sphere list from scratch. You can add a line like: `` $spheres x y z R [alpha] [beta] [sigma] $end `` to specify that a sphere of radius ``R`` should be added at position ``(x, y, z)``. Spheres added in this way are not aware of their parent atom, if any. They will **not** contribute to the molecular gradient. Alternatively, you can specify a line like: `` $spheres i R [alpha] [beta] [sigma] $end `` to specify that the ``i`` atom in the molecule (0-based indexing) should use radius ``R``. Spheres added in this way are aware of their parent atom. They will contribute to the molecular gradient.

**Type** ``str``

Expand All @@ -890,7 +890,7 @@ User input reference

**Default** ``0.5``

:sigma: Width of cavity boundary, smaller value means sharper transition.
:sigma: Width of cavity boundary, smaller value means sharper transition. **This quantity has dimensions of length. The default value is in atomic units**.

**Type** ``float``

Expand Down
2 changes: 1 addition & 1 deletion python/mrchem/input_parser/plumbing/lexer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# This file was automatically generated by parselglossy on 2023-05-21
# This file was automatically generated by parselglossy on 2023-11-15
# Editing is *STRONGLY DISCOURAGED*

import json
Expand Down

0 comments on commit 2dcd68d

Please sign in to comment.