Skip to content

Commit aa3868b

Browse files
authored
Merge pull request #494 from moritzgubler/property/hirshfeld
Add Hirshfeld charge analysis
2 parents f258b45 + b7568e4 commit aa3868b

File tree

136 files changed

+18994
-712
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+18994
-712
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ include(${PROJECT_SOURCE_DIR}/cmake/downloaded/autocmake_code_coverage.cmake)
5858
include(${PROJECT_SOURCE_DIR}/cmake/custom/mpi.cmake)
5959
include(${PROJECT_SOURCE_DIR}/cmake/custom/omp.cmake)
6060
include(${PROJECT_SOURCE_DIR}/cmake/custom/sad_basis.cmake)
61+
include(${PROJECT_SOURCE_DIR}/cmake/custom/hirshfeld.cmake)
6162
include(${PROJECT_SOURCE_DIR}/cmake/custom/main.cmake)
6263
include(${PROJECT_SOURCE_DIR}/cmake/custom/feature_summary.cmake)
6364
include(${PROJECT_SOURCE_DIR}/cmake/custom/tests.cmake)

cmake/custom/hirshfeld.cmake

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
set(HIRSHFELD_SOURCE_DIR ${PROJECT_SOURCE_DIR}/share/hirshfeld CACHE STRING "Path to azora potentials")
3+
set(HIRSHFELD_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/hirshfeld)
4+
install(
5+
DIRECTORY share/hirshfeld
6+
DESTINATION share/${PROJECT_NAME}
7+
)

doc/users/user_ref.rst

+6
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,12 @@ User input reference
440440

441441
**Default** ``[]``
442442

443+
:hirshfeld_charges: Compute Hirshfeld charges.
444+
445+
**Type** ``bool``
446+
447+
**Default** ``False``
448+
443449
:geometric_derivative: Compute geometric derivative.
444450

445451
**Type** ``bool``

python/mrchem/helpers.py

+6
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,12 @@ def write_scf_properties(user_dict, origin):
295295
"precision": user_dict["world_prec"],
296296
"smoothing": user_dict["Precisions"]["nuclear_prec"],
297297
}
298+
if user_dict["Properties"]["hirshfeld_charges"]:
299+
prop_dict["hirshfeld_charges"] = {}
300+
prop_dict["hirshfeld_charges"]["hirshfeld-1"] = {
301+
'precision': user_dict["world_prec"]
302+
}
303+
298304
return prop_dict
299305

300306

python/mrchem/input_parser/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
This file was automatically generated by parselglossy on 2024-05-14
1+
This file was automatically generated by parselglossy on 2024-08-15
22
Editing is *STRONGLY DISCOURAGED*
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# -*- coding: utf-8 -*-
22

3-
# This file was automatically generated by parselglossy on 2024-05-14
3+
# This file was automatically generated by parselglossy on 2024-08-15
44
# Editing is *STRONGLY DISCOURAGED*

python/mrchem/input_parser/api.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
# This file was automatically generated by parselglossy on 2024-05-14
3+
# This file was automatically generated by parselglossy on 2024-08-15
44
# Editing is *STRONGLY DISCOURAGED*
55

66
from copy import deepcopy
@@ -359,6 +359,9 @@ def stencil() -> JSONDict:
359359
{ 'default': [],
360360
'name': 'plot_orbitals',
361361
'type': 'List[int]'},
362+
{ 'default': False,
363+
'name': 'hirshfeld_charges',
364+
'type': 'bool'},
362365
{ 'default': "user['GeometryOptimizer']['run']",
363366
'name': 'geometric_derivative',
364367
'type': 'bool'}],

python/mrchem/input_parser/cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
# This file was automatically generated by parselglossy on 2024-05-14
3+
# This file was automatically generated by parselglossy on 2024-08-15
44
# Editing is *STRONGLY DISCOURAGED*
55

66
import argparse

python/mrchem/input_parser/docs/user_ref.rst

+6
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,12 @@ User input reference
440440

441441
**Default** ``[]``
442442

443+
:hirshfeld_charges: Compute Hirshfeld charges.
444+
445+
**Type** ``bool``
446+
447+
**Default** ``False``
448+
443449
:geometric_derivative: Compute geometric derivative.
444450

445451
**Type** ``bool``

python/mrchem/input_parser/plumbing/lexer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
# This file was automatically generated by parselglossy on 2024-05-14
3+
# This file was automatically generated by parselglossy on 2024-08-15
44
# Editing is *STRONGLY DISCOURAGED*
55

66
import json

python/mrchem/input_parser/plumbing/pyparsing/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ def __repr__(self):
120120
return f"{__name__}.{type(self).__name__}({', '.join('{}={!r}'.format(*nv) for nv in zip(self._fields, self))})"
121121

122122

123-
__version_info__ = version_info(3, 1, 1, "final", 1)
124-
__version_time__ = "29 Jul 2023 22:27 UTC"
123+
__version_info__ = version_info(3, 1, 2, "final", 1)
124+
__version_time__ = "06 Mar 2024 07:08 UTC"
125125
__version__ = __version_info__.__version__
126126
__versionTime__ = __version_time__
127127
__author__ = "Paul McGuire <[email protected]>"

python/mrchem/input_parser/plumbing/pyparsing/actions.py

+5-16
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def with_attribute(*args, **attr_dict):
111111
<div type="graph">1,3 2,3 1,1</div>
112112
<div>this has no type</div>
113113
</div>
114-
115114
'''
116115
div,div_end = make_html_tags("div")
117116
@@ -199,19 +198,9 @@ def with_class(classname, namespace=""):
199198

200199
# pre-PEP8 compatibility symbols
201200
# fmt: off
202-
@replaced_by_pep8(replace_with)
203-
def replaceWith(): ...
204-
205-
@replaced_by_pep8(remove_quotes)
206-
def removeQuotes(): ...
207-
208-
@replaced_by_pep8(with_attribute)
209-
def withAttribute(): ...
210-
211-
@replaced_by_pep8(with_class)
212-
def withClass(): ...
213-
214-
@replaced_by_pep8(match_only_at_col)
215-
def matchOnlyAtCol(): ...
216-
201+
replaceWith = replaced_by_pep8("replaceWith", replace_with)
202+
removeQuotes = replaced_by_pep8("removeQuotes", remove_quotes)
203+
withAttribute = replaced_by_pep8("withAttribute", with_attribute)
204+
withClass = replaced_by_pep8("withClass", with_class)
205+
matchOnlyAtCol = replaced_by_pep8("matchOnlyAtCol", match_only_at_col)
217206
# fmt: on

python/mrchem/input_parser/plumbing/pyparsing/common.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ class pyparsing_common:
206206
scientific notation and returns a float"""
207207

208208
# streamlining this expression makes the docs nicer-looking
209-
number = (sci_real | real | signed_integer).setName("number").streamline()
209+
number = (sci_real | real | signed_integer).set_name("number").streamline()
210210
"""any numeric expression, returns the corresponding Python type"""
211211

212212
fnumber = (
@@ -216,6 +216,13 @@ class pyparsing_common:
216216
)
217217
"""any int or real number, returned as float"""
218218

219+
ieee_float = (
220+
Regex(r"(?i)[+-]?((\d+\.?\d*(e[+-]?\d+)?)|nan|inf(inity)?)")
221+
.set_name("ieee_float")
222+
.set_parse_action(convert_to_float)
223+
)
224+
"""any floating-point literal (int, real number, infinity, or NaN), returned as float"""
225+
219226
identifier = Word(identchars, identbodychars).set_name("identifier")
220227
"""typical code identifier (leading alpha or '_', followed by 0 or more alphas, nums, or '_')"""
221228

0 commit comments

Comments
 (0)