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

Add Hirshfeld charge analysis #494

Merged
merged 47 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
3ce3cb3
add first files
moritzgubler Aug 15, 2024
a25a929
more stuff
moritzgubler Aug 15, 2024
aa898ae
add logsumexp
moritzgubler Aug 15, 2024
ed5cf73
remove old fields
moritzgubler Aug 15, 2024
2eb8fc6
more headers
moritzgubler Aug 15, 2024
0bda950
make framework for partitioning
moritzgubler Aug 15, 2024
7cd2d77
update driver
moritzgubler Aug 15, 2024
37455d5
update parser
moritzgubler Aug 15, 2024
3291422
add densities
moritzgubler Aug 16, 2024
8b86c56
add hirshfeld densities install mechanism
moritzgubler Aug 16, 2024
5caae4a
rename density directiroy
moritzgubler Aug 16, 2024
e8d79cd
only parse positive densities
moritzgubler Aug 16, 2024
005591d
get datadir
moritzgubler Aug 16, 2024
5794500
implement anlytic represantation
moritzgubler Aug 16, 2024
98536ca
finish work on constructor
moritzgubler Aug 16, 2024
12e60dc
project function
moritzgubler Aug 16, 2024
f204742
small interpolation changes
moritzgubler Aug 16, 2024
801dbf3
hirshfeld charges working.
moritzgubler Aug 16, 2024
749e22f
remove unnecessary pointer
moritzgubler Aug 16, 2024
5da67a9
add printers
moritzgubler Aug 16, 2024
713e773
fix index bug
moritzgubler Aug 16, 2024
5106968
write interpolated densities
moritzgubler Aug 16, 2024
1ed5688
fix factor
moritzgubler Aug 16, 2024
54903e8
change sign
moritzgubler Aug 16, 2024
5b76d68
Should be bug free
moritzgubler Aug 16, 2024
137989e
nicer print
moritzgubler Aug 16, 2024
2963a0b
add hirshfeld to json output
moritzgubler Aug 17, 2024
bb69dce
add documentation
moritzgubler Aug 17, 2024
a146eea
add mpi
moritzgubler Aug 17, 2024
7f4b94b
add mechanism that calculates norm of tabulated hirshfeld
moritzgubler Aug 17, 2024
2d71455
add timer
moritzgubler Aug 18, 2024
8d5ed4c
add test
moritzgubler Aug 18, 2024
94cee01
partition function is not l2, dont project it
moritzgubler Sep 6, 2024
31884e4
update reference values for hirshfeld test
moritzgubler Sep 7, 2024
ef0a807
gemove factor of four pi.
moritzgubler Sep 20, 2024
84e2733
change hirshfeld reference densities
moritzgubler Sep 20, 2024
74a88ec
adjust test
moritzgubler Sep 20, 2024
13ea821
add new densities
moritzgubler Sep 25, 2024
19218fa
adjust test results
moritzgubler Sep 25, 2024
dd7c108
Merge branch 'master' into property/hirshfeld
moritzgubler Sep 25, 2024
b73b68c
add readme that explains density format
moritzgubler Sep 25, 2024
f50b4bb
split up evalf function into seperate functions
moritzgubler Sep 26, 2024
b9bd240
rename functions and add extrapolation mode
moritzgubler Sep 26, 2024
11d2c92
move reading of densities to density_utils
moritzgubler Sep 26, 2024
c78886b
move logsumexp to mathutils
moritzgubler Sep 26, 2024
1e5e2c7
move polyinterpolator to utils
moritzgubler Sep 26, 2024
b7568e4
make evalf function constant and fix small bug
moritzgubler Sep 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ include(${PROJECT_SOURCE_DIR}/cmake/downloaded/autocmake_code_coverage.cmake)
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/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/hirshfeld.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

set(HIRSHFELD_SOURCE_DIR ${PROJECT_SOURCE_DIR}/share/hirshfeld CACHE STRING "Path to azora potentials")
set(HIRSHFELD_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/hirshfeld)
install(
DIRECTORY share/hirshfeld
DESTINATION share/${PROJECT_NAME}
)
6 changes: 6 additions & 0 deletions doc/users/user_ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,12 @@ User input reference

**Default** ``[]``

:hirshfeld_charges: Compute Hirshfeld charges.

**Type** ``bool``

**Default** ``False``

:geometric_derivative: Compute geometric derivative.

**Type** ``bool``
Expand Down
6 changes: 6 additions & 0 deletions python/mrchem/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ def write_scf_properties(user_dict, origin):
"precision": user_dict["world_prec"],
"smoothing": user_dict["Precisions"]["nuclear_prec"],
}
if user_dict["Properties"]["hirshfeld_charges"]:
prop_dict["hirshfeld_charges"] = {}
prop_dict["hirshfeld_charges"]["hirshfeld-1"] = {
'precision': user_dict["world_prec"]
}

return prop_dict


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 2024-05-14
This file was automatically generated by parselglossy on 2024-08-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 2024-05-14
# This file was automatically generated by parselglossy on 2024-08-15
# Editing is *STRONGLY DISCOURAGED*
5 changes: 4 additions & 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 2024-05-14
# This file was automatically generated by parselglossy on 2024-08-15
# Editing is *STRONGLY DISCOURAGED*

from copy import deepcopy
Expand Down Expand Up @@ -359,6 +359,9 @@ def stencil() -> JSONDict:
{ 'default': [],
'name': 'plot_orbitals',
'type': 'List[int]'},
{ 'default': False,
'name': 'hirshfeld_charges',
'type': 'bool'},
{ 'default': "user['GeometryOptimizer']['run']",
'name': 'geometric_derivative',
'type': 'bool'}],
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 2024-05-14
# This file was automatically generated by parselglossy on 2024-08-15
# Editing is *STRONGLY DISCOURAGED*

import argparse
Expand Down
6 changes: 6 additions & 0 deletions python/mrchem/input_parser/docs/user_ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,12 @@ User input reference

**Default** ``[]``

:hirshfeld_charges: Compute Hirshfeld charges.

**Type** ``bool``

**Default** ``False``

:geometric_derivative: Compute geometric derivative.

**Type** ``bool``
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 2024-05-14
# This file was automatically generated by parselglossy on 2024-08-15
# Editing is *STRONGLY DISCOURAGED*

import json
Expand Down
4 changes: 2 additions & 2 deletions python/mrchem/input_parser/plumbing/pyparsing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def __repr__(self):
return f"{__name__}.{type(self).__name__}({', '.join('{}={!r}'.format(*nv) for nv in zip(self._fields, self))})"


__version_info__ = version_info(3, 1, 1, "final", 1)
__version_time__ = "29 Jul 2023 22:27 UTC"
__version_info__ = version_info(3, 1, 2, "final", 1)
__version_time__ = "06 Mar 2024 07:08 UTC"
__version__ = __version_info__.__version__
__versionTime__ = __version_time__
__author__ = "Paul McGuire <ptmcg.gm+pyparsing@gmail.com>"
Expand Down
21 changes: 5 additions & 16 deletions python/mrchem/input_parser/plumbing/pyparsing/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def with_attribute(*args, **attr_dict):
<div type="graph">1,3 2,3 1,1</div>
<div>this has no type</div>
</div>

'''
div,div_end = make_html_tags("div")

Expand Down Expand Up @@ -199,19 +198,9 @@ def with_class(classname, namespace=""):

# pre-PEP8 compatibility symbols
# fmt: off
@replaced_by_pep8(replace_with)
def replaceWith(): ...

@replaced_by_pep8(remove_quotes)
def removeQuotes(): ...

@replaced_by_pep8(with_attribute)
def withAttribute(): ...

@replaced_by_pep8(with_class)
def withClass(): ...

@replaced_by_pep8(match_only_at_col)
def matchOnlyAtCol(): ...

replaceWith = replaced_by_pep8("replaceWith", replace_with)
removeQuotes = replaced_by_pep8("removeQuotes", remove_quotes)
withAttribute = replaced_by_pep8("withAttribute", with_attribute)
withClass = replaced_by_pep8("withClass", with_class)
matchOnlyAtCol = replaced_by_pep8("matchOnlyAtCol", match_only_at_col)
# fmt: on
9 changes: 8 additions & 1 deletion python/mrchem/input_parser/plumbing/pyparsing/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class pyparsing_common:
scientific notation and returns a float"""

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

fnumber = (
Expand All @@ -216,6 +216,13 @@ class pyparsing_common:
)
"""any int or real number, returned as float"""

ieee_float = (
Regex(r"(?i)[+-]?((\d+\.?\d*(e[+-]?\d+)?)|nan|inf(inity)?)")
.set_name("ieee_float")
.set_parse_action(convert_to_float)
)
"""any floating-point literal (int, real number, infinity, or NaN), returned as float"""

identifier = Word(identchars, identbodychars).set_name("identifier")
"""typical code identifier (leading alpha or '_', followed by 0 or more alphas, nums, or '_')"""

Expand Down
Loading
Loading