schrodinger.application.matsci.mlip.biaspotentials module¶
Bias potential terms for the MLIP nanoreactor MD engine.
Provides confinement walls, RMSD-based metadynamics, and diffusion acceleration bias potentials.
Copyright Schrodinger, LLC. All rights reserved.
- class schrodinger.application.matsci.mlip.biaspotentials.LogfermiWall(radius=10.0, k_wall=0.019, beta=6.0, center=None, eps=1e-12, scale_factor=1.0)¶
Bases:
objectLog-Fermi wall potential that confines atoms inside a sphere. Idea & default parameters from 10.1021/acs.jctc.9b00143
In Grimme’s paper the default beta is 10.0 Bohr^(-1) and k_wall is 0.019 Hartree, but xtb defaults to 6.0 Bohr^(-1) and that value is matched here. I would like to keep the input in the same unit for convenience and do the unit conversions inside the class
- __init__(radius=10.0, k_wall=0.019, beta=6.0, center=None, eps=1e-12, scale_factor=1.0)¶
- Parameters:
radius (float) – Spherical wall radius in Angstrom
k_wall (float) – Wall energy prefactor in Hartree
beta (float) – Wall steepness in Bohr^-1
center (torch.Tensor or None) – Wall center coordinates. Coordinates are in Angstrom. If None, the origin is used.
eps (float) – Small distance in Angstrom used to avoid division by zero
scale_factor (float) – Scale factor applied to radius
- class schrodinger.application.matsci.mlip.biaspotentials.RMSDCV(k_push=1.0, alpha_width=1.0, n_ref=10, init_refs=None, update_interval=1, fixed_atoms=None)¶
Bases:
objectRMSD-based bias (weighted, Kabsch-aligned). Reference structures are the initial structures of the MD task. Idea & default parameters from 10.1021/acs.jctc.9b00143
- Args:
k_push: per-reference weights # I believe in Grimme’s paper, it was designed to adjust the effect # from each reference, e.g. older reference has less effect on the bias. # However, in most cases, people just use a constant k_push. I will also # treat it as a constant for all references. alpha: scalar energy prefactor n_ref: number of stored references init_refs: optional list of (M,N,3) tensors to seed buffer (oldest to newest) update_interval: update the reference buffer every N steps
- Returns (__call__):
E_bias: (M,) per-molecule bias energy F_bias: (M,N,3) forces from this bias term (via autograd)
- __init__(k_push=1.0, alpha_width=1.0, n_ref=10, init_refs=None, update_interval=1, fixed_atoms=None)¶
- Parameters:
k_push (float) – Bias strength in Hartree
alpha_width (float) – Gaussian width in Bohr^-2
n_ref (int) – Maximum number of reference structures
init_refs (list) – Optional list of (M, N, 3) tensors to seed the reference buffer (oldest to newest)
update_interval (int) – Add new reference every N steps
fixed_atoms (torch.Tensor or None) – Zero-based indices of atoms to exclude from the unweighted RMSD calculation. All included atoms contribute equally, matching the source-paper formulation.
- resetBuffer()¶
Clear the reference structure buffer.
- pushReference(r_tensor)¶
Add a new reference structure to the buffer.
- Parameters:
r_tensor (torch.Tensor) – Positions of shape (M, N, 3) in Angstrom
- class schrodinger.application.matsci.mlip.biaspotentials.DiffusionAcceleration(k_expansion=0.5, k_contraction=0.5, r_expansion=2.0, r_contraction=5.0, t_expansion=10, t_contraction=10, eps=1e-12)¶
Bases:
objectDiffusion Acceleration bias potential that compress/expand the system at different time steps. Idea from 10.1021/acs.jctc.4c00826, the paper did not provide the default value of parameters. Instead they suggested to fine-tune the parameters for each system. For convenience of debugging, I put a set of default parameters here, but they should be fine-tuned for each system.
Note: # I compress to/expand from the center of the simulation box (0,0,0) # instead of the center of mass in the original paper. I simplify the # Heavside step function with t_c%T, and segment function with ReLU, the # logic is still the same.
- Units:
k_contraction, k_expansion: eV / (a.m.u. * Angstrom^2)
r_contraction, r_expansion: Angstrom
t_contraction, t_expansion: steps
- Returns:
E_bias: (M,) in eV F_bias: (M,N,3) in eV/Angstrom
- __init__(k_expansion=0.5, k_contraction=0.5, r_expansion=2.0, r_contraction=5.0, t_expansion=10, t_contraction=10, eps=1e-12)¶
- Parameters:
k_expansion (float) – Expansion force constant in eV/(amu*Ang^2)
k_contraction (float) – Contraction force constant in eV/(amu*Ang^2)
r_expansion (float) – Expansion cutoff radius in Angstrom
r_contraction (float) – Contraction cutoff radius in Angstrom
t_expansion (int) – Expansion phase length in steps
t_contraction (int) – Contraction phase length in steps
eps (float) – Small distance in Angstrom used to avoid division by zero