6.1.7. qmhub_at26.patch summary and AT23 comparison#
6.1.7.1. Sources reviewed#
AmberTools 26 patch:
qmhub/patches/qmhub_at26.patchAmberTools 23 reference patch:
qmhub/patches/qmhub_at23.patch
6.1.7.2. High-level summary#
qmhub_at26.patch ports the QMHub Sander external-QM interface to AmberTools 26. It adds a new qm2_extern_qmhub_module.F90, wires that module into the Sander build, registers qmhub as an EXTERN backend, and exchanges QM atoms, MM point charges, unit-cell data, QM/MM energy, and QM/MM gradients with the qmhub command. The interface supports text (comm=0), binary (comm=1), and FIFO (comm=2) exchange modes through a new &qmhub namelist.
The AT26 version also contains compatibility refinements beyond the AT23 patch: QMHub-specific behavior is gated behind detection of both qm_theory='EXTERN' and an &qmhub namelist, legacy non-QMHub EXTERN charge behavior is preserved, QM/link RESP charge storage is extended, and a TorchANI charge-slicing adjustment is added for the AT26 source layout.
6.1.7.3. Patch footprint#
Patch |
Files touched |
Added lines |
Removed lines |
|---|---|---|---|
|
11 |
791 |
70 |
|
8 |
746 |
68 |
6.1.7.4. Key changes#
Name |
Main files |
What changes |
|---|---|---|
Sander build integration |
|
Adds |
QMHub EXTERN registration |
|
Imports |
QMHub communication module |
|
Adds the core Sander-side QMHub driver. It reads |
Unit-cell exchange |
|
Passes |
QMHub EXTERN detection and gating |
|
Adds |
QMHub no-cutoff periodic pair list |
|
For QMHub EXTERN periodic QM/MM cases where the QM cutoff sphere exceeds all box dimensions, builds a no-cutoff list containing all non-link MM atoms instead of distance-filtering by |
Separate legacy EXTERN and QMHub RESP charges |
|
Keeps the legacy EXTERN charge array separate from QMHub RESP charges, passes |
QMHub-only charge adjustment |
|
Applies the QM/link charge correction added by the AT23 patch only when the QMHub EXTERN path is active, so other EXTERN backends keep their AT26-native charge handling. |
AT26 compatibility fixes |
|
Slices |
6.1.7.5. Notable differences from qmhub_at23.patch#
More files are touched in AT26. AT26 adds changes to
qmmm_nml_module.F90,qm2_read_nm_and_alloc.F90,qmmm_struct_module.F90, andqm2_extern_torchani_module.F90; AT23 does not touch these files.QMHub behavior is explicitly gated in AT26. AT23 applies the no-cutoff periodic pair-list behavior and QM/link charge redistribution broadly once the patched logic is reached. AT26 introduces
qmmm_nml%qmhub_externso those behaviors activate only forEXTERNcalculations with an&qmhubnamelist.Charge plumbing is more conservative in AT26. AT23 routes EXTERN calls through
qmmm_struct%qm_resp_charges; AT26 passes bothscf_mchgfor legacy EXTERN backends andqmmm_struct%qm_resp_chargesfor QMHub, avoiding unintended changes to other external engines.Link-atom RESP storage is extended in AT26. AT26 updates
qmmm_struct_module.F90soqm_resp_chargescan hold QM atoms plus link atoms (nquant+nlink). This supports the QMHub link-charge additions made inqm_zero_charges.F90.Unit-cell text/binary orientation differs. AT23 writes
ucell(:,i)forcomm=0andcomm=1; AT26 writesucell(i,:). FIFO mode writes row slices in both patches. Current QMHub readers load the exchange matrix as a 3x3 array, so the AT26 row-wise output preserves Amber’sucellmatrix orientation for those readers.FIFO startup is hardened in AT26. AT23 creates only the input FIFO before launching QMHub. AT26 creates both input and output FIFO paths up front to avoid a first-step race where Sander writes before QMHub creates the output FIFO.
The AT23
sander.F90message-format tweak is not carried into AT26. AT26’s QMHub patch does not touchAmberTools/src/sander/sander.F90.AT26 preserves newer AmberTools behavior. The patch accounts for AT26’s existing TorchANI/ANI external-QM code and avoids broad changes that would affect other EXTERN backends.
6.1.7.6. Changed files in qmhub_at26.patch#
File |
Purpose |
|---|---|
|
Adds QMHub module to Sander CMake source lists. |
|
Adds QMHub object to traditional Makefile object lists. |
|
Adds dependencies and compile rule for |
|
Registers and dispatches the QMHub EXTERN backend. |
|
New QMHub Sander interface implementation. |
|
Restricts TorchANI RESP-charge copy to real QM atoms. |
|
Passes unit-cell/charge data into EXTERN and adds QMHub-gated no-cutoff pair-list logic. |
|
Adds and broadcasts/prints |
|
Detects the |
|
Adds QMHub link-charge storage and QMHub-only charge redistribution. |
|
Allocates |
6.1.7.7. Usage implication#
For AmberTools 26, this patch expects QMHub runs to use qm_theory='EXTERN' in &qmmm together with an &qmhub namelist. The presence of &qmhub selects the QMHub-specific path; other EXTERN backends should continue using the AT26-native charge and cutoff behavior.