lmmolecule

lmmolecule is a native molecular dynamics host for LMScript built on OpenMM 8.2.0, supporting crystal lattices, rigid water models, Lepton custom potentials, and thermodynamic analysis.

Quick reference

Install lmctl and run any published molecular dynamics script directly, or declare cli="lmmolecule" in an LMScript _lmcode_ block.

npm install -g @lmctl-ai/lmctl
lmctl https://raw.githubusercontent.com/lmctl-ai/lmmolecule/main/examples/morse_dimer.lms
Object or methodSignaturePurpose
md.system() -> SystemCreate a new molecular dynamics system builder
md.platform / md.threads(name: string) -> Md / (n: int) -> MdSelect reference or cpu platform and set CPU thread count
System.fcc / rocksalt / gaslattice and gas builders -> SystemGenerate FCC crystals, NaCl rock-salt lattices, or non-overlapping gases
System.water / water_box("tip3p"|"spce", ...) -> SystemPlace rigid constrained TIP3P or SPC/E water molecules
System.bond / angle / torsion / constrainbonded terms -> SystemAdd harmonic bonds, angles, periodic dihedrals, and SHAKE/SETTLE constraints
System.lj / charge / coulombnonbonded terms -> SystemConfigure Lennard-Jones 12-6 and Coulomb electrostatics (none, cutoff, ewald, pme)
System.custom_external / custom_bond / custom_nonbondedLepton expressions -> SystemCompile custom analytical potentials with OpenMM Lepton
System.sim(integrator, dt, temp_K, friction, seed) -> SimCreate a Verlet or Langevin simulation context
Sim.minimize / velocities / stepsimulation control -> SimRun L-BFGS energy minimization, seed velocities, and advance time steps
Sim.report / xyz / rdf / msdobservables and filesWrite thermodynamic CSVs, XYZ trajectories, g(r) histograms, and compute MSD

Minimize and equilibrate an FCC argon crystal in LMScript:

p = _lmcode_ cli="lmmolecule" install="github:lmctl-ai/lmmolecule@latest";
let sys = md.system().fcc(3, 0.54, 39.948).lj(0.996, 0.3405, 0.78);
let sim = sys.sim("langevin", 0.002, 120.0, 5.0, 42);
sim.minimize(0.001, 200).velocities(120.0, 42).step(500);
md.print("T = " + str(sim.temperature()));
end _lmcode_
r = run_lmcode(p);
require(r.ok, "simulation failed");

Documentation pages

Source repository and releases