Compose models for allegro-pol simulation#537
Draft
CompRhys wants to merge 2 commits intoextensible-extrasfrom
Draft
Compose models for allegro-pol simulation#537CompRhys wants to merge 2 commits intoextensible-extrasfrom
CompRhys wants to merge 2 commits intoextensible-extrasfrom
Conversation
orionarcher
approved these changes
Apr 8, 2026
Collaborator
orionarcher
left a comment
There was a problem hiding this comment.
Not sure I fully understand the purpose of UniformPolarizationModel or when it should be used, which probably betrays either my ignorance or the need for slightly more documentation. Implementation seems good aside from a few docs and interface suggestions.
torch_sim/models/polarization.py
Outdated
Comment on lines
+14
to
+19
| class _PolarizationState(Protocol): | ||
| n_systems: int | ||
| device: torch.device | ||
| dtype: torch.dtype | ||
| positions: torch.Tensor | ||
| system_idx: torch.Tensor |
Collaborator
There was a problem hiding this comment.
seems to be duplicative of BaseState? Can we just use BaseState as the type?
torch_sim/models/polarization.py
Outdated
| * ``forces``: ``e Z*·E`` | ||
| * ``stress``: zero tensor, so upstream stress is preserved unchanged | ||
|
|
||
| The model also emits ``total_polarization`` using TorchSim's blessed naming. |
Collaborator
There was a problem hiding this comment.
Interesting turn of phrase, could be a little clearer. Could also include a little more documentation on when this is appropriate to use.
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.
Adds SerialSumModel to allow for allegro-pol to make predictions and pass to subsequent model in single sum model.