-
Notifications
You must be signed in to change notification settings - Fork 29
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 UpfData
input namespace
#194
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
28b6ced
Allow UPF pseudos input.
yakutovicha 111f05b
Merge branch 'main' into feature/add-upfdata-input
yakutovicha 57f0929
Update cp2k version to 9.1
yakutovicha c88d582
Merge branch 'main' into feature/add-upfdata-input
yakutovicha 9f5118b
Remove SSSP install from the Dockerfile
yakutovicha 0de12d8
Add setup_sssp_pseudos fixture.
yakutovicha 878f1d6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0046cb9
Replace Si structure with a smaller one.
yakutovicha acfe65f
Trying to fix the test.
yakutovicha 9310628
Make sirius simulation faster.
yakutovicha b5c642b
Merge branch 'main' into feature/add-upfdata-input
yakutovicha 1c31343
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 3b736ae
Merge branch 'main' into feature/add-upfdata-input
yakutovicha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
2 | ||
Lattice="3.81196 0.0 0.0 1.9059800000000005 3.3012541982101284 0.0 1.9059800000000005 1.100418066070043 3.112452306633254" Properties=species:S:1:pos:R:3:_aiidalab_viewer_representation_default:I:1 spacegroup="P 1" unit_cell=conventional pbc="T T T" | ||
Si 0.00000000 0.00000000 0.00000000 0 | ||
Si 1.90598000 1.10041807 0.77811308 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
############################################################################### | ||
# Copyright (c), The AiiDA-CP2K authors. # | ||
# SPDX-License-Identifier: MIT # | ||
# AiiDA-CP2K is hosted on GitHub at https://github.com/aiidateam/aiida-cp2k # | ||
# For further information on the license, see the LICENSE.txt file. # | ||
############################################################################### | ||
"""Run simple DFT with calculation with SIRIUS.""" | ||
|
||
import os | ||
import sys | ||
|
||
import ase.io | ||
import click | ||
from aiida import common, engine, orm, plugins | ||
|
||
StructureData = plugins.DataFactory("core.structure") | ||
|
||
|
||
def example_sirius(cp2k_code, setup_sssp_pseudos): | ||
"""Run simple DFT calculation.""" | ||
|
||
print("Testing CP2K SIRIUS ENERGY on Si (DFT)...") | ||
|
||
thisdir = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
# Structure. | ||
structure = StructureData( | ||
ase=ase.io.read(os.path.join(thisdir, "..", "files", "si.xyz")) | ||
) | ||
|
||
# Parameters. | ||
parameters = orm.Dict( | ||
{ | ||
"FORCE_EVAL": { | ||
"METHOD": "SIRIUS", | ||
"STRESS_TENSOR": "ANALYTICAL", | ||
"PRINT": { | ||
"FORCES": {"FILENAME": "requested-forces", "ADD_LAST": "SYMBOLIC"} | ||
}, | ||
"PW_DFT": { | ||
"CONTROL": {"VERBOSITY": 2}, | ||
"PARAMETERS": { | ||
"ELECTRONIC_STRUCTURE_METHOD": "pseudopotential", | ||
"USE_SYMMETRY": True, | ||
"GK_CUTOFF": 5, | ||
"PW_CUTOFF": 20, | ||
"ENERGY_TOL": 0.1, | ||
"DENSITY_TOL": 0.1, | ||
"NUM_DFT_ITER": 400, | ||
"SMEARING": "FERMI_DIRAC", | ||
"SMEARING_WIDTH": 0.00225, | ||
}, | ||
"ITERATIVE_SOLVER": { | ||
"ENERGY_TOLERANCE": 0.001, | ||
"NUM_STEPS": 20, | ||
"SUBSPACE_SIZE": 4, | ||
"CONVERGE_BY_ENERGY": 1, | ||
}, | ||
}, | ||
"DFT": { | ||
"XC": { | ||
"XC_FUNCTIONAL": { | ||
"GGA_X_PBE": {"_": ""}, | ||
"GGA_C_PBE": {"_": ""}, | ||
} | ||
}, | ||
"PRINT": { | ||
"MO": { | ||
"_": "OFF", | ||
"ADD_LAST": "SYMBOLIC", | ||
"EIGENVALUES": True, | ||
"OCCUPATION_NUMBERS": True, | ||
"NDIGITS": 12, | ||
"EACH": {"CELL_OPT": 0, "GEO_OPT": 0, "MD": 0, "QS_SCF": 0}, | ||
}, | ||
"MULLIKEN": { | ||
"_": "ON", | ||
"ADD_LAST": "SYMBOLIC", | ||
"EACH": {"CELL_OPT": 0, "GEO_OPT": 0, "MD": 0}, | ||
}, | ||
"LOWDIN": {"_": "OFF"}, | ||
"HIRSHFELD": {"_": "OFF"}, | ||
}, | ||
}, | ||
"SUBSYS": { | ||
"KIND": [ | ||
{ | ||
"_": "Si", | ||
"POTENTIAL": "UPF Si.json", | ||
}, | ||
], | ||
}, | ||
}, | ||
} | ||
) | ||
|
||
# Construct process builder. | ||
builder = cp2k_code.get_builder() | ||
builder.structure = structure | ||
builder.parameters = parameters | ||
builder.code = cp2k_code | ||
pseudo_family = orm.load_group("SSSP/1.3/PBE/efficiency") | ||
builder.pseudos_upf = pseudo_family.get_pseudos(structure=structure) | ||
builder.metadata.options.resources = { | ||
"num_machines": 1, | ||
"num_mpiprocs_per_machine": 1, | ||
} | ||
builder.metadata.options.max_wallclock_seconds = 1 * 3 * 60 | ||
|
||
print("Submitted calculation...") | ||
engine.run(builder) | ||
|
||
|
||
@click.command("cli") | ||
@click.argument("codelabel") | ||
def cli(codelabel): | ||
"""Click interface.""" | ||
try: | ||
code = orm.load_code(codelabel) | ||
except common.NotExistent: | ||
print(f"The code '{codelabel}' does not exist.") | ||
sys.exit(1) | ||
example_sirius(code, setup_sssp_pseudos=None) | ||
|
||
|
||
if __name__ == "__main__": | ||
cli() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, since cp2k/cp2k#3651 CP2K+SIRIUS can read UPF potentials directly.