Skip to content

Commit

Permalink
ensure topology section gets removed
Browse files Browse the repository at this point in the history
  • Loading branch information
svandenhaute committed Feb 11, 2024
1 parent faba588 commit 066c499
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion container/Dockerfile_python3.10_cuda
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ RUN pip install git+https://github.com/acesuit/MACE.git@55f7411 && \
RUN pip install pyscf

ARG GIT_COMMIT_SHA
RUN pip install 'psiflow[parsl] @ git+https://github.com/molmod/psiflow@v3.0.3'
RUN pip install 'psiflow[parsl] @ git+https://github.com/molmod/psiflow'
RUN pip cache purge

ENV OMPI_MCA_plm_rsh_agent=
Expand Down
13 changes: 8 additions & 5 deletions psiflow/reference/_cp2k.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def dict_to_str(cp2k_input_dict: dict) -> str:
def insert_atoms_in_input(cp2k_input_dict: dict, atoms: FlowAtoms):
from ase.data import chemical_symbols

# get rid of topology if it's there
cp2k_input_dict["force_eval"]["subsys"].pop("topology", None)

coord = []
cell = {}
for i in range(len(atoms)):
Expand All @@ -54,11 +57,11 @@ def insert_atoms_in_input(cp2k_input_dict: dict, atoms: FlowAtoms):
)
)
cp2k_input_dict["force_eval"]["subsys"]["coord"] = {"*": coord}
if atoms.pbc.any():
for i, vector in enumerate(["A", "B", "C"]):
cell[vector] = "{} {} {}".format(*atoms.cell[i])
# cell.append('{} {} {} {}'.format(vector, *atoms.cell[i]))
cp2k_input_dict["force_eval"]["subsys"]["cell"] = cell

assert atoms.pbc.any() # CP2K needs cell info!
for i, vector in enumerate(["A", "B", "C"]):
cell[vector] = "{} {} {}".format(*atoms.cell[i])
cp2k_input_dict["force_eval"]["subsys"]["cell"] = cell


@typeguard.typechecked
Expand Down

0 comments on commit 066c499

Please sign in to comment.