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 method | Signature | Purpose |
|---|---|---|
| md.system | () -> System | Create a new molecular dynamics system builder |
| md.platform / md.threads | (name: string) -> Md / (n: int) -> Md | Select reference or cpu platform and set CPU thread count |
| System.fcc / rocksalt / gas | lattice and gas builders -> System | Generate FCC crystals, NaCl rock-salt lattices, or non-overlapping gases |
| System.water / water_box | ("tip3p"|"spce", ...) -> System | Place rigid constrained TIP3P or SPC/E water molecules |
| System.bond / angle / torsion / constrain | bonded terms -> System | Add harmonic bonds, angles, periodic dihedrals, and SHAKE/SETTLE constraints |
| System.lj / charge / coulomb | nonbonded terms -> System | Configure Lennard-Jones 12-6 and Coulomb electrostatics (none, cutoff, ewald, pme) |
| System.custom_external / custom_bond / custom_nonbonded | Lepton expressions -> System | Compile custom analytical potentials with OpenMM Lepton |
| System.sim | (integrator, dt, temp_K, friction, seed) -> Sim | Create a Verlet or Langevin simulation context |
| Sim.minimize / velocities / step | simulation control -> Sim | Run L-BFGS energy minimization, seed velocities, and advance time steps |
| Sim.report / xyz / rdf / msd | observables and files | Write 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");