Low dimensional benchmark#355
Merged
ElliottKasoar merged 19 commits intoddmms:mainfrom May 1, 2026
Merged
Conversation
joehart2001
reviewed
Apr 15, 2026
joehart2001
reviewed
Apr 15, 2026
Collaborator
|
Thanks for the PR @JonathanSchmidt1 ! some comments:
Convergence:
|
Initial implementation of benchmark for 2D crystal structures from Alexandria database. Uses cell mask to constrain relaxation to in-plane directions only. Metrics: - Area MAE (Ų/atom): In-plane area per atom vs PBE reference - Energy MAE (eV/atom): Energy per atom vs PBE reference - Convergence (%): Percentage of structures that converged Data source: alexandria_2d_001.json.bz2 from Alexandria database Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add generic download_data() and load_structures() functions for both 2D/1D - Add get_length_per_atom() for 1D chain length calculation - Add relax_low_dimensional() with dimensionality parameter for cell masks - Add 1D metrics: Length MAE, Energy MAE, Convergence - Add 1D parity plots for length and energy - Parametrize test function for both 2D and 1D dimensionalities - Update app with 1D plot configurations Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document the new low-dimensional relaxation benchmark including: - Summary of 2D and 1D structure relaxation - Metrics: Area/Length MAE, Energy MAE, and Convergence for both 2D and 1D - Description of cell masks for constrained relaxation - Data availability from Alexandria database Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add set_vacuum_padding() function that sets lattice constants to 100 Å in non-periodic directions while preserving vector directions: - 2D: sets c vector to 100 Å - 1D: sets b and c vectors to 100 Å Apply vacuum padding before relaxation in test function. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add symmetrize_structure() using spglib.standardize_cell() - Remove FixSymmetry constraint (doesn't work for low-d relaxations) - Apply symmetrization before vacuum padding and relaxation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update DEFAULT_DATA_FILES to use lists (2 files for 2D, 1 for 1D) - Add download_all_data() to download multiple files - Update load_structures() to pool entries from all files before sampling Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace 10 near-identical per-dimensionality fixtures with: - DIM_CONFIGS dict mapping dimensionality to column/label/unit - _compute_mae() and _compute_convergence() helpers - _generate_all_plots() looping over DIM_CONFIGS - Single parity_plots fixture and loop-based metrics fixture Reduces 465 lines to 353 lines with no duplication. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace custom symmetrize_structure implementation with ase.spacegroup.symmetrize.refine_symmetry. Drop spglib import. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove symmetrize_structure(), call refine_symmetry() directly - Add test_get_area_per_atom and test_get_length_per_atom unit tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Parallels the high-pressure PR#340 review fixes. Drops
calc_kwargs={"default_dtype": "float64"} in favour of setting
model.default_dtype = "float64" before model.get_calculator(),
matching the pattern in calcs/surfaces/SBH17/calc_SBH17.py. Adds
@pytest.mark.very_slow so the benchmark is skipped by default and
only runs with --run-very-slow.
Mirrors the high-pressure benchmark's density-plot → structure
viewer flow in the low-dimensional benchmark.
calc: writes per-structure xyz files into
outputs/{model}/{dim}/{mat_id}.xyz with atoms.info populated for
ref/pred energy and geometric metric, instead of the concatenated
relaxed_{dim}.xyz. Matches the pattern used by high-pressure.
analyse: rebuilds get_converged_data to read per-structure xyz and
copy them into app data; adds a _build_density_plot_for_condition
helper that writes the plot JSON alongside sampled-structure
trajectories via write_density_trajectories. Outlier handling for
the convergence rate mirrors high-pressure (xyz-based subtraction
of energy outliers from the converged count).
app: adds collect_traj_assets + struct_from_scatter registrations
per plot, and a struct-placeholder Div so clicking a point on any
of the four density plots opens the underlying structure.
7af3ea5 to
70d2de6
Compare
Collaborator
|
@JonathanSchmidt1 opinions on convergence visualisation? we could also create an issue to add it in later as well. Otherwise i think we are close to merging @ElliottKasoar |
…chmark # Conflicts: # docs/source/user_guide/benchmarks/bulk_crystal.rst
- Fix max-force convergence check: max(..., key=abs) returned the signed value, so a force of -5.0 satisfies < fmax. Use np.abs().max() instead. - Move downloaded Alexandria data to ~/.cache/ml_peg/low_dimensional_relaxation to match the project-wide BENCHMARK_DATA_DIR convention used by the S3 download helpers.
Clicking the "Convergence (2D)" or "Convergence (1D)" cell in the benchmark table now displays a violin plot of the final max |F| component per structure, with a dashed line at the fmax threshold. Clicking a violin sample renders the corresponding relaxed structure (converged or not), so failure modes are visible directly. Calc: relax_low_dimensional now returns the final max force and the relaxed atoms even when the relaxation does not converge; the test loop stores both in atoms.info and writes xyz files for converged and unconverged frames alike. Analysis: a new fixture pair (force_violin_2d/_1d) builds one violin figure per (model, dim) into figure_force_violin_*.json and mirrors the xyz files into per-model dirs in violin-point order. Density-scatter fixtures now skip atoms.info["converged"] == False so unconverged frames are not pulled into the parity scatters. App: VIOLIN_CONFIGS adds the violin layer to the cell-to-plot map and wires struct_from_scatter (mode="struct") for click-to-structure.
…dimensional_relaxation.py
ElliottKasoar
previously approved these changes
May 1, 2026
joehart2001
previously approved these changes
May 1, 2026
Co-authored-by: Elliott Kasoar <45317199+ElliottKasoar@users.noreply.github.com>
joehart2001
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Pre-review checklist for PR author
PR author must check the checkboxes below when creating the PR.
Summary
Adds relaxation of two-dimensional and one-dimensional crystal structures benchmarking energies and areas/lengths.
Linked issue
Resolves #354
Progress
Testing
mace-mpa-0New decorators/callbacks
No