(git:374b731)
Loading...
Searching...
No Matches
manybody_allegro.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \par History
10!> allegro implementation
11!> \author Gabriele Tocci
12! **************************************************************************************************
14
16 USE cell_types, ONLY: cell_type
24 USE kinds, ONLY: dp,&
25 int_8,&
26 sp
32 USE torch_api, ONLY: torch_dict_create,&
40 USE util, ONLY: sort
41#include "./base/base_uses.f90"
42
43 IMPLICIT NONE
44
45 PRIVATE
48 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'manybody_allegro'
49
50CONTAINS
51
52! **************************************************************************************************
53!> \brief ...
54!> \param nonbonded ...
55!> \param potparm ...
56!> \param glob_loc_list ...
57!> \param glob_cell_v ...
58!> \param glob_loc_list_a ...
59!> \param unique_list_a ...
60!> \param cell ...
61!> \par History
62!> Implementation of the allegro potential - [gtocci] 2023
63!> \author Gabriele Tocci - University of Zurich
64! **************************************************************************************************
65 SUBROUTINE setup_allegro_arrays(nonbonded, potparm, glob_loc_list, glob_cell_v, glob_loc_list_a, &
66 unique_list_a, cell)
67 TYPE(fist_neighbor_type), POINTER :: nonbonded
68 TYPE(pair_potential_pp_type), POINTER :: potparm
69 INTEGER, DIMENSION(:, :), POINTER :: glob_loc_list
70 REAL(kind=dp), DIMENSION(:, :), POINTER :: glob_cell_v
71 INTEGER, DIMENSION(:), POINTER :: glob_loc_list_a, unique_list_a
72 TYPE(cell_type), POINTER :: cell
73
74 CHARACTER(LEN=*), PARAMETER :: routinen = 'setup_allegro_arrays'
75
76 INTEGER :: handle, i, iend, igrp, ikind, ilist, &
77 ipair, istart, jkind, nkinds, nlocal, &
78 npairs, npairs_tot
79 INTEGER, ALLOCATABLE, DIMENSION(:) :: temp_unique_list_a, work_list, work_list2
80 INTEGER, DIMENSION(:, :), POINTER :: list
81 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: rwork_list
82 REAL(kind=dp), DIMENSION(3) :: cell_v, cvi
83 TYPE(neighbor_kind_pairs_type), POINTER :: neighbor_kind_pair
84 TYPE(pair_potential_single_type), POINTER :: pot
85
86 cpassert(.NOT. ASSOCIATED(glob_loc_list))
87 cpassert(.NOT. ASSOCIATED(glob_loc_list_a))
88 cpassert(.NOT. ASSOCIATED(unique_list_a))
89 cpassert(.NOT. ASSOCIATED(glob_cell_v))
90 CALL timeset(routinen, handle)
91 npairs_tot = 0
92 nkinds = SIZE(potparm%pot, 1)
93 DO ilist = 1, nonbonded%nlists
94 neighbor_kind_pair => nonbonded%neighbor_kind_pairs(ilist)
95 npairs = neighbor_kind_pair%npairs
96 IF (npairs == 0) cycle
97 kind_group_loop1: DO igrp = 1, neighbor_kind_pair%ngrp_kind
98 istart = neighbor_kind_pair%grp_kind_start(igrp)
99 iend = neighbor_kind_pair%grp_kind_end(igrp)
100 ikind = neighbor_kind_pair%ij_kind(1, igrp)
101 jkind = neighbor_kind_pair%ij_kind(2, igrp)
102 pot => potparm%pot(ikind, jkind)%pot
103 npairs = iend - istart + 1
104 IF (pot%no_mb) cycle
105 DO i = 1, SIZE(pot%type)
106 IF (pot%type(i) == allegro_type) npairs_tot = npairs_tot + npairs
107 END DO
108 END DO kind_group_loop1
109 END DO
110 ALLOCATE (work_list(npairs_tot))
111 ALLOCATE (work_list2(npairs_tot))
112 ALLOCATE (glob_loc_list(2, npairs_tot))
113 ALLOCATE (glob_cell_v(3, npairs_tot))
114 ! Fill arrays with data
115 npairs_tot = 0
116 DO ilist = 1, nonbonded%nlists
117 neighbor_kind_pair => nonbonded%neighbor_kind_pairs(ilist)
118 npairs = neighbor_kind_pair%npairs
119 IF (npairs == 0) cycle
120 kind_group_loop2: DO igrp = 1, neighbor_kind_pair%ngrp_kind
121 istart = neighbor_kind_pair%grp_kind_start(igrp)
122 iend = neighbor_kind_pair%grp_kind_end(igrp)
123 ikind = neighbor_kind_pair%ij_kind(1, igrp)
124 jkind = neighbor_kind_pair%ij_kind(2, igrp)
125 list => neighbor_kind_pair%list
126 cvi = neighbor_kind_pair%cell_vector
127 pot => potparm%pot(ikind, jkind)%pot
128 npairs = iend - istart + 1
129 IF (pot%no_mb) cycle
130 cell_v = matmul(cell%hmat, cvi)
131 DO i = 1, SIZE(pot%type)
132 ! ALLEGRO
133 IF (pot%type(i) == allegro_type) THEN
134 DO ipair = 1, npairs
135 glob_loc_list(:, npairs_tot + ipair) = list(:, istart - 1 + ipair)
136 glob_cell_v(1:3, npairs_tot + ipair) = cell_v(1:3)
137 END DO
138 npairs_tot = npairs_tot + npairs
139 END IF
140 END DO
141 END DO kind_group_loop2
142 END DO
143 ! Order the arrays w.r.t. the first index of glob_loc_list
144 CALL sort(glob_loc_list(1, :), npairs_tot, work_list)
145 DO ipair = 1, npairs_tot
146 work_list2(ipair) = glob_loc_list(2, work_list(ipair))
147 END DO
148 glob_loc_list(2, :) = work_list2
149 DEALLOCATE (work_list2)
150 ALLOCATE (rwork_list(3, npairs_tot))
151 DO ipair = 1, npairs_tot
152 rwork_list(:, ipair) = glob_cell_v(:, work_list(ipair))
153 END DO
154 glob_cell_v = rwork_list
155 DEALLOCATE (rwork_list)
156 DEALLOCATE (work_list)
157 ALLOCATE (glob_loc_list_a(npairs_tot))
158 glob_loc_list_a = glob_loc_list(1, :)
159 ALLOCATE (temp_unique_list_a(npairs_tot))
160 nlocal = 1
161 temp_unique_list_a(1) = glob_loc_list_a(1)
162 DO ipair = 2, npairs_tot
163 IF (glob_loc_list_a(ipair - 1) /= glob_loc_list_a(ipair)) THEN
164 nlocal = nlocal + 1
165 temp_unique_list_a(nlocal) = glob_loc_list_a(ipair)
166 END IF
167 END DO
168 ALLOCATE (unique_list_a(nlocal))
169 unique_list_a(:) = temp_unique_list_a(:nlocal)
170 DEALLOCATE (temp_unique_list_a)
171 CALL timestop(handle)
172 END SUBROUTINE setup_allegro_arrays
173
174! **************************************************************************************************
175!> \brief ...
176!> \param glob_loc_list ...
177!> \param glob_cell_v ...
178!> \param glob_loc_list_a ...
179!> \param unique_list_a ...
180!> \par History
181!> Implementation of the allegro potential - [gtocci] 2023
182!> \author Gabriele Tocci - University of Zurich
183! **************************************************************************************************
184 SUBROUTINE destroy_allegro_arrays(glob_loc_list, glob_cell_v, glob_loc_list_a, unique_list_a)
185 INTEGER, DIMENSION(:, :), POINTER :: glob_loc_list
186 REAL(kind=dp), DIMENSION(:, :), POINTER :: glob_cell_v
187 INTEGER, DIMENSION(:), POINTER :: glob_loc_list_a, unique_list_a
188
189 IF (ASSOCIATED(glob_loc_list)) THEN
190 DEALLOCATE (glob_loc_list)
191 END IF
192 IF (ASSOCIATED(glob_loc_list_a)) THEN
193 DEALLOCATE (glob_loc_list_a)
194 END IF
195 IF (ASSOCIATED(glob_cell_v)) THEN
196 DEALLOCATE (glob_cell_v)
197 END IF
198 IF (ASSOCIATED(unique_list_a)) THEN
199 DEALLOCATE (unique_list_a)
200 END IF
201
202 END SUBROUTINE destroy_allegro_arrays
203
204! **************************************************************************************************
205!> \brief ...
206!> \param nonbonded ...
207!> \param particle_set ...
208!> \param cell ...
209!> \param atomic_kind_set ...
210!> \param potparm ...
211!> \param allegro ...
212!> \param glob_loc_list_a ...
213!> \param r_last_update_pbc ...
214!> \param pot_allegro ...
215!> \param fist_nonbond_env ...
216!> \param unique_list_a ...
217!> \par History
218!> Implementation of the allegro potential - [gtocci] 2023
219!> \author Gabriele Tocci - University of Zurich
220! **************************************************************************************************
221 SUBROUTINE allegro_energy_store_force_virial(nonbonded, particle_set, cell, atomic_kind_set, &
222 potparm, allegro, glob_loc_list_a, r_last_update_pbc, &
223 pot_allegro, fist_nonbond_env, unique_list_a)
224
225 TYPE(fist_neighbor_type), POINTER :: nonbonded
226 TYPE(particle_type), POINTER :: particle_set(:)
227 TYPE(cell_type), POINTER :: cell
228 TYPE(atomic_kind_type), POINTER :: atomic_kind_set(:)
229 TYPE(pair_potential_pp_type), POINTER :: potparm
230 TYPE(allegro_pot_type), POINTER :: allegro
231 INTEGER, DIMENSION(:), POINTER :: glob_loc_list_a
232 TYPE(pos_type), DIMENSION(:), POINTER :: r_last_update_pbc
233 REAL(kind=dp) :: pot_allegro
234 TYPE(fist_nonbond_env_type), POINTER :: fist_nonbond_env
235 INTEGER, DIMENSION(:), POINTER :: unique_list_a
236
237 CHARACTER(LEN=*), PARAMETER :: routinen = 'allegro_energy_store_force_virial'
238
239 INTEGER :: atom_a, atom_b, handle, i, iat, iat_use, iend, ifirst, igrp, ikind, ilast, ilist, &
240 ipair, istart, iunique, jkind, junique, mpair, n_atoms, n_atoms_use, nedges, nloc_size, &
241 npairs, nunique
242 INTEGER(kind=int_8), ALLOCATABLE :: atom_types(:), temp_atom_types(:)
243 INTEGER(kind=int_8), ALLOCATABLE, DIMENSION(:, :) :: edge_index, t_edge_index, temp_edge_index
244 INTEGER, ALLOCATABLE, DIMENSION(:) :: work_list
245 INTEGER, DIMENSION(:, :), POINTER :: list, sort_list
246 LOGICAL, ALLOCATABLE :: use_atom(:)
247 REAL(kind=dp) :: drij, lattice(3, 3), rab2_max, rij(3)
248 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: edge_cell_shifts, new_edge_cell_shifts, &
249 pos
250 REAL(kind=dp), DIMENSION(3) :: cell_v, cvi
251 REAL(kind=dp), DIMENSION(:, :), POINTER :: atomic_energy, forces
252 REAL(kind=sp) :: lattice_sp(3, 3)
253 REAL(kind=sp), ALLOCATABLE, DIMENSION(:, :) :: new_edge_cell_shifts_sp, pos_sp
254 REAL(kind=sp), DIMENSION(:, :), POINTER :: atomic_energy_sp, forces_sp
255 TYPE(allegro_data_type), POINTER :: allegro_data
256 TYPE(neighbor_kind_pairs_type), POINTER :: neighbor_kind_pair
257 TYPE(pair_potential_single_type), POINTER :: pot
258 TYPE(torch_dict_type) :: inputs, outputs
259
260 CALL timeset(routinen, handle)
261
262 NULLIFY (atomic_energy, forces, atomic_energy_sp, forces_sp)
263 n_atoms = SIZE(particle_set)
264 ALLOCATE (use_atom(n_atoms))
265 use_atom = .false.
266
267 DO ikind = 1, SIZE(atomic_kind_set)
268 DO jkind = 1, SIZE(atomic_kind_set)
269 pot => potparm%pot(ikind, jkind)%pot
270 DO i = 1, SIZE(pot%type)
271 IF (pot%type(i) /= allegro_type) cycle
272 DO iat = 1, n_atoms
273 IF (particle_set(iat)%atomic_kind%kind_number == ikind .OR. &
274 particle_set(iat)%atomic_kind%kind_number == jkind) use_atom(iat) = .true.
275 END DO ! iat
276 END DO ! i
277 END DO ! jkind
278 END DO ! ikind
279 n_atoms_use = count(use_atom)
280
281 ! get allegro_data to save force, virial info and to load model
282 CALL fist_nonbond_env_get(fist_nonbond_env, allegro_data=allegro_data)
283 IF (.NOT. ASSOCIATED(allegro_data)) THEN
284 ALLOCATE (allegro_data)
285 CALL fist_nonbond_env_set(fist_nonbond_env, allegro_data=allegro_data)
286 NULLIFY (allegro_data%use_indices, allegro_data%force)
287 CALL torch_model_load(allegro_data%model, pot%set(1)%allegro%allegro_file_name)
288 CALL torch_model_freeze(allegro_data%model)
289 END IF
290 IF (ASSOCIATED(allegro_data%force)) THEN
291 IF (SIZE(allegro_data%force, 2) /= n_atoms_use) THEN
292 DEALLOCATE (allegro_data%force, allegro_data%use_indices)
293 END IF
294 END IF
295 IF (.NOT. ASSOCIATED(allegro_data%force)) THEN
296 ALLOCATE (allegro_data%force(3, n_atoms_use))
297 ALLOCATE (allegro_data%use_indices(n_atoms_use))
298 END IF
299
300 iat_use = 0
301 DO iat = 1, n_atoms_use
302 IF (use_atom(iat)) THEN
303 iat_use = iat_use + 1
304 allegro_data%use_indices(iat_use) = iat
305 END IF
306 END DO
307
308 nedges = 0
309
310 ALLOCATE (edge_index(2, SIZE(glob_loc_list_a)))
311 ALLOCATE (edge_cell_shifts(3, SIZE(glob_loc_list_a)))
312 ALLOCATE (temp_atom_types(SIZE(glob_loc_list_a)))
313
314 DO ilist = 1, nonbonded%nlists
315 neighbor_kind_pair => nonbonded%neighbor_kind_pairs(ilist)
316 npairs = neighbor_kind_pair%npairs
317 IF (npairs == 0) cycle
318 kind_group_loop_allegro: DO igrp = 1, neighbor_kind_pair%ngrp_kind
319 istart = neighbor_kind_pair%grp_kind_start(igrp)
320 iend = neighbor_kind_pair%grp_kind_end(igrp)
321 ikind = neighbor_kind_pair%ij_kind(1, igrp)
322 jkind = neighbor_kind_pair%ij_kind(2, igrp)
323 list => neighbor_kind_pair%list
324 cvi = neighbor_kind_pair%cell_vector
325 pot => potparm%pot(ikind, jkind)%pot
326 DO i = 1, SIZE(pot%type)
327 IF (pot%type(i) /= allegro_type) cycle
328 rab2_max = pot%set(i)%allegro%rcutsq
329 cell_v = matmul(cell%hmat, cvi)
330 pot => potparm%pot(ikind, jkind)%pot
331 allegro => pot%set(i)%allegro
332 npairs = iend - istart + 1
333 IF (npairs /= 0) THEN
334 ALLOCATE (sort_list(2, npairs), work_list(npairs))
335 sort_list = list(:, istart:iend)
336 ! Sort the list of neighbors, this increases the efficiency for single
337 ! potential contributions
338 CALL sort(sort_list(1, :), npairs, work_list)
339 DO ipair = 1, npairs
340 work_list(ipair) = sort_list(2, work_list(ipair))
341 END DO
342 sort_list(2, :) = work_list
343 ! find number of unique elements of array index 1
344 nunique = 1
345 DO ipair = 1, npairs - 1
346 IF (sort_list(1, ipair + 1) /= sort_list(1, ipair)) nunique = nunique + 1
347 END DO
348 ipair = 1
349 junique = sort_list(1, ipair)
350 ifirst = 1
351 DO iunique = 1, nunique
352 atom_a = junique
353 IF (glob_loc_list_a(ifirst) > atom_a) cycle
354 DO mpair = ifirst, SIZE(glob_loc_list_a)
355 IF (glob_loc_list_a(mpair) == atom_a) EXIT
356 END DO
357 ifirst = mpair
358 DO mpair = ifirst, SIZE(glob_loc_list_a)
359 IF (glob_loc_list_a(mpair) /= atom_a) EXIT
360 END DO
361 ilast = mpair - 1
362 nloc_size = 0
363 IF (ifirst /= 0) nloc_size = ilast - ifirst + 1
364 DO WHILE (ipair <= npairs)
365 IF (sort_list(1, ipair) /= junique) EXIT
366 atom_b = sort_list(2, ipair)
367 rij(:) = r_last_update_pbc(atom_b)%r(:) - r_last_update_pbc(atom_a)%r(:) + cell_v
368 drij = dot_product(rij, rij)
369 ipair = ipair + 1
370 IF (drij <= rab2_max) THEN
371 nedges = nedges + 1
372 edge_index(:, nedges) = [atom_a - 1, atom_b - 1]
373 edge_cell_shifts(:, nedges) = cvi
374 END IF
375 END DO
376 ifirst = ilast + 1
377 IF (ipair <= npairs) junique = sort_list(1, ipair)
378 END DO
379 DEALLOCATE (sort_list, work_list)
380 END IF
381 END DO
382 END DO kind_group_loop_allegro
383 END DO
384
385 allegro => pot%set(1)%allegro
386
387 ALLOCATE (temp_edge_index(2, nedges))
388 temp_edge_index(:, :) = edge_index(:, :nedges)
389 ALLOCATE (new_edge_cell_shifts(3, nedges))
390 new_edge_cell_shifts(:, :) = edge_cell_shifts(:, :nedges)
391 DEALLOCATE (edge_cell_shifts)
392
393 ALLOCATE (t_edge_index(nedges, 2))
394
395 t_edge_index(:, :) = transpose(temp_edge_index)
396 DEALLOCATE (temp_edge_index, edge_index)
397
398 lattice = cell%hmat/pot%set(1)%allegro%unit_cell_val
399 lattice_sp = real(lattice, kind=sp)
400
401 iat_use = 0
402 ALLOCATE (pos(3, n_atoms_use), atom_types(n_atoms_use))
403
404 DO iat = 1, n_atoms_use
405 IF (.NOT. use_atom(iat)) cycle
406 iat_use = iat_use + 1
407 atom_types(iat_use) = particle_set(iat)%atomic_kind%kind_number - 1
408 pos(:, iat) = r_last_update_pbc(iat)%r(:)/allegro%unit_coords_val
409 END DO
410
411 CALL torch_dict_create(inputs)
412
413 IF (allegro%do_allegro_sp) THEN
414 ALLOCATE (new_edge_cell_shifts_sp(3, nedges), pos_sp(3, n_atoms_use))
415 new_edge_cell_shifts_sp(:, :) = real(new_edge_cell_shifts(:, :), kind=sp)
416 pos_sp(:, :) = real(pos(:, :), kind=sp)
417 DEALLOCATE (pos, new_edge_cell_shifts)
418 CALL torch_dict_insert(inputs, "pos", pos_sp)
419 CALL torch_dict_insert(inputs, "edge_cell_shift", new_edge_cell_shifts_sp)
420 CALL torch_dict_insert(inputs, "cell", lattice_sp)
421 ELSE
422 CALL torch_dict_insert(inputs, "pos", pos)
423 CALL torch_dict_insert(inputs, "edge_cell_shift", new_edge_cell_shifts)
424 CALL torch_dict_insert(inputs, "cell", lattice)
425 END IF
426
427 CALL torch_dict_insert(inputs, "edge_index", t_edge_index)
428 CALL torch_dict_insert(inputs, "atom_types", atom_types)
429 CALL torch_dict_create(outputs)
430 CALL torch_model_eval(allegro_data%model, inputs, outputs)
431
432 pot_allegro = 0.0_dp
433
434 IF (allegro%do_allegro_sp) THEN
435 CALL torch_dict_get(outputs, "atomic_energy", atomic_energy_sp)
436 CALL torch_dict_get(outputs, "forces", forces_sp)
437 allegro_data%force(:, :) = real(forces_sp(:, :), kind=dp)*allegro%unit_forces_val
438 DO iat_use = 1, SIZE(unique_list_a)
439 i = unique_list_a(iat_use)
440 pot_allegro = pot_allegro + real(atomic_energy_sp(1, i), kind=dp)*allegro%unit_energy_val
441 END DO
442 DEALLOCATE (forces_sp, atomic_energy_sp, new_edge_cell_shifts_sp, pos_sp)
443 ELSE
444 CALL torch_dict_get(outputs, "atomic_energy", atomic_energy)
445 CALL torch_dict_get(outputs, "forces", forces)
446 allegro_data%force(:, :) = forces(:, :)*allegro%unit_forces_val
447 DO iat_use = 1, SIZE(unique_list_a)
448 i = unique_list_a(iat_use)
449 pot_allegro = pot_allegro + atomic_energy(1, i)*allegro%unit_energy_val
450 END DO
451 DEALLOCATE (forces, atomic_energy, pos, new_edge_cell_shifts)
452 END IF
453
454 CALL torch_dict_release(inputs)
455 CALL torch_dict_release(outputs)
456
457 DEALLOCATE (t_edge_index, atom_types)
458
459 CALL timestop(handle)
461
462! **************************************************************************************************
463!> \brief ...
464!> \param fist_nonbond_env ...
465!> \param f_nonbond ...
466!> \param pv_nonbond ...
467!> \param use_virial ...
468! **************************************************************************************************
469 SUBROUTINE allegro_add_force_virial(fist_nonbond_env, f_nonbond, pv_nonbond, use_virial)
470
471 TYPE(fist_nonbond_env_type), POINTER :: fist_nonbond_env
472 REAL(kind=dp), DIMENSION(:, :), INTENT(INOUT) :: f_nonbond, pv_nonbond
473 LOGICAL, INTENT(IN) :: use_virial
474
475 INTEGER :: iat, iat_use
476 REAL(kind=dp), DIMENSION(3, 3) :: virial
477 TYPE(allegro_data_type), POINTER :: allegro_data
478
479 CALL fist_nonbond_env_get(fist_nonbond_env, allegro_data=allegro_data)
480
481 IF (use_virial) THEN
482 virial = 0.0_dp
483 pv_nonbond = pv_nonbond + virial
484 cpabort("Stress tensor for Allegro not yet implemented")
485 END IF
486
487 DO iat_use = 1, SIZE(allegro_data%use_indices)
488 iat = allegro_data%use_indices(iat_use)
489 cpassert(iat >= 1 .AND. iat <= SIZE(f_nonbond, 2))
490 f_nonbond(1:3, iat) = f_nonbond(1:3, iat) + allegro_data%force(1:3, iat_use)
491 END DO
492
493 END SUBROUTINE allegro_add_force_virial
494END MODULE manybody_allegro
495
Define the atom type and its sub types.
Definition atom_types.F:15
Define the atomic kind types and their sub types.
Handles all functions related to the CELL.
Definition cell_types.F:15
Define the neighbor list data types and the corresponding functionality.
subroutine, public fist_nonbond_env_get(fist_nonbond_env, potparm14, potparm, nonbonded, rlist_cut, rlist_lowsq, aup, lup, ei_scale14, vdw_scale14, shift_cutoff, do_electrostatics, r_last_update, r_last_update_pbc, rshell_last_update_pbc, rcore_last_update_pbc, cell_last_update, num_update, last_update, counter, natom_types, long_range_correction, ij_kind_full_fac, eam_data, quip_data, nequip_data, allegro_data, deepmd_data, charges)
sets a fist_nonbond_env
subroutine, public fist_nonbond_env_set(fist_nonbond_env, potparm14, potparm, rlist_cut, rlist_lowsq, nonbonded, aup, lup, ei_scale14, vdw_scale14, shift_cutoff, do_electrostatics, r_last_update, r_last_update_pbc, rshell_last_update_pbc, rcore_last_update_pbc, cell_last_update, num_update, last_update, counter, natom_types, long_range_correction, eam_data, quip_data, nequip_data, allegro_data, deepmd_data, charges)
sets a fist_nonbond_env
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public int_8
Definition kinds.F:54
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public sp
Definition kinds.F:33
An array-based list which grows on demand. When the internal array is full, a new array of twice the ...
Definition list.F:24
subroutine, public setup_allegro_arrays(nonbonded, potparm, glob_loc_list, glob_cell_v, glob_loc_list_a, unique_list_a, cell)
...
subroutine, public allegro_add_force_virial(fist_nonbond_env, f_nonbond, pv_nonbond, use_virial)
...
subroutine, public destroy_allegro_arrays(glob_loc_list, glob_cell_v, glob_loc_list_a, unique_list_a)
...
subroutine, public allegro_energy_store_force_virial(nonbonded, particle_set, cell, atomic_kind_set, potparm, allegro, glob_loc_list_a, r_last_update_pbc, pot_allegro, fist_nonbond_env, unique_list_a)
...
integer, parameter, public allegro_type
Define the data structure for the particle information.
subroutine, public torch_dict_release(dict)
Releases a Torch dictionary and all its ressources.
Definition torch_api.F:920
subroutine, public torch_model_load(model, filename)
Loads a Torch model from given "*.pth" file. (In Torch lingo models are called modules)
Definition torch_api.F:944
subroutine, public torch_dict_create(dict)
Creates an empty Torch dictionary.
Definition torch_api.F:896
subroutine, public torch_model_eval(model, inputs, outputs)
Evaluates the given Torch model. (In Torch lingo this operation is called forward())
Definition torch_api.F:971
subroutine, public torch_model_freeze(model)
Freeze the given Torch model: applies generic optimization that speed up model. See https://pytorch....
Definition torch_api.F:1127
All kind of helpful little routines.
Definition util.F:14
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
Definition cell_types.F:55