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

CP2K fixes #1056

Merged
merged 18 commits into from
Nov 14, 2024
Merged

CP2K fixes #1056

merged 18 commits into from
Nov 14, 2024

Conversation

janosh
Copy link
Member

@janosh janosh commented Nov 13, 2024

this PR fixes several issues with running CP2K in orbital transformation (OT) mode which crashes if it finds a KPOINTS file which the current Cp2kInputGenerator does not allow to disable.

it also fixes

  • parsing the stress_tensor in

    path = "cp2k_run_dir"
    atomate2.cp2k.schemas.task.TaskDocument.from_directory(path)

    which was previously looking for stress in cp2k.out (which i did not see mentioned in CP2K docs). it now looks for stress_tensor (still using stress as fallback in case i missed something)

  • ignoring empty BASIS and POTENTIAL files in "cp2k_run_dir" which previously caused Invalid Element = None in

    def _get_basis_and_potential_files(dir_name: Path) -> dict[Cp2kObject, DataFile]:

it goes hand in hand with materialsproject/pymatgen#4169 that fixes a number of bugs in pymatgen CP2K modules

pinging @chiang-yuan and @utf

…no optional files will be written

before there was no way to disable writing potentially redundant BASIS and POTENTIAL files
…s None

KPOINTS are not compatible with orbital transformation (OT) mode and CP2K will crash if found
@janosh janosh added the cp2k CP2K quantum chemistry package label Nov 13, 2024
@utf
Copy link
Member

utf commented Nov 13, 2024

This all looks good to me.

@janosh
Copy link
Member Author

janosh commented Nov 13, 2024

thanks @utf. i added more tests for the CP2K powerups and filesystem utils in 4193ed9 and 21b7aca. there wasn't much coverage

@janosh janosh enabled auto-merge (squash) November 13, 2024 15:28
@janosh
Copy link
Member Author

janosh commented Nov 13, 2024

failing tests will be fixed by next pymatgen release since materialsproject/pymatgen#4169 was merged. we could install from master in CI or wait for next release

@utf
Copy link
Member

utf commented Nov 13, 2024

Hi @janosh, best to wait for next release to avoid any indeterministic behaviour from the CI.

@janosh janosh changed the title CP2K tweaks CP2K fixes Nov 14, 2024
raised TypeError: 'NoneType' object is not subscriptable
seems to be a bug in CP2K that it doesn't include E prefix for exponents with 3 digits

update test_structure_optimization to expect correct stress
@janosh janosh merged commit d743a69 into main Nov 14, 2024
15 checks passed
@janosh janosh deleted the cp2k-tweaks branch November 14, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cp2k CP2K quantum chemistry package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants