[Q&A] Hybrid DeepMD–Classical Force Field NVT Simulation in CP2K #5505
Replies: 4 comments 4 replies
-
|
Hi @drpriyadey, Yes, this is completely possible in CP2K, but it requires configuring the simulation engine under a Mixed Force-Field (QM/MM style) framework. Instead of treating DeePMD as a global potential, you partition the system so that CP2K evaluates the organic component using its internal classical MM mechanics, while routing the inorganic/metallic atomic coordinates to DeePMD-kit via an external calculator hook. Here is how to map this out in your CP2K input script (.inp):
Fortran
Fortran
Fortran
Fortran Ensure that your CP2K executable was compiled with the flags matching your libdeepmd_c.so library linking, or you will throw an unrecognized keyword error when initializing the DEEPMD block type. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you so much @Tobi-Adesoye san. I will try the procedure. |
Beta Was this translation helpful? Give feedback.
-
|
You are very welcome, @drpriyadey!
Don't hesitate to reach back out or reopen the thread if you encounter any
convergence anomalies or formatting quirks in your INPUT blocks once the
CP2K run kicks off. Best of luck with your hybrid NVT simulation!
…On Wed, Jun 10, 2026 at 2:39 AM Priya Dey ***@***.***> wrote:
Thank you so much @Tobi-Adesoye <https://github.com/Tobi-Adesoye> san. I
will try the procedure.
—
Reply to this email directly, view it on GitHub
<#5505?email_source=notifications&email_token=AQSPCWHW6OUJKUTTCOFJ4KD47C333A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZSGQ2DIMJTUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussioncomment-17244413>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQSPCWB2PUQH6KSS7ITFU7L47C333AVCNFSM6AAAAACZ6SGCECVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTOMRUGQ2DCMY>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AQSPCWEXY7FDSROYTAUKRXD47C333A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZSGQ2DIMJTUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/AQSPCWAWQ7T4P727YROPNRT47C333A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZSGQ2DIMJTUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
|
Hi @drpriyadey,
Thanks for testing this and for sharing the error output.
Looking at the messages you posted, I suspect the problem is not with your
structure files but with the input syntax itself. The unknown keyword
errors, followed by the CPASSERT failed in force_env_types.F, indicate that
CP2K is encountering sections or keywords that it does not recognize for
your build or version.
In hindsight, the example I shared was intended to illustrate the
high-level partitioning strategy rather than serve as a drop-in CP2K input
file. Some of the block names and keywords may therefore not correspond
exactly to valid CP2K syntax.
A few things would help narrow this down:
1.
Could you post the complete tobi.inp file (or at least the relevant
FORCE_EVAL sections)?
2.
Was your CP2K executable compiled with DeePMD support? Your banner
indicates deepmd is present, which is encouraging, but the exact
interface still matters.
3.
What is your intended coupling strategy? For example:
-
DeePMD for one subset of atoms and a classical force field for
another subset, or
-
DeePMD as the sole potential for the entire system.
If the goal is a true hybrid DeePMD + classical force-field simulation in
CP2K, I would also recommend checking whether the required coupling
mechanism is explicitly supported by your CP2K version and build
configuration, as the available interfaces can differ between releases.
If you share the input file, I'd be happy to take a closer look and help
identify the specific source of the assertion failure.
…On Mon, Jun 22, 2026 at 10:08 AM Priya Dey ***@***.***> wrote:
Dear @Tobi-Adesoye <https://github.com/Tobi-Adesoye>
After i am trying to correct the input file, I have the following error:
DBCSR| CPU Multiplication driver XSMM (U)
DBCSR| Multrec recursion limit 512 (U)
DBCSR| Multiplication stack size 1000 (D)
DBCSR| Maximum elements for images UNLIMITED (U)
DBCSR| Multiplicative factor virtual images 1 (U)
DBCSR| Use multiplication densification T (D)
DBCSR| Multiplication size stacks 3 (U)
DBCSR| Use memory pool for CPU allocation F (U)
DBCSR| Number of 3D layers SINGLE (U)
DBCSR| Use MPI memory allocation F (U)
DBCSR| Use RMA algorithm F (U)
DBCSR| Use Communication thread T (U)
DBCSR| Communication thread load 87 (D)
DBCSR| MPI: My process id 0
DBCSR| MPI: Number of processes 1
DBCSR| OMP: Current number of threads 1
DBCSR| OMP: Max number of threads 1
DBCSR| Split modifier for TAS multiplication algorithm 1.0E+00 (U)
**** **** ****** ** PROGRAM STARTED AT 2026-06-22 18:05:18.760
***** ** *** *** ** PROGRAM STARTED ON priya-dey
** **** ****** PROGRAM STARTED BY priya-dey
***** ** ** ** ** PROGRAM PROCESS ID 88936
**** ** ******* ** PROGRAM STARTED IN /home/priya-dey/Project-ML/bt3
CP2K| version string: CP2K version 2024.3
CP2K| source code revision number: git:6712648
CP2K| cp2kflags: omp libint fftw3 libxc libgrpp pexsi elpa parallel
scalapack m
CP2K| pi_f08 cosma quip deepmd xsmm plumed2 spglib sirius libvori li
CP2K| ibbqb libtorch libvdwxc hdf5
CP2K| is freely available from https://www.cp2k.org/
CP2K| Program compiled at Tue Apr 7 01:57:03 AM JST 2026
CP2K| Program compiled on priya-dey
CP2K| Program compiled for local
CP2K| Data directory path /home/priya-dey/cp2k/data
CP2K| Input file name tobi.inp
------------------------------
- ___ *
- / \ *
- [ABORT] *
- ___/ CPASSERT failed *
- | *
- O/| *
- /| | *
- / \ force_env_types.F:730 *
------------------------------
===== Routine Calling Stack =====
1 CP2K
—
Reply to this email directly, view it on GitHub
<#5505?email_source=notifications&email_token=AQSPCWEVU6HAW6SN2PMY3WL5BDZRNA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZTHEYDCMBWUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussioncomment-17390106>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQSPCWHS4FFPW43NB23PLEL5BDZRNAVCNFSNUABIKJSXA33TNF2G64TZHMYTCNBQGA3DCOJTHNCGS43DOVZXG2LPNY5TCMBSGE3TAMZRUF3AE>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AQSPCWHEPDACOZ7R4HW6D7L5BDZRNA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZTHEYDCMBWUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/AQSPCWBAQNK7J6RA24WW73D5BDZRNA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZTHEYDCMBWUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Is it possible to perform an NVT simulation in CP2K for a hybrid metallic–organic system, where a DeepMD potential is used for the inorganic component and a classical force field is applied to the organic component?
DeePMD-kit Version
DeePMD-kit v3.1.3
Backend and its version
TensorFlow 2.19.1
Python Version, CUDA Version, GCC Version, LAMMPS Version, etc
Python 3.12.13
CUDA toolkit (nvcc) 12.0.140
CUDA 12.8
CP2K 2024.3
Details
No response
Reproducible Example, Input Files, and Commands
No response
Further Information, Files, and Links
No response
Beta Was this translation helpful? Give feedback.
All reactions