Skip to content

Add SymmetrizedModel - #119

Draft
ppegolo wants to merge 15 commits into
mainfrom
token_rotations
Draft

Add SymmetrizedModel#119
ppegolo wants to merge 15 commits into
mainfrom
token_rotations

Conversation

@ppegolo

@ppegolo ppegolo commented Nov 18, 2025

Copy link
Copy Markdown
Contributor

Add SymmetrizedModel wrapper to compute O(3) average and metrics for metatomic models.

Contributor (creator of pull-request) checklist

  • Tests updated (for new features and bugfixes)?
  • Documentation updated (for new features)?
  • [ ] Issue referenced (for PRs that solve an issue)?

Reviewer checklist

  • CHANGELOG updated with public API or any other important changes?

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

@ppegolo

ppegolo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

There are a few remaining issues on if and how should this model be integrated into the SymmetrizedCalculator. In particular there are some inconsistencies on how the grid lambda is chosen. The choice made in the model are exact, while I think the calculator at this stage is only exact when you compute the mean (not the variance)

ppegolo and others added 15 commits July 15, 2026 17:40
Make routing, improper parity, pole recovery, dtype/device handling, and all ten documented component axes explicit and tested.

Construct real Wigner matrices directly and lazily, batch-validate internally generated random transformations, and enforce canonical Cartesian and spherical bases even for empty blocks. These changes preserve already-correct cases while removing repeated packing and per-matrix synchronization.
Preserve complete output schemas, reject gradients that would otherwise be lost, support raw and exported models plus selected atoms, and define conservative derivatives consistently with metatrain. Detached energies warn and return zeros; 3D stress is limited to finite-volume full PBC.

Use reference-centered float64 moments, actual returned ranks, batched geometry transforms, trusted quadrature operations, and bounded reusable Wigner storage. Build CUDA Wigner batches on CPU and transfer completed stacks to avoid per-rotation synchronization. The public guide states the finite-grid, unit, derivative, memory, and convergence contracts.
Rotate every supported requested polar-vector input and reject unsupported axial-vector inversion. Propagate requested TensorMaps, watch requested ASE state for cache invalidation, and retain only closed space-group actions that preserve model inputs.

Stream centered rotational moments by batch, skip scalar no-op group discovery, preserve caller-selected periodic images and translation-distinct permutations, and accelerate large periodic site matching with conservative indexed candidates plus exact bounded fallback. Stress follows the same full-PBC finite-volume contract as SymmetrizedModel.
):
super().__init__()
self.base_model = base_model
self._base_is_atomistic = is_atomistic_model(base_model)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you can get the inner module of an AtomisticModel and then simplify this to always use the inner module

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