41#include "./base/base_uses.f90"
49 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'manybody_nequip'
51 TYPE,
PRIVATE :: nequip_work_type
52 INTEGER :: target_pot_type
53 INTEGER :: n_atoms_use
56 TYPE(cell_type),
POINTER :: cell => null()
57 TYPE(pos_type),
DIMENSION(:),
POINTER :: r_pbc => null()
58 TYPE(distribution_1d_type),
POINTER :: local_particles => null()
59 TYPE(particle_type),
POINTER :: particle_set(:) => null()
60 TYPE(mp_para_env_type),
POINTER :: para_env => null()
62 LOGICAL,
ALLOCATABLE :: use_atom(:)
63 INTEGER(kind=int_8),
ALLOCATABLE :: local_edges(:, :)
64 REAL(kind=
dp),
ALLOCATABLE :: local_shifts(:, :)
65 INTEGER(kind=int_8),
ALLOCATABLE :: final_edges(:, :)
66 REAL(kind=
dp),
ALLOCATABLE :: final_shifts(:, :)
67 INTEGER,
DIMENSION(:),
ALLOCATABLE :: kind_mapper
68 LOGICAL,
ALLOCATABLE :: sum_energy(:)
69 END TYPE nequip_work_type
93 atomic_kind_set, potparm, r_last_update_pbc, &
94 pot_total, fist_nonbond_env, para_env, use_virial, &
103 TYPE(
pos_type),
DIMENSION(:),
POINTER :: r_last_update_pbc
104 REAL(kind=
dp) :: pot_total
107 LOGICAL,
INTENT(IN) :: use_virial
108 INTEGER,
INTENT(IN) :: target_pot_type
110 CHARACTER(LEN=*),
PARAMETER :: routinen =
'nequip_energy_store_force_virial'
115 TYPE(nequip_work_type) :: nequip_work
118 CALL timeset(routinen, handle)
120 CALL nequip_work_create(nequip_work, atomic_kind_set, particle_set, local_particles, cell, &
121 r_last_update_pbc, para_env, potparm, target_pot_type, use_virial, &
124 IF (.NOT.
ASSOCIATED(neq_pot))
THEN
125 CALL timestop(handle)
129 CALL build_local_edges_shifts(nonbonded, potparm, nequip_work)
131 CALL build_torch_edge_indexes(nequip_work)
133 CALL setup_neq_data(fist_nonbond_env, neq_data, neq_pot, nequip_work)
135 IF (nequip_work%target_pot_type ==
nequip_type)
THEN
136 CALL prepare_edges_shifts_nequip(nequip_work)
138 CALL prepare_edges_shifts_allegro(nequip_work)
141 CALL run_torch_model(neq_data, neq_pot, nequip_work, outputs)
143 CALL process_outputs(outputs, neq_data, neq_pot, pot_total, nequip_work)
146 CALL release_nequip_work(nequip_work)
148 CALL timestop(handle)
166 SUBROUTINE nequip_work_create(nequip_work, atomic_kind_set, particle_set, local_particles, cell, &
167 r_pbc, para_env, potparm, target_pot_type, use_virial, neq_pot)
168 TYPE(nequip_work_type),
INTENT(OUT) :: nequip_work
173 TYPE(
pos_type),
DIMENSION(:),
POINTER :: r_pbc
176 INTEGER,
INTENT(IN) :: target_pot_type
177 LOGICAL,
INTENT(IN) :: use_virial
180 nequip_work%target_pot_type = target_pot_type
181 nequip_work%use_virial = use_virial
182 nequip_work%cell => cell
183 nequip_work%r_pbc => r_pbc
184 nequip_work%particle_set => particle_set
185 nequip_work%para_env => para_env
186 nequip_work%local_particles => local_particles
188 CALL get_potential_config(atomic_kind_set, potparm, target_pot_type, neq_pot)
190 IF (.NOT.
ASSOCIATED(neq_pot))
THEN
194 CALL build_kind_mapper(atomic_kind_set, neq_pot, nequip_work)
196 CALL init_atom_masks(nequip_work)
198 END SUBROUTINE nequip_work_create
205 SUBROUTINE release_nequip_work(nequip_work)
206 TYPE(nequip_work_type),
INTENT(INOUT) :: nequip_work
208 IF (
ALLOCATED(nequip_work%final_edges))
DEALLOCATE (nequip_work%final_edges)
209 IF (
ALLOCATED(nequip_work%final_shifts))
DEALLOCATE (nequip_work%final_shifts)
210 IF (
ALLOCATED(nequip_work%local_edges))
DEALLOCATE (nequip_work%local_edges)
211 IF (
ALLOCATED(nequip_work%local_shifts))
DEALLOCATE (nequip_work%local_shifts)
212 IF (
ALLOCATED(nequip_work%use_atom))
DEALLOCATE (nequip_work%use_atom)
213 IF (
ALLOCATED(nequip_work%kind_mapper))
DEALLOCATE (nequip_work%kind_mapper)
214 IF (
ALLOCATED(nequip_work%sum_energy))
DEALLOCATE (nequip_work%sum_energy)
215 NULLIFY (nequip_work%cell, nequip_work%r_pbc, nequip_work%particle_set, nequip_work%para_env, &
216 nequip_work%local_particles)
218 END SUBROUTINE release_nequip_work
229 SUBROUTINE build_local_edges_shifts(nonbonded, potparm, nequip_work)
232 TYPE(nequip_work_type),
INTENT(INOUT) :: nequip_work
234 INTEGER :: atom_a, atom_b, i, idx_i, idx_j, iend, &
235 igrp, ikind, ilist, ipair, istart, &
236 jkind, n_max_edges, nedges, npairs
237 INTEGER,
DIMENSION(:, :),
POINTER ::
list
238 LOGICAL :: do_nequip_allegro
239 REAL(kind=
dp) :: cutsq_ij, drij, rij(3)
240 REAL(kind=
dp),
DIMENSION(3) :: cell_v, cvi
245 DO ilist = 1, nonbonded%nlists
246 neighbor_kind_pair => nonbonded%neighbor_kind_pairs(ilist)
247 n_max_edges = n_max_edges + neighbor_kind_pair%npairs
250 ALLOCATE (nequip_work%local_edges(2, n_max_edges), nequip_work%local_shifts(3, n_max_edges))
253 DO ilist = 1, nonbonded%nlists
254 neighbor_kind_pair => nonbonded%neighbor_kind_pairs(ilist)
255 npairs = neighbor_kind_pair%npairs
256 IF (npairs == 0) cycle
258 kind_loop:
DO igrp = 1, neighbor_kind_pair%ngrp_kind
259 istart = neighbor_kind_pair%grp_kind_start(igrp)
260 iend = neighbor_kind_pair%grp_kind_end(igrp)
261 ikind = neighbor_kind_pair%ij_kind(1, igrp)
262 jkind = neighbor_kind_pair%ij_kind(2, igrp)
264 idx_i = nequip_work%kind_mapper(ikind)
265 idx_j = nequip_work%kind_mapper(jkind)
267 IF (idx_i < 1 .OR. idx_j < 1)
THEN
271 pot => potparm%pot(ikind, jkind)%pot
272 do_nequip_allegro = .false.
273 DO i = 1,
SIZE(pot%type)
274 IF (pot%type(i) == nequip_work%target_pot_type)
THEN
275 do_nequip_allegro = .true.
280 IF (.NOT. do_nequip_allegro) cycle kind_loop
282 cutsq_ij = pot%set(i)%nequip%cutoff_matrix(idx_i, idx_j)
283 list => neighbor_kind_pair%list
284 cvi = neighbor_kind_pair%cell_vector
285 pot => potparm%pot(ikind, jkind)%pot
286 cell_v = matmul(nequip_work%cell%hmat, cvi)
288 DO ipair = istart, iend
289 atom_a = neighbor_kind_pair%list(1, ipair)
290 atom_b = neighbor_kind_pair%list(2, ipair)
292 rij(:) = nequip_work%r_pbc(atom_b)%r(:) - nequip_work%r_pbc(atom_a)%r(:) + cell_v
293 drij = dot_product(rij, rij)
295 IF (drij <= cutsq_ij)
THEN
297 nequip_work%local_edges(:, nedges) = [atom_a, atom_b]
298 nequip_work%local_shifts(:, nedges) = cvi
304 IF (nedges < n_max_edges)
THEN
306 INTEGER(kind=int_8),
ALLOCATABLE :: tmp_idx(:, :)
307 REAL(kind=
dp),
ALLOCATABLE :: tmp_sft(:, :)
309 ALLOCATE (tmp_idx(2, nedges), tmp_sft(3, nedges))
311 tmp_idx(:, :) = nequip_work%local_edges(:, 1:nedges)
312 tmp_sft(:, :) = nequip_work%local_shifts(:, 1:nedges)
314 CALL move_alloc(tmp_idx, nequip_work%local_edges)
315 CALL move_alloc(tmp_sft, nequip_work%local_shifts)
319 END SUBROUTINE build_local_edges_shifts
331 SUBROUTINE get_potential_config(atomic_kind_set, potparm, target_pot_type, neq_pot)
332 TYPE(atomic_kind_type),
POINTER :: atomic_kind_set(:)
333 TYPE(pair_potential_pp_type),
POINTER :: potparm
334 INTEGER,
INTENT(IN) :: target_pot_type
335 TYPE(nequip_pot_type),
INTENT(OUT),
POINTER :: neq_pot
337 INTEGER :: i, ikind, jkind
338 TYPE(pair_potential_single_type),
POINTER :: pot
341 outerloop:
DO ikind = 1,
SIZE(atomic_kind_set)
342 DO jkind = ikind,
SIZE(atomic_kind_set)
343 pot => potparm%pot(ikind, jkind)%pot
344 DO i = 1,
SIZE(pot%type)
345 IF (pot%type(i) == target_pot_type)
THEN
346 neq_pot => pot%set(i)%nequip
352 END SUBROUTINE get_potential_config
361 SUBROUTINE init_atom_masks(nequip_work)
362 TYPE(nequip_work_type),
INTENT(INOUT) :: nequip_work
364 INTEGER :: iat, ikind, ilocal, n_atoms, n_local
366 IF (.NOT.
ALLOCATED(nequip_work%kind_mapper))
THEN
367 cpabort(
"kind_mapper not initialized before init_atom_masks")
370 n_atoms =
SIZE(nequip_work%particle_set)
372 IF (
ALLOCATED(nequip_work%use_atom))
DEALLOCATE (nequip_work%use_atom)
373 ALLOCATE (nequip_work%use_atom(n_atoms))
374 nequip_work%use_atom = .false.
377 ikind = nequip_work%particle_set(iat)%atomic_kind%kind_number
378 IF (nequip_work%kind_mapper(ikind) > 0)
THEN
379 nequip_work%use_atom(iat) = .true.
382 nequip_work%n_atoms_use = count(nequip_work%use_atom)
384 IF (
ALLOCATED(nequip_work%sum_energy))
DEALLOCATE (nequip_work%sum_energy)
385 ALLOCATE (nequip_work%sum_energy(n_atoms))
386 nequip_work%sum_energy = .false.
388 IF (
ASSOCIATED(nequip_work%local_particles))
THEN
389 DO ikind = 1,
SIZE(nequip_work%local_particles%n_el)
390 IF (nequip_work%kind_mapper(ikind) > 0)
THEN
391 n_local = nequip_work%local_particles%n_el(ikind)
392 DO ilocal = 1, n_local
393 iat = nequip_work%local_particles%list(ikind)%array(ilocal)
394 nequip_work%sum_energy(iat) = .true.
399 nequip_work%sum_energy(:) = nequip_work%use_atom(:)
402 END SUBROUTINE init_atom_masks
411 SUBROUTINE build_kind_mapper(atomic_kind_set, neq_pot, nequip_work)
412 TYPE(atomic_kind_type),
POINTER :: atomic_kind_set(:)
413 TYPE(nequip_pot_type),
POINTER :: neq_pot
414 TYPE(nequip_work_type),
INTENT(INOUT) :: nequip_work
416 CHARACTER(LEN=100) :: model_sym
417 CHARACTER(LEN=default_string_length) :: kind_sym
418 INTEGER :: i, ikind, n_kinds
420 n_kinds =
SIZE(atomic_kind_set)
422 IF (
ALLOCATED(nequip_work%kind_mapper))
DEALLOCATE (nequip_work%kind_mapper)
423 ALLOCATE (nequip_work%kind_mapper(n_kinds))
424 nequip_work%kind_mapper = -1
426 DO ikind = 1, n_kinds
427 kind_sym = atomic_kind_set(ikind)%element_symbol
428 CALL uppercase(kind_sym)
430 DO i = 1, neq_pot%num_types
431 model_sym = neq_pot%type_names_torch(i)
432 CALL uppercase(model_sym)
433 IF (trim(kind_sym) == trim(model_sym))
THEN
434 nequip_work%kind_mapper(ikind) = i
439 END SUBROUTINE build_kind_mapper
451 SUBROUTINE setup_neq_data(fist_nonbond_env, neq_data, pot, nequip_work)
452 TYPE(fist_nonbond_env_type),
POINTER :: fist_nonbond_env
453 TYPE(nequip_data_type),
POINTER :: neq_data
454 TYPE(nequip_pot_type),
POINTER :: pot
455 TYPE(nequip_work_type),
INTENT(IN) :: nequip_work
457 INTEGER :: iat, iat_use, n_atoms
459 CALL fist_nonbond_env_get(fist_nonbond_env, nequip_data=neq_data)
461 IF (.NOT.
ASSOCIATED(neq_data))
THEN
463 CALL fist_nonbond_env_set(fist_nonbond_env, nequip_data=neq_data)
464 NULLIFY (neq_data%use_indices, neq_data%force)
466 CALL torch_model_load(neq_data%model, pot%pot_file_name)
467 CALL torch_model_freeze(neq_data%model)
470 IF (
ASSOCIATED(neq_data%force))
THEN
471 IF (
SIZE(neq_data%force, 2) /= nequip_work%n_atoms_use) &
472 DEALLOCATE (neq_data%force, neq_data%use_indices)
475 IF (.NOT.
ASSOCIATED(neq_data%force))
THEN
476 ALLOCATE (neq_data%force(3, nequip_work%n_atoms_use))
477 ALLOCATE (neq_data%use_indices(nequip_work%n_atoms_use))
480 n_atoms =
SIZE(nequip_work%use_atom)
483 IF (nequip_work%use_atom(iat))
THEN
484 iat_use = iat_use + 1
485 neq_data%use_indices(iat_use) = iat
488 END SUBROUTINE setup_neq_data
497 SUBROUTINE prepare_edges_shifts_nequip(nequip_work)
498 TYPE(nequip_work_type),
INTENT(INOUT) :: nequip_work
500 INTEGER :: ipair, nedges, nedges_tot
501 INTEGER(kind=int_8),
ALLOCATABLE :: temp_edge_index(:, :)
502 INTEGER,
ALLOCATABLE :: displ(:), displ_cell(:), edge_count(:), &
505 nedges =
SIZE(nequip_work%local_edges, 2)
507 ALLOCATE (edge_count(nequip_work%para_env%num_pe), edge_count_cell(nequip_work%para_env%num_pe))
508 ALLOCATE (displ_cell(nequip_work%para_env%num_pe), displ(nequip_work%para_env%num_pe))
510 CALL nequip_work%para_env%allgather(nedges, edge_count)
511 nedges_tot = sum(edge_count)
513 ALLOCATE (temp_edge_index(2, nedges_tot))
514 ALLOCATE (nequip_work%final_shifts(3, nedges_tot))
516 edge_count_cell(:) = edge_count*3
517 edge_count = edge_count*2
520 DO ipair = 2, nequip_work%para_env%num_pe
521 displ(ipair) = displ(ipair - 1) + edge_count(ipair - 1)
522 displ_cell(ipair) = displ_cell(ipair - 1) + edge_count_cell(ipair - 1)
525 CALL nequip_work%para_env%allgatherv(nequip_work%local_shifts, nequip_work%final_shifts, edge_count_cell, displ_cell)
526 CALL nequip_work%para_env%allgatherv(nequip_work%local_edges, temp_edge_index, edge_count, displ)
528 ALLOCATE (nequip_work%final_edges(nedges_tot, 2))
529 nequip_work%final_edges(:, :) = transpose(temp_edge_index)
531 DEALLOCATE (edge_count, edge_count_cell, displ, displ_cell, temp_edge_index)
533 END SUBROUTINE prepare_edges_shifts_nequip
542 SUBROUTINE prepare_edges_shifts_allegro(nequip_work)
543 TYPE(nequip_work_type),
INTENT(INOUT) :: nequip_work
545 ALLOCATE (nequip_work%final_shifts, source=nequip_work%local_shifts)
546 ALLOCATE (nequip_work%final_edges(
SIZE(nequip_work%local_edges, 2), 2))
547 nequip_work%final_edges(:, :) = transpose(nequip_work%local_edges)
548 END SUBROUTINE prepare_edges_shifts_allegro
557 SUBROUTINE build_torch_edge_indexes(nequip_work)
558 TYPE(nequip_work_type),
INTENT(INOUT) :: nequip_work
560 INTEGER :: atom_a, atom_b, i, iat, iat_use, n_atoms
561 INTEGER,
ALLOCATABLE :: global_to_packed(:)
563 n_atoms =
SIZE(nequip_work%particle_set)
566 IF (nequip_work%target_pot_type /= nequip_type)
THEN
568 DO i = 1,
SIZE(nequip_work%local_edges, 2)
569 atom_a = int(nequip_work%local_edges(1, i))
570 atom_b = int(nequip_work%local_edges(2, i))
571 nequip_work%use_atom(atom_a) = .true.
572 nequip_work%use_atom(atom_b) = .true.
574 nequip_work%n_atoms_use = count(nequip_work%use_atom)
578 ALLOCATE (global_to_packed(n_atoms))
582 IF (nequip_work%use_atom(iat))
THEN
583 iat_use = iat_use + 1
584 global_to_packed(iat) = iat_use
589 DO i = 1,
SIZE(nequip_work%local_edges, 2)
590 atom_a = int(nequip_work%local_edges(1, i))
591 atom_b = int(nequip_work%local_edges(2, i))
593 nequip_work%local_edges(1, i) = int(global_to_packed(atom_a) - 1, kind=int_8)
594 nequip_work%local_edges(2, i) = int(global_to_packed(atom_b) - 1, kind=int_8)
597 DEALLOCATE (global_to_packed)
599 END SUBROUTINE build_torch_edge_indexes
611 SUBROUTINE run_torch_model(neq_data, pot, nequip_work, outputs)
612 TYPE(nequip_data_type),
POINTER :: neq_data
613 TYPE(nequip_pot_type),
POINTER :: pot
614 TYPE(nequip_work_type),
INTENT(IN) :: nequip_work
615 TYPE(torch_dict_type),
INTENT(OUT) :: outputs
617 INTEGER :: iat, iat_use, ikind
618 INTEGER(kind=int_8),
ALLOCATABLE ::
atom_types(:)
619 REAL(kind=dp),
ALLOCATABLE :: lattice(:, :), pos(:, :)
620 TYPE(torch_dict_type) :: inputs
621 TYPE(torch_tensor_type) :: cell_t, idx_t, pos_t, shift_t, types_t
623 ALLOCATE (lattice(3, 3))
624 lattice(:, :) = nequip_work%cell%hmat/pot%unit_length_val
626 ALLOCATE (pos(3, nequip_work%n_atoms_use),
atom_types(nequip_work%n_atoms_use))
628 DO iat = 1,
SIZE(nequip_work%particle_set)
629 IF (.NOT. nequip_work%use_atom(iat)) cycle
630 iat_use = iat_use + 1
632 ikind = nequip_work%particle_set(iat)%atomic_kind%kind_number
633 IF (nequip_work%kind_mapper(ikind) < 1)
THEN
634 CALL cp_abort(__location__,
"Atom symbol not found in NequIP model!")
638 atom_types(iat_use) = nequip_work%kind_mapper(ikind) - 1
639 pos(:, iat_use) = nequip_work%r_pbc(iat)%r(:)/pot%unit_length_val
642 CALL torch_dict_create(inputs)
644 CALL torch_tensor_from_array(pos_t, pos)
645 CALL torch_tensor_from_array(shift_t, nequip_work%final_shifts)
646 CALL torch_tensor_from_array(cell_t, lattice)
648 CALL torch_dict_insert(inputs,
"pos", pos_t)
649 CALL torch_dict_insert(inputs,
"edge_cell_shift", shift_t)
650 CALL torch_dict_insert(inputs,
"cell", cell_t)
651 CALL torch_tensor_release(pos_t)
652 CALL torch_tensor_release(shift_t)
653 CALL torch_tensor_release(cell_t)
655 CALL torch_tensor_from_array(idx_t, nequip_work%final_edges)
656 CALL torch_dict_insert(inputs,
"edge_index", idx_t)
657 CALL torch_tensor_release(idx_t)
659 CALL torch_tensor_from_array(types_t,
atom_types)
660 CALL torch_dict_insert(inputs,
"atom_types", types_t)
661 CALL torch_tensor_release(types_t)
663 CALL torch_dict_create(outputs)
664 CALL torch_model_forward(neq_data%model, inputs, outputs)
666 CALL torch_dict_release(inputs)
668 IF (
ALLOCATED(pos))
DEALLOCATE (pos)
669 IF (
ALLOCATED(lattice))
DEALLOCATE (lattice)
672 END SUBROUTINE run_torch_model
685 SUBROUTINE process_outputs(outputs, neq_data, pot, pot_total, nequip_work)
686 TYPE(torch_dict_type),
INTENT(IN) :: outputs
687 TYPE(nequip_data_type),
POINTER :: neq_data
688 TYPE(nequip_pot_type),
POINTER :: pot
689 REAL(kind=dp),
INTENT(OUT) :: pot_total
690 TYPE(nequip_work_type),
INTENT(IN) :: nequip_work
692 INTEGER :: iat, iat_use
693 REAL(kind=dp),
POINTER :: e_ptr(:, :), f_ptr(:, :), v_ptr(:, :, :)
694 TYPE(torch_tensor_type) :: t_energy, t_forces, t_virial
696 NULLIFY (f_ptr, e_ptr, v_ptr)
698 CALL torch_dict_get(outputs,
"forces", t_forces)
699 CALL torch_tensor_data_ptr(t_forces, f_ptr)
701 neq_data%force = f_ptr*pot%unit_forces_val
702 CALL torch_tensor_release(t_forces)
703 CALL torch_dict_get(outputs,
"atomic_energy", t_energy)
704 CALL torch_tensor_data_ptr(t_energy, e_ptr)
707 DO iat_use = 1,
SIZE(neq_data%use_indices)
708 iat = neq_data%use_indices(iat_use)
710 IF (nequip_work%target_pot_type /= nequip_type)
THEN
711 IF (.NOT. nequip_work%sum_energy(iat)) cycle
714 pot_total = pot_total + e_ptr(1, iat_use)
716 CALL torch_tensor_release(t_energy)
717 pot_total = pot_total*pot%unit_energy_val
719 IF (nequip_work%target_pot_type == nequip_type)
THEN
720 neq_data%force = neq_data%force/real(nequip_work%para_env%num_pe, dp)
721 pot_total = pot_total/real(nequip_work%para_env%num_pe, dp)
724 IF (nequip_work%use_virial)
THEN
725 CALL torch_dict_get(outputs,
"virial", t_virial)
726 CALL torch_tensor_data_ptr(t_virial, v_ptr)
728 neq_data%virial(:, :) = reshape(v_ptr, [3, 3])*pot%unit_energy_val
729 CALL torch_tensor_release(t_virial)
730 IF (nequip_work%target_pot_type == nequip_type)
THEN
731 neq_data%virial = neq_data%virial/real(nequip_work%para_env%num_pe, dp)
735 END SUBROUTINE process_outputs
748 TYPE(fist_nonbond_env_type),
POINTER :: fist_nonbond_env
749 REAL(kind=dp),
DIMENSION(:, :),
INTENT(INOUT) :: f_nonbond, pv_nonbond
750 LOGICAL,
INTENT(IN) :: use_virial
752 INTEGER :: iat, iat_use
753 TYPE(nequip_data_type),
POINTER :: neq_data
755 CALL fist_nonbond_env_get(fist_nonbond_env, nequip_data=neq_data)
758 pv_nonbond = pv_nonbond + neq_data%virial
761 DO iat_use = 1,
SIZE(neq_data%use_indices)
762 iat = neq_data%use_indices(iat_use)
763 f_nonbond(1:3, iat) = f_nonbond(1:3, iat) + neq_data%force(1:3, iat_use)
Define the atom type and its sub types.
Define the atomic kind types and their sub types.
Handles all functions related to the CELL.
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
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, nequip_data, deepmd_data, ace_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, nequip_data, deepmd_data, ace_data, charges)
sets a fist_nonbond_env
Defines the basic variable types.
integer, parameter, public int_8
integer, parameter, public dp
integer, parameter, public default_string_length
An array-based list which grows on demand. When the internal array is full, a new array of twice the ...
subroutine, public nequip_add_force_virial(fist_nonbond_env, f_nonbond, pv_nonbond, use_virial)
...
subroutine, public nequip_energy_store_force_virial(nonbonded, particle_set, local_particles, cell, atomic_kind_set, potparm, r_last_update_pbc, pot_total, fist_nonbond_env, para_env, use_virial, target_pot_type)
...
Interface to the message passing library MPI.
integer, parameter, public nequip_type
Define the data structure for the particle information.
Utilities for string manipulations.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
subroutine, public torch_dict_release(dict)
Releases a Torch dictionary and all its ressources.
subroutine, public torch_dict_get(dict, key, tensor)
Retrieves a Torch tensor from a Torch dictionary.
subroutine, public torch_model_load(model, filename)
Loads a Torch model from given "*.pth" file. (In Torch lingo models are called modules)
subroutine, public torch_dict_create(dict)
Creates an empty Torch dictionary.
subroutine, public torch_model_freeze(model)
Freeze the given Torch model: applies generic optimization that speed up model. See https://pytorch....
subroutine, public torch_dict_insert(dict, key, tensor)
Inserts a Torch tensor into a Torch dictionary.
subroutine, public torch_tensor_release(tensor)
Releases a Torch tensor and all its ressources.
subroutine, public torch_model_forward(model, inputs, outputs)
Evaluates the given Torch model.
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
structure to store local (to a processor) ordered lists of integers.
stores all the informations relevant to an mpi environment