Skip to content
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

Sublattice rework #179

Merged
merged 11 commits into from
Mar 30, 2022
Merged

Sublattice rework #179

merged 11 commits into from
Mar 30, 2022

Conversation

qchempku2017
Copy link
Collaborator

@qchempku2017 qchempku2017 commented Mar 29, 2022

Summary

  • Removed InactiveSublattice class and its supports; replace it with attribute Sublattice.is_active.

  • Sub-lattice encoding will no longer be range(len(sublattice.species)), and it will be saved when serialized. This is to support the next sub-lattice splitting feature. The SemiGrandEnsemble and the FugacityBias classes are changed accordingly to read sublattice.encoding when building their tables, and SampleContainer.get_sublattice_composition is changed as well. In theory this new feature will allow us to assign arbitrary encoding to a sub-lattice, but you are not recommended to do that. Better always generate your sub-lattices from: 1, default initialization provided by Processors; 2, split a default sublattice as generated in method 1.

  • Added support to Sublattice splitting operation in both Sublattice class and Ensemble class, which will allow more delicate MC simulation such as topotactic de-lithiation, where the anions, the TMs, and Li/Vacs should be considered as different non-crossing sub-lattices.

Additional dependencies introduced (if any)

N/A

TODO (if any)

Checklist

…llow variable encoding; changed other modules accordingly; updated tests but not run yet.
…ance in test_tools/test_energies_above_hull to avoid occasional numerical fails.
@qchempku2017 qchempku2017 requested a review from lbluque March 29, 2022 01:49
qchempku2017 and others added 4 commits March 29, 2022 12:07
…ublattice-rework

� Conflicts:
�	smol/moca/ensemble/semigrand.py
�	smol/moca/processor/base.py
�	smol/moca/sampler/bias.py
�	smol/moca/sampler/container.py
�	smol/moca/sampler/mcusher.py
�	smol/moca/sublattice.py
�	tests/test_moca/test_bias.py
�	tests/test_moca/test_ensemble.py
�	tests/test_moca/test_mcushers.py
�	tests/test_moca/test_processor.py
�	tests/test_moca/test_sublattice.py
�	tests/utils.py
Copy link
Collaborator

@lbluque lbluque left a comment

Choose a reason for hiding this comment

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

Thank a lot @qchempku2017 ! This is very nice.

I just added a comment on input to split sublattices. Can you look that over and make final changes and then I'll merge?

smol/moca/sublattice.py Outdated Show resolved Hide resolved
smol/moca/ensemble/base.py Outdated Show resolved Hide resolved
smol/moca/ensemble/semigrand.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@lbluque lbluque left a comment

Choose a reason for hiding this comment

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

Thanks a lot @qchempku2017 this is some very useful functionality!

@lbluque lbluque merged commit eaa1db1 into CederGroupHub:master Mar 30, 2022
@qchempku2017 qchempku2017 deleted the sublattice-rework branch April 5, 2022 21:26
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.

2 participants