Custom forces integrators

From lza6/Armor-piercing-system-prompts · View interactive version

Custom forces integrators is an AI agent skill from the GitHub repository lza6/Armor-piercing-system-prompts. Implement and debug OpenMM custom expression forces, CustomIntegrator algorithms, force groups, runtime parameters, tabulated functions, and serialization-aware custom systems.

How to use this skill

Skill file

Custom Forces and Integrators

Use this sub-skill when the task involves OpenMM Custom*Force classes, CustomIntegrator, force groups, global/per-element parameter updates, tabulated functions, expression parsing, or smoke-testing a hand-built custom System.

Route Tasks

Core Workflow

  1. Choose the narrowest Custom*Force class that matches the interaction geometry, then write the expression in OpenMM algebra syntax with class-specific variables.
  2. Add all global, per-particle, per-bond, per-angle, per-torsion, donor/acceptor, group, or computed parameters before adding interaction records.
  3. Ensure every required element count matches the System before creating a Context; for CustomNonbondedForce, add one particle parameter record for every system particle.
  4. Prefer Context.setParameter() for frequently tuned globals; use set*Parameters() plus updateParametersInContext() for changed per-element values; reserve Context.reinitialize() for topology/count/force-definition changes.
  5. Assign force groups deliberately when querying energy pieces, excluding query-only forces from integration, or implementing MTS/custom algorithms.
  6. Validate on the Reference platform with explicit positions, finite energy/force assertions, and XML serialization round trips when systems must be portable.

Boundaries

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.