Skip to content

feat: use NPT sims for water + solvent benchmarks#140

Draft
mcarobene-id wants to merge 2 commits into
developfrom
feat/npt-sims-solvent
Draft

feat: use NPT sims for water + solvent benchmarks#140
mcarobene-id wants to merge 2 commits into
developfrom
feat/npt-sims-solvent

Conversation

@mcarobene-id

@mcarobene-id mcarobene-id commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Title

Description

This PR updates the SolventRadialDistributionBenchmark to use the NPT ensemble rather than NVT, as an NPT integrator was recently added to mlip v2.

Checklist for adding a new benchmark

  • Benchmark class is fully implemented, including
    all abstract method implementations.
  • Benchmark is fully tested following our standard
    testing pattern.
  • Input data uploaded to HF is validated and correct.
  • The corresponding documentation is added and up to date.
  • The UI code is added and up-to-date and has been tested.
  • Our license has been added to any Python file.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Marco Carobene seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@mcarobene-id mcarobene-id changed the base branch from main to develop June 16, 2026 08:34
@mcarobene-id mcarobene-id changed the title feat: WIP npt sims for solvents feat: use NPT sims for water + solvent benchmarks Jun 17, 2026
@mcarobene-id mcarobene-id force-pushed the feat/npt-sims-solvent branch from 4613eab to cd6e92e Compare June 17, 2026 07:48
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/mlipaudit
   __init__.py20100% 
   benchmark.py77790%146, 165, 231, 237–238, 248, 262
   exceptions.py20100% 
   io.py1002575%117, 121, 146–150, 152, 154, 171–172, 174–175, 192–193, 195, 213–221
   io_helpers.py520100% 
   run_mode.py50100% 
   scoring.py29775%101–102, 104, 107, 111–112, 114
src/mlipaudit/benchmarks
   __init__.py290100% 
src/mlipaudit/benchmarks/bond_length_distribution
   bond_length_distribution.py95396%208, 211, 276
src/mlipaudit/benchmarks/conformer_selection
   conformer_selection.py132596%249, 252, 295, 300, 340
src/mlipaudit/benchmarks/dihedral_scan
   dihedral_scan.py116595%222, 225, 259, 262, 304
src/mlipaudit/benchmarks/folding_stability
   folding_stability.py106496%212, 270, 275, 339
   helpers.py350100% 
src/mlipaudit/benchmarks/noncovalent_interactions
   noncovalent_interactions.py1681094%245, 248, 272, 283, 407, 424, 441, 525–527
src/mlipaudit/benchmarks/nudged_elastic_band
   engine.py1269425%62, 81–82, 84–89, 91, 93, 95–96, 98–99, 101–103, 112–113, 115–116, 120–121, 123, 130, 132, 134–136, 138–139, 141, 143–145, 147–151, 153, 159–163, 165–167, 169–171, 173–175, 177–180, 182, 185, 189–190, 192, 194–195, 197, 201–202, 205–210, 212–213, 229, 234, 236–238, 240, 242–243, 246–247, 253, 256–257, 261–262, 267
   nudged_elastic_band.py121695%290–291, 298, 310, 316, 323
src/mlipaudit/benchmarks/reactivity
   reactivity.py117397%239–240, 272
src/mlipaudit/benchmarks/reference_geometry_stability
   reference_geometry_stability.py122397%233, 305, 328
src/mlipaudit/benchmarks/ring_planarity
   ring_planarity.py99693%229, 232, 264, 267–268, 287
src/mlipaudit/benchmarks/sampling
   helpers.py64493%46, 67, 97, 129
   sampling.py2251095%303, 344, 385, 388–390, 440, 707, 825–826
src/mlipaudit/benchmarks/scaling
   scaling.py1033466%128–130, 138–139, 141–144, 154–156, 193–198, 201–203, 209–210, 212–213, 215–216, 219–220, 222, 243, 252, 271, 284
src/mlipaudit/benchmarks/solvent_radial_distribution
   solvent_radial_distribution.py126893%210–211, 213, 252, 257–258, 331, 354
src/mlipaudit/benchmarks/stability
   stability.py1501888%166, 169, 201–202, 205–206, 208, 210, 213, 215, 431–432, 442, 478, 487, 522, 537, 548
src/mlipaudit/benchmarks/tautomers
   tautomers.py92594%182, 208, 211–212, 231
src/mlipaudit/benchmarks/water_radial_distribution
   water_radial_distribution.py119298%199, 289
src/mlipaudit/ui
   __init__.py160100% 
   bond_length_distribution.py581181%89–90, 95–96, 141–142, 147, 150, 176, 188, 192
   conformer_selection.py100793%133–134, 139–140, 195, 320, 324
   dihedral_scan.py1151289%141–142, 147–148, 259–260, 302, 313, 353, 355, 365, 369
   folding_stability.py96792%44, 226–227, 232–233, 406, 410
   leaderboard.py801087%67, 74, 78, 85, 287–289, 291, 293, 303
   noncovalent_interactions.py152994%205–206, 211–212, 392, 397, 432, 454, 458
   nudged_elastic_band.py553929%42–46, 50–51, 53, 66, 68, 75, 82, 89–90, 93, 97–99, 101, 103–105, 107–109, 111–113, 115, 117, 119, 121–122, 124, 135, 137, 149, 159, 163
   page_wrapper.py14285%36, 46
   reactivity.py59689%96–97, 102–103, 173, 177
   reference_geometry_stability.py66986%62, 131–132, 137–138, 199, 226, 236, 240
   ring_planarity.py56983%71–72, 77–78, 123–124, 160, 170, 174
   sampling.py87989%85, 129–130, 135–136, 166, 234, 265, 269
   scaling.py52688%135–136, 147–148, 162, 166
   solvent_radial_distribution.py832075%118–119, 124–125, 151, 157, 163–167, 169–170, 176, 179, 191, 198, 200, 212, 216
   stability.py601083%106–107, 112–113, 134–135, 138, 148, 177, 181
   tautomers.py62690%82–83, 88–89, 194, 198
   utils.py1061982%69, 73–74, 130, 192–195, 201, 251, 269–270, 273–274, 277, 287–289, 291
   water_radial_distribution.py98693%133–134, 139–140, 280, 284
src/mlipaudit/utils
   __init__.py40100% 
   inference.py27774%54–56, 65–66, 69, 72
   simulation.py55492%139, 177–179
   stability.py31583%61, 68, 92, 99, 103
   trajectory_helpers.py420100% 
   unallowed_elements.py100100% 
TOTAL399647288% 

Tests Skipped Failures Errors Time
128 0 💤 0 ❌ 0 🔥 12.556s ⏱️

@mcarobene-id mcarobene-id force-pushed the feat/npt-sims-solvent branch from cd6e92e to 1d0d319 Compare June 17, 2026 07:54
Comment on lines 22 to 23
equilibrated. For every specific atom pair (e.g., **oxygen-oxygen** in water) the radial distribution
function (**RDF** or **g(r)**) is calculated from the simulation.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Add details RE how the densities are computed and (below) what experimental values we compare to

@lwalew lwalew self-requested a review June 18, 2026 08:59
density_denominator = AVAGADROS_CONSTANT * volumes

densities = density_numerator / density_denominator
return densities

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: Duplicated code, consider moving this to a utils.py or another common file

}

# TODO: Check reference densities (g/cm3)
# These are the best I could find. All are at 20deg - should we change temperature?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: So this would be 2 deg less than what we have now? I don't see why not then? @lwehran?

MOLECULE_CONFIG = {
"CCl4": {"mw": 153.823, "atoms_per_molecule": 5},
"methanol": {"mw": 32.042, "atoms_per_molecule": 6},
"acetonitrile": {"mw": 41.053, "atoms_per_molecule": 6},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Sorry for my noobiness, what's mw? Maybe a more explicit name?

first_solvent_peak - REFERENCE_MAXIMA[system_name]["distance"]
)

# TODO: Include density_deviation in the score

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Probably want to use a similar scheme to how the peak_deviation is calculated. Then take mean of score of peak_deviation and density_deviation.

SimulationState(positions=positions, temperature=np.ones(10))
SimulationState(
positions=positions, temperature=np.ones(num_frames), cell=cells
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Maybe also worth adding a small sanity check on the new outputs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants