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

Spin lmp #34

Open
wants to merge 199 commits into
base: lmp_base
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
d224fdd
fix: fix `DPH5Path.glob` for new keys (#4152)
njzjz Sep 21, 2024
f34cbe1
feat(pt/tf): support spin lammps plugin
iProzd Sep 21, 2024
532e309
fix(pt): make `state_dict` safe for `weights_only` (#4148)
iProzd Sep 21, 2024
6010c73
chore(pt): move `deepmd.pt.infer.deep_eval.eval_model` to tests (#4153)
njzjz Sep 21, 2024
d5b544b
update typo
iProzd Sep 21, 2024
dd331fd
update pt backend
iProzd Sep 22, 2024
31bafb1
rm extend from pair-deepmd
iProzd Sep 22, 2024
f5cfeab
fix(pt): fix `compute_output_stats_global` when `atomic_output` is `N…
njzjz Sep 23, 2024
0b72dae
feat(jax): support neural networks (#4156)
njzjz Sep 23, 2024
15150f6
fix tf interface for spin
hztttt Sep 23, 2024
bdfe205
fix interface for multi model
hztttt Sep 23, 2024
508759c
fix(pt ut): make separated uts deterministic (#4162)
iProzd Sep 25, 2024
0b3f860
fix(pt): finetuning property/dipole/polar/dos fitting with multi-dime…
Chengqian-Zhang Sep 25, 2024
ab48d90
Feat: output logs on freezing models (#4165)
caic99 Sep 27, 2024
be59313
support spin_norm & virtual_len in model graph and fix bug
hztttt Sep 25, 2024
94fe957
chore: change econf embed to spin representation (#4166)
wanghan-iapcm Sep 27, 2024
ad8bebe
[pre-commit.ci] pre-commit autoupdate (#4159)
pre-commit-ci[bot] Sep 27, 2024
ec7c16b
fix pt
iProzd Sep 28, 2024
6524e5e
Update pair_deepmd.cpp
iProzd Sep 28, 2024
a9ffccb
fix: unpin h5py on aarch64 (#4176)
njzjz Oct 2, 2024
7ce5b03
chore: bump LAMMPS to stable_29Aug2024_update1 (#4179)
njzjz Oct 2, 2024
192a97a
breaking: drop Python 3.8 support (#4185)
njzjz Oct 6, 2024
c90c4e1
fix(tf): set visible_device_list for TF C++ (#4172)
njzjz Oct 6, 2024
a0747b9
fix(tf): throw errors when loc_cellnum is 0 (#4180)
njzjz Oct 6, 2024
2feb21c
[pre-commit.ci] pre-commit autoupdate (#4173)
pre-commit-ci[bot] Oct 7, 2024
d667929
docs: add documentation for installation requirements of DPA-2 (#4178)
njzjz Oct 7, 2024
dcdd804
chore: use `functools.cached_property` for cached properties (#4187)
njzjz Oct 8, 2024
b807bb4
docs: document more for multiprocessing (#4190)
njzjz Oct 8, 2024
9a15bc0
[pre-commit.ci] pre-commit autoupdate (#4192)
pre-commit-ci[bot] Oct 8, 2024
3939786
feat(jax/array-api): dpa1 (#4160)
njzjz Oct 9, 2024
61f1681
Feat (pt): Expose Linear Ener Model (#4194)
anyangml Oct 11, 2024
2ca1c06
chore: cache `deserialized_module` and `script_module` (#4196)
njzjz Oct 11, 2024
8174cf1
chore(ci): skip more tests on GPU CI (#4200)
njzjz Oct 11, 2024
c10bc3c
chore(tf): filter TF deprecation warnings (#4199)
njzjz Oct 13, 2024
8279cca
feat(jax/array-api): energy fitting (#4204)
njzjz Oct 13, 2024
a1f8672
Chore: refactor get standard model (#4205)
anyangml Oct 14, 2024
2c66443
fix tensorflow bug
iProzd Oct 14, 2024
4f3d9d4
fix mag force bug
iProzd Oct 14, 2024
6fe8dde
ci: pin ubuntu to 22.04 (#4213)
njzjz Oct 15, 2024
48f8a1e
feat(pt): support `DeepEval.eval_descriptor` (#4214)
njzjz Oct 15, 2024
5c092e6
fix: fix average training time for restart (#4212)
njzjz Oct 15, 2024
16172e6
fix(pt): keep mapping not none during lmp steps when nghost == 0 (#4209)
CaRoLZhangxy Oct 15, 2024
d24d7e7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 15, 2024
593bf81
Update c_api.h
iProzd Oct 15, 2024
3466e34
Update c_api.h
iProzd Oct 15, 2024
cfb4731
feat(jax/array-api): se_e2_a (#4217)
njzjz Oct 16, 2024
5050f61
feat(jax/array-api): DOS fitting (#4218)
njzjz Oct 16, 2024
d7d2210
fix(pt): make PT training step idx consistent with TF (#4221)
njzjz Oct 16, 2024
af86b57
Chore(pt): refactor the command function interface (#4225)
iProzd Oct 16, 2024
2871fec
Chore(pt):rm old pt implementation (#4223)
iProzd Oct 17, 2024
1e1090a
chore(lmp): add LAMMPS DPA-2 nopbc tests (#4220)
njzjz Oct 17, 2024
cc4b23d
chore: move `LearningRateExp` to `deepmd.utils.learning_rate` (#4219)
njzjz Oct 17, 2024
c3a4f3e
extend sendlist nlist and other tensors but still bugs
CaRoLZhangxy Oct 18, 2024
e2e1e55
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 18, 2024
c2944eb
fix(pt): remove deprecating torch.norm (#4233)
wanghan-iapcm Oct 20, 2024
cf85275
revert `extend sendlist nlist`
iProzd Oct 21, 2024
1d6defe
fix spin communication in lammps
iProzd Oct 21, 2024
2a38025
Merge branch 'devel' into spin_lmp
iProzd Oct 21, 2024
e5c0ecf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2024
85c934b
Update spin_model.py
iProzd Oct 22, 2024
35fd1c6
Update spin.py
iProzd Oct 22, 2024
11aeb17
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 22, 2024
b4701da
[pre-commit.ci] pre-commit autoupdate (#4235)
pre-commit-ci[bot] Oct 22, 2024
6c5cb1d
add ut for spin c++
iProzd Oct 22, 2024
474a2b0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 22, 2024
114898f
bump version
iProzd Oct 22, 2024
c2515ed
feat(jax): energy model (no grad support) (#4226)
njzjz Oct 23, 2024
dccb0e5
docs: fix docs for CMAKE_ARGS (#4238)
njzjz Oct 23, 2024
911f41b
fix(pt): set `weights_only=True` for `torch.load` (#4147)
njzjz Oct 23, 2024
b8e57f2
docs: fix parameter links (#4239)
njzjz Oct 23, 2024
18026eb
fix(cc): fix message passing when nghost is 0 and send list is empty …
CaRoLZhangxy Oct 23, 2024
a74d963
feat(pt): support CPU parallel training with PT (#4224)
iProzd Oct 23, 2024
8e77785
ci: limit downloaded files in build_docker (#4242)
njzjz Oct 23, 2024
b78832d
fix(pt): make int `rcut` safe after jit op (#4222)
iProzd Oct 23, 2024
0fa1b43
style: enable TorchFix in pre-commit (#4230)
njzjz Oct 23, 2024
c2d0560
Chore(pt): slim uts for dpa1 (#4244)
iProzd Oct 23, 2024
0f817e1
style: extend no-explicit-dtype check to xp and jnp (#4247)
njzjz Oct 23, 2024
c870ccf
fix(np/pt): explicit dtype and device. (#4241)
wanghan-iapcm Oct 24, 2024
4d50048
feat(jax): checkpoint I/O (#4236)
njzjz Oct 24, 2024
02580c2
ci: bump TF to 2.18, PT to 2.5 (#4228)
njzjz Oct 24, 2024
a66afd3
ci: bump tensorflow/build image to 2.18 (#4252)
njzjz Oct 25, 2024
659f90d
feat(pt): support loss plugin for external package (#4248)
ChiahsinChu Oct 26, 2024
fa61d69
feat(jax/array-api): se_e2_r (#4257)
njzjz Oct 26, 2024
fef13f5
Merge branch 'devel' into spin_lmp
iProzd Oct 26, 2024
5394854
feat(pt): support `use_aparam_as_mask` for pt backend (#4246)
ChiahsinChu Oct 26, 2024
13e247e
fix(tf): fix compress suffix in DescrptDPA1Compat (#4243)
iProzd Oct 26, 2024
aba932c
ci: skip `test_data_equal` on the GPU machine (#4260)
njzjz Oct 28, 2024
39cddd4
feat(dev): setup devcontainer for developers (#4263)
njzjz Oct 28, 2024
04e1159
fix(pt): set device for PT C++ (#4261)
njzjz Oct 28, 2024
8f546cf
docs: fix word spellings (#4264)
njzjz Oct 28, 2024
40b3ea1
docs: document the floating-point precision of the model (#4240)
njzjz Oct 28, 2024
95f0ed5
fix(lmp): apply NEIGHMASK to neighbor list (#4269)
njzjz Oct 29, 2024
abd1c9c
docs: replace sphinx-rtd-theme with sphinx-book-theme (#4266)
njzjz-bot Oct 29, 2024
b647547
[pre-commit.ci] pre-commit autoupdate (#4268)
pre-commit-ci[bot] Oct 29, 2024
82aaa0d
feat(jax): neighbor stat (#4258)
njzjz Oct 29, 2024
dd36e6c
docs: document JAX backend (#4259)
njzjz Oct 29, 2024
159361d
feat(jax): force & virial (#4251)
njzjz Oct 29, 2024
d165fee
feat(jax): freeze to StableXLO & DeepEval (#4256)
njzjz Oct 30, 2024
d4c7d1a
Spin lmp nlist (#35)
hztttt Oct 31, 2024
3afc2fd
Merge branch 'devel' into spin_lmp
iProzd Oct 31, 2024
9e82b8d
add deepspin pair style (#36)
iProzd Oct 31, 2024
5a9a0a0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 31, 2024
605fb9b
Update pair_deepmd.cpp
iProzd Oct 31, 2024
2cc6d8a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 31, 2024
a0b7996
Update plugin
iProzd Oct 31, 2024
0cee887
fix(lmp): update print_summary (#4271)
njzjz Oct 31, 2024
737f7c8
feat(jax/array-api): hybrid descriptor (#4275)
njzjz Oct 31, 2024
8e27d2f
feat(jax/array-api): dipole/polarizability fitting (#4278)
njzjz Oct 31, 2024
cdad312
fix(dptest): Wrong dptest results except for energy head (#4280)
Chengqian-Zhang Oct 31, 2024
0d13911
Print the reminder for the illegal memory error in the AutoBatchSize …
Yi-FanLi Oct 31, 2024
9c767ad
feat(dpmodel/jax): add entry point for dpmodel and jax backend (#4284)
njzjz Oct 31, 2024
ff04d8b
fix(dpmodel/jax): fix fparam and aparam support in DeepEval (#4285)
njzjz Oct 31, 2024
704db2f
fix(lmp): add pair_deepmd_index arg to fix dplr for multiple deepmd p…
njzjz Nov 1, 2024
3dc6fff
fix spin
iProzd Nov 1, 2024
a468819
feat(jax/array-api): property fitting (#4287)
njzjz Nov 1, 2024
5c32147
Feat: Add consistency test for ZBL between dp and pt (#4292)
anyangml Nov 1, 2024
eb2832b
feat(jax/array-api): se_e3 (#4286)
njzjz Nov 1, 2024
36aee8d
Merge branch 'devel' into spin_lmp
iProzd Nov 1, 2024
8355947
Add 4 pt descriptor compression (#4227)
cherryWangY Nov 1, 2024
c3bf841
Update pair_base.cpp
iProzd Nov 1, 2024
5451acd
Update test_deeppot_tf_spin.cc
iProzd Nov 1, 2024
319493a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 1, 2024
b1e4a03
Update build_lammps.sh
iProzd Nov 1, 2024
6a75c6b
feat(jax/array-api): se_t_tebd (#4288)
njzjz Nov 2, 2024
e1c868e
feat(jax/array-api): se_atten_v2 (#4289)
njzjz Nov 2, 2024
fb41a4f
feat(jax): atomic virial (#4290)
njzjz Nov 2, 2024
f129cff
ci: install GPU JAX in GPU CI (#4293)
njzjz Nov 2, 2024
6bc730f
Enable Hybrid Descriptor to be compressed (#4297)
cherryWangY Nov 2, 2024
25bb821
feat(jax/array-api): DPA-2 (#4294)
njzjz Nov 2, 2024
bfbe2ed
Add compression API to BaseModel and AtomicModel (#4298)
cherryWangY Nov 2, 2024
7aaf284
feat(jax): zbl (#4301)
njzjz Nov 4, 2024
de6abef
reformat C/C++ interface
iProzd Nov 4, 2024
799b4e5
rm dead code
iProzd Nov 4, 2024
643e202
fix ut
iProzd Nov 4, 2024
fb4dfe0
add virtual methods
iProzd Nov 4, 2024
38815b3
feat(jax): export call_lower to SavedModel via jax2tf (#4254)
njzjz Nov 4, 2024
4b73fbe
[pre-commit.ci] pre-commit autoupdate (#4310)
pre-commit-ci[bot] Nov 5, 2024
9ed0397
fix(cmake): Replace deprecated `FetchContent_Populate` with `FetchCon…
njzjz Nov 5, 2024
dabedd2
fix(jax): calculate virial in `call_lower` (#4304)
njzjz Nov 5, 2024
d1fd284
fix memory leak
iProzd Nov 5, 2024
99e1e05
add virtual methods
iProzd Nov 5, 2024
ae98964
Update deepmd.hpp
iProzd Nov 5, 2024
3e7501e
rename compute_spin to compute
iProzd Nov 5, 2024
2c4ca0d
update nopbc test
iProzd Nov 5, 2024
914b1f9
fix(jax): fix several serialization and jit issues for DPA-2 (#4315)
njzjz Nov 6, 2024
65aac64
fix(lmp): add `pair_deepmd_index` key to `is_key` function in dplr (#…
njzjz Nov 6, 2024
430dfa9
fix: make sure `head` can be used in `DeepPot` (#4312)
wangzyphysics Nov 6, 2024
7eab6cc
fix lmp uts and rename pair base
iProzd Nov 6, 2024
0965a70
add old c api
iProzd Nov 6, 2024
af09efd
rename base to backend
iProzd Nov 6, 2024
a532c33
rename model filename in lammps tests
njzjz Nov 6, 2024
9699349
fix dplr: support initializing from a restart file (#4084)
Yi-FanLi Nov 7, 2024
919654e
add tf nlist nopbc UT for spin
iProzd Nov 7, 2024
c30091b
add tf lmp nopbc UT for spin
iProzd Nov 7, 2024
10b163e
fix torch lmp UT bug
hztttt Nov 7, 2024
811a0b9
Merge branch 'devel' into spin_lmp
iProzd Nov 7, 2024
0039aa4
fix nopbc spin test
iProzd Nov 7, 2024
ab15e47
Merge branch 'devel' into spin_lmp
iProzd Nov 7, 2024
e572e37
Update c_api.h
iProzd Nov 7, 2024
01e7745
Update test_deeppot_a.cc
iProzd Nov 7, 2024
3d1fce6
Update test_deeppot_a.cc
iProzd Nov 7, 2024
960f71a
fix error handle
iProzd Nov 7, 2024
4d71247
rm spin from pairdeepmd
iProzd Nov 7, 2024
41ad708
make pair modification readable
iProzd Nov 7, 2024
dc0f496
add #4269
iProzd Nov 7, 2024
8fd95f8
Update pair_deepmd.cpp
iProzd Nov 7, 2024
edb1e9f
Update DeepSpinTF.cc
iProzd Nov 7, 2024
5c9fda1
rm spin args from deeppottf
iProzd Nov 7, 2024
24896f0
rm black space
iProzd Nov 7, 2024
ba46f54
rm black space and comment
iProzd Nov 7, 2024
809b471
Update DeepPot.h
iProzd Nov 7, 2024
388bb22
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 7, 2024
d20d668
resolve conversations
iProzd Nov 7, 2024
e09bf5a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 7, 2024
5f53a46
update docs
iProzd Nov 7, 2024
223502d
Update deepmd.hpp
iProzd Nov 7, 2024
1215097
add uts
iProzd Nov 8, 2024
292a68f
Update test_deepspin_a_hpp.cc
iProzd Nov 8, 2024
665f001
update uts
iProzd Nov 8, 2024
58c15ed
Update test_deepspin_a.cc
iProzd Nov 8, 2024
b481274
Update test_deepspin_a.cc
iProzd Nov 8, 2024
29ace48
Update test_deepspin_a.cc
iProzd Nov 8, 2024
e68de42
Update test_deepspin_a.cc
iProzd Nov 8, 2024
cef5817
fix space
iProzd Nov 8, 2024
2085804
Create test_deepspin_a_hpp_tf.cc
iProzd Nov 8, 2024
b367f97
Update test_deepspin_a_hpp_tf.cc
iProzd Nov 8, 2024
b76e272
update ntypes_spin
iProzd Nov 9, 2024
68cfb94
Update test_deepspin_a_hpp_tf.cc
iProzd Nov 9, 2024
ea19b35
Update test_deepspin_a_hpp_tf.cc
iProzd Nov 9, 2024
43e8baf
Update test_deepspin_a_hpp_tf.cc
iProzd Nov 9, 2024
82eca9a
Update test_deepspin_a_hpp_tf.cc
iProzd Nov 9, 2024
7c69066
add uts
iProzd Nov 9, 2024
31d69db
Delete test_deepspin_model_devi_hpp.cc
iProzd Nov 9, 2024
8fb6498
Delete test_deepspin_a_hpp_tf.cc
iProzd Nov 9, 2024
4bc0e42
Create test_deepspin_model_devi_hpp.cc
iProzd Nov 10, 2024
1b7c79b
Update test_deepspin_model_devi_hpp.cc
iProzd Nov 10, 2024
bb8d38e
Update test_deepspin_model_devi_hpp.cc
iProzd Nov 10, 2024
e6bfebe
Update deepmd.hpp
iProzd Nov 10, 2024
117f4c9
add ut for lammps atomic energy
iProzd Nov 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions deepmd/pt/model/model/spin_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ def forward_common_lower(
fparam: Optional[torch.Tensor] = None,
aparam: Optional[torch.Tensor] = None,
do_atomic_virial: bool = False,
comm_dict: Optional[Dict[str, torch.Tensor]] = None,
extra_nlist_sort: bool = False,
):
nframes, nloc = nlist.shape[:2]
Expand All @@ -492,6 +493,7 @@ def forward_common_lower(
fparam=fparam,
aparam=aparam,
do_atomic_virial=do_atomic_virial,
comm_dict=comm_dict,
extra_nlist_sort=extra_nlist_sort,
)
model_output_type = self.backbone_model.model_output_type()
Expand Down Expand Up @@ -607,6 +609,7 @@ def forward_lower(
fparam: Optional[torch.Tensor] = None,
aparam: Optional[torch.Tensor] = None,
do_atomic_virial: bool = False,
comm_dict: Optional[Dict[str, torch.Tensor]] = None,
):
model_ret = self.forward_common_lower(
extended_coord,
Expand All @@ -617,6 +620,7 @@ def forward_lower(
fparam=fparam,
aparam=aparam,
do_atomic_virial=do_atomic_virial,
comm_dict=comm_dict,
extra_nlist_sort=self.backbone_model.need_sorted_nlist_for_lower(),
)
model_predict = {}
Expand Down
4 changes: 4 additions & 0 deletions deepmd/tf/entrypoints/freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ def _make_node_names(
"o_atom_energy",
"o_atom_virial",
"spin_attr/ntypes_spin",
"spin_attr/virtual_len",
"spin_attr/spin_norm",
"fitting_attr/dfparam",
"fitting_attr/daparam",
"fitting_attr/aparam_nall",
Expand Down Expand Up @@ -259,6 +261,8 @@ def freeze_graph(
"train_attr/min_nbor_dist",
"fitting_attr/aparam_nall",
"spin_attr/ntypes_spin",
"spin_attr/virtual_len",
"spin_attr/spin_norm"
]
different_set = set(output_node) - set(input_node)
if different_set:
Expand Down
223 changes: 182 additions & 41 deletions source/api_c/include/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,22 @@ extern void DP_DeepPotComputeNList(DP_DeepPot* dp,
double* atomic_energy,
double* atomic_virial);

extern void DP_DeepPotComputeNListSP(DP_DeepPot* dp,
const int natoms,
const double* coord,
const double* spin,
const int* atype,
const double* cell,
const int nghost,
const DP_Nlist* nlist,
const int ago,
double* energy,
double* force,
double* force_mag,
double* virial,
double* atomic_energy,
double* atomic_virial);

/**
* @brief Evaluate the energy, force and virial by using a DP with the neighbor
*list. (float version)
Expand Down Expand Up @@ -268,6 +284,22 @@ extern void DP_DeepPotComputeNListf(DP_DeepPot* dp,
float* atomic_energy,
float* atomic_virial);

extern void DP_DeepPotComputeNListfSP(DP_DeepPot* dp,
const int natoms,
const float* coord,
const float* spin,
const int* atype,
const float* cell,
const int nghost,
const DP_Nlist* nlist,
const int ago,
double* energy,
float* force,
float* force_mag,
float* virial,
float* atomic_energy,
float* atomic_virial);

/**
* @brief Evaluate the energy, force and virial by using a DP. (double version)
* @version 2
Expand Down Expand Up @@ -392,6 +424,25 @@ extern void DP_DeepPotComputeNList2(DP_DeepPot* dp,
double* atomic_energy,
double* atomic_virial);

extern void DP_DeepPotComputeNList2SP(DP_DeepPot* dp,
const int nframes,
const int natoms,
const double* coord,
const double* spin,
const int* atype,
const double* cell,
const int nghost,
const DP_Nlist* nlist,
const int ago,
const double* fparam,
const double* aparam,
double* energy,
double* force,
double* force_mag,
double* virial,
double* atomic_energy,
double* atomic_virial);

/**
* @brief Evaluate the energy, force and virial by using a DP with the neighbor
*list. (float version)
Expand Down Expand Up @@ -438,45 +489,64 @@ extern void DP_DeepPotComputeNListf2(DP_DeepPot* dp,
float* atomic_energy,
float* atomic_virial);

/**
* @brief Evaluate the energy, force and virial by using a DP with the mixed
*type. (double version)
* @param[in] dp The DP to use.
* @param[in] nframes The number of frames.
* @param[in] natoms The number of atoms.
* @param[in] coord The coordinates of atoms. The array should be of size natoms
*x 3.
* @param[in] atype The atom types. The array should contain nframes x natoms
*ints.
* @param[in] box The cell of the region. The array should be of size 9. Pass
*NULL if pbc is not used.
* @param[in] fparam The frame parameters. The array can be of size nframes x
*dim_fparam.
* @param[in] aparam The atom parameters. The array can be of size nframes x
*dim_aparam.
* @param[out] energy Output energy.
* @param[out] force Output force. The array should be of size natoms x 3.
* @param[out] virial Output virial. The array should be of size 9.
* @param[out] atomic_energy Output atomic energy. The array should be of size
*natoms.
* @param[out] atomic_virial Output atomic virial. The array should be of size
*natoms x 9.
* @warning The output arrays should be allocated before calling this function.
*Pass NULL if not required.
**/
extern void DP_DeepPotComputeMixedType(DP_DeepPot* dp,
extern void DP_DeepPotComputeNListf2SP(DP_DeepPot* dp,
const int nframes,
const int natoms,
const double* coord,
const float* coord,
const float* spin,
const int* atype,
const double* cell,
const double* fparam,
const double* aparam,
const float* cell,
const int nghost,
const DP_Nlist* nlist,
const int ago,
const float* fparam,
const float* aparam,
double* energy,
double* force,
double* virial,
double* atomic_energy,
double* atomic_virial);
float* force,
float* force_mag,
float* virial,
float* atomic_energy,
float* atomic_virial);

/**
* @brief Evaluate the energy, force and virial by using a DP with the mixed
*type. (double version)
* @param[in] dp The DP to use.
* @param[in] nframes The number of frames.
* @param[in] natoms The number of atoms.
* @param[in] coord The coordinates of atoms. The array should be of size
*natoms x 3.
* @param[in] atype The atom types. The array should contain nframes x
*natoms ints.
* @param[in] box The cell of the region. The array should be of size 9.
*Pass NULL if pbc is not used.
* @param[in] fparam The frame parameters. The array can be of size nframes
*x dim_fparam.
* @param[in] aparam The atom parameters. The array can be of size nframes x
*dim_aparam.
* @param[out] energy Output energy.
* @param[out] force Output force. The array should be of size natoms x 3.
* @param[out] virial Output virial. The array should be of size 9.
* @param[out] atomic_energy Output atomic energy. The array should be of
*size natoms.
* @param[out] atomic_virial Output atomic virial. The array should be of
*size natoms x 9.
* @warning The output arrays should be allocated before calling this
*function. Pass NULL if not required.
**/
extern void DP_DeepPotComputeMixedType(DP_DeepPot* dp,
const int nframes,
const int natoms,
const double* coord,
const int* atype,
const double* cell,
const double* fparam,
const double* aparam,
double* energy,
double* force,
double* virial,
double* atomic_energy,
double* atomic_virial);
/**
* @brief Evaluate the energy, force and virial by using a DP with the mixed
*type. (float version)
Expand Down Expand Up @@ -734,6 +804,22 @@ extern void DP_DeepPotModelDeviComputeNList(DP_DeepPotModelDevi* dp,
double* atomic_energy,
double* atomic_virial);

extern void DP_DeepPotModelDeviComputeNListSP(DP_DeepPotModelDevi* dp,
const int natoms,
const double* coord,
const double* spin,
const int* atype,
const double* cell,
const int nghost,
const DP_Nlist* nlist,
const int ago,
double* energy,
double* force,
double* force_mag,
double* virial,
double* atomic_energy,
double* atomic_virial);

/**
* @brief Evaluate the energy, force and virial by using a DP model deviation
*with neighbor list. (float version)
Expand Down Expand Up @@ -771,6 +857,22 @@ extern void DP_DeepPotModelDeviComputeNListf(DP_DeepPotModelDevi* dp,
float* atomic_energy,
float* atomic_virial);

extern void DP_DeepPotModelDeviComputeNListfSP(DP_DeepPotModelDevi* dp,
const int natoms,
const float* coord,
const float* spin,
const int* atype,
const float* cell,
const int nghost,
const DP_Nlist* nlist,
const int ago,
double* energy,
float* force,
float* force_mag,
float* virial,
float* atomic_energy,
float* atomic_virial);

/**
* @brief Evaluate the energy, force and virial by using a DP model deviation
*with neighbor list. (double version)
Expand Down Expand Up @@ -816,6 +918,26 @@ void DP_DeepPotModelDeviComputeNList2(DP_DeepPotModelDevi* dp,
double* virial,
double* atomic_energy,
double* atomic_virial);

void DP_DeepPotModelDeviComputeNList2SP(DP_DeepPotModelDevi* dp,
const int nframes,
const int natoms,
const double* coord,
const double* spin,
const int* atype,
const double* cell,
const int nghost,
const DP_Nlist* nlist,
const int ago,
const double* fparam,
const double* aparam,
double* energy,
double* force,
double* force_mag,
double* virial,
double* atomic_energy,
double* atomic_virial);

/**
* @brief Evaluate the energy, force and virial by using a DP model deviation
*with neighbor list. (float version)
Expand Down Expand Up @@ -862,12 +984,31 @@ void DP_DeepPotModelDeviComputeNListf2(DP_DeepPotModelDevi* dp,
float* atomic_energy,
float* atomic_virial);

/**
* @brief Get the type map of a DP model deviation.
* @param[in] dp The DP model deviation to use.
* @return The cutoff radius.
*/
double DP_DeepPotModelDeviGetCutoff(DP_DeepPotModelDevi* dp);
void DP_DeepPotModelDeviComputeNListf2SP(DP_DeepPotModelDevi* dp,
const int nframes,
const int natoms,
const float* coord,
const float* spin,
const int* atype,
const float* cell,
const int nghost,
const DP_Nlist* nlist,
const int ago,
const float* fparam,
const float* aparam,
double* energy,
float* force,
float* force_mag,
float* virial,
float* atomic_energy,
float* atomic_virial);

/**
* @brief Get the type map of a DP model deviation.
* @param[in] dp The DP model deviation to use.
* @return The cutoff radius.
*/
double DP_DeepPotModelDeviGetCutoff(DP_DeepPotModelDevi* dp);

/**
* @brief Get the number of types of a DP model deviation.
Expand Down
Loading
Loading