-
Notifications
You must be signed in to change notification settings - Fork 584
Support DPSpin for AtomicModel #3301
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #3301 +/- ##
==========================================
+ Coverage 76.97% 77.04% +0.06%
==========================================
Files 423 394 -29
Lines 35950 31948 -4002
Branches 1620 909 -711
==========================================
- Hits 27674 24613 -3061
+ Misses 7408 6807 -601
+ Partials 868 528 -340 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Duo <50307526+iProzd@users.noreply.github.com>
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.
- UT for all the spin implementations.
env_protectionshould be added to dpmodel- UT for
env_protection. - the implementation of the dpmodel is not consistent with the pt side.
| pref_e = self.limit_pref_e + (self.start_pref_e - self.limit_pref_e) * coef | ||
| pref_fr = self.limit_pref_fr + (self.start_pref_fr - self.limit_pref_fr) * coef | ||
| pref_fm = self.limit_pref_fm + (self.start_pref_fm - self.limit_pref_fm) * coef | ||
| pref_v = self.limit_pref_v + (self.start_pref_v - self.limit_pref_v) * coef |
Check notice
Code scanning / CodeQL
Unused local variable
wanghan-iapcm
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.
I see
Signed-off-by: Duo <50307526+iProzd@users.noreply.github.com>
for more information, see https://pre-commit.ci
|
|
||
| class SpinTest(unittest.TestCase): | ||
| def setUp(self): | ||
| type_map_1 = ["H", "O"] |
Check notice
Code scanning / CodeQL
Unused local variable
| self.use_spin_1 = [False, False] | ||
| self.virtual_scale_1 = [0.1, 0.1] | ||
|
|
||
| type_map_2 = ["B", "Ni", "O"] |
Check notice
Code scanning / CodeQL
Unused local variable
| self.use_spin_2 = [False, True, False] | ||
| self.virtual_scale_2 = [0.1, 0.1, 0.1] | ||
|
|
||
| type_map_3 = ["H", "O", "B", "Ni", "O"] |
Check notice
Code scanning / CodeQL
Unused local variable
|
LGTM |
This PR support DPSpin for AtomicModel:
Spinbase class to handle spin-related information.SpinModelimplementation in pt, which can generally take any backbone model, with input and output process for output likeenergy,dipoleand etc.SpinEnergyModelimplementation inherited fromSpinModelforenergycalclulation.Input improvement, now DPSpin model can take real
spinas input withvitual_scale, which can support much more flexible input. (Also with dataset support forspininput.)EnergySpinLossclass to processenergy,force_real,force_mag,virial.Add
protectionfor environment calculations.TODO:
forward_lowerforSpinModel.data_statwith generalexclude_typesfor descriptors and fittings.SpinModelmodels.Will fix in next PRs: