-
Notifications
You must be signed in to change notification settings - Fork 74
Feat/scale atoms when changing cell #344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feat/scale atoms when changing cell #344
Conversation
orionarcher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| def test_state_set_cell(ti_sim_state: SimState) -> None: | ||
| """Test the set_cell method of SimState.""" | ||
| new_cell = ( | ||
| torch.diag_embed( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe assign the torch.diag_embed to M so it's similar to the way we define the M matrix in the testcase below.
curtischong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
math looks good. I would've preferred an einsum instead but it's good.
|
Ready to merge @thomasloux? |
Summary
Inspired by ASE Atoms.set_cell, add set_cell method to change the cell and the atoms positions at the same time. Reproduce the same code in Torch.
Could also be used to apply constraint latter, for example an equivalent of FixSymmetry.
Checklist
Before a pull request can be merged, the following items must be checked: