jax_md.mm_forcefields.reaxff package#
Submodules#
jax_md.mm_forcefields.reaxff.reaxff_energy module#
Contains energy related functions for ReaxFF
Author: Mehmet Cagri Kaymak
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_acks2_charges(species, atom_mask, nbr_inds, hulp2_mat, bond_softness, tapered_dists, idempotential, electronegativity, total_charge, backprop_solve=False, tol=1e-06)[source]#
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_acks2_coulomb_pot(nbr_inds, atom_mask, effpot, bond_softness)[source]#
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_bo(nbr_inds, nbr_dist, species, species_AN, force_field)[source]#
- Usage:
first update/allocate neighborlist will be called then the info will be passed to this function
for now, assume the format is “Dense”
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_boncor_pot(nbr_inds, nbr_mask, species, bo, bopi, bopi2, abo, force_field)[source]#
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_charge_energy(species, charges, idempotential, electronegativity)[source]#
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_coulomb_pot(nbr_inds, atom_mask, hulp2_mat, tapered_dists, charges)[source]#
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_covbon_pot(nbr_inds, nbr_dist, nbr_mask, species, triple_bond, force_field, tapered_reaxff=False)[source]#
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_eem_charges(species, atom_mask, nbr_inds, hulp2_mat, tapered_dists, idempotential, electronegativity, init_charges=None, total_charge=0.0, backprop_solve=False, tol=1e-06, max_solver_iter=500)[source]#
EEM charge solver.
If max_solver_iter is set to -1, use direct solve.
- Returns:
An array of shape [n+1,] where first n entries are the charges and last entry is the electronegativity equalization value.
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_hb_pot(species, hbond_inds, hbond_angles, hbond_mask, close_nbr_inds, far_nbr_inds, bo, force_field, tapered_reaxff=False)[source]#
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_lonpar_pot(species, atom_mask, abo, force_field)[source]#
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_ovcor_pot(species, atoms_AN, atom_mask, nbr_inds, nbr_dists, nbr_mask, bo, bopi, bopi2, abo, vlp, force_field)[source]#
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_reaxff_energy(species, atomic_numbers, nbr_lists, close_nbr_dists, far_nbr_dists, body_3_angles, body_4_angles, hb_ang_dist, force_field, init_charges=None, total_charge=0.0, tol=1e-06, max_solver_iter=500, backprop_solve=False, tors_2013=False, tapered_reaxff=False, solver_model='EEM')[source]#
Calculate full ReaxFF potential.
- Parameters:
species (
Array) – An ndarray of shape[n, ]for the atom types.atomic_numbers (
Array) – An ndarray of shape[n, ]for the atomic numbers of the atoms.nbr_lists (
ReaxFFNeighborLists) – Contains the interaction lists for ReaxFF potential.close_nbr_dists (
Array) – An ndarray of shape[n,m]for bonded interaction distancesfar_nbr_dists (
Array) – An ndarray of shape[n,m]for non-bonded interaction distances (vdw and Coulomb)body_3_angles (
Array) – Angles and distances for many-body interactionsbody_4_angles (
Array) – Angles and distances for many-body interactionshb_ang_dist (
Array) – Angles and distances for many-body interactionsforce_field (
ForceField) – ReaxFF parametersinit_charges (
Array|None) – Initial charges for the iterative solver An ndarray of shape[n, ]or Nonetotal_charge (
float) – Total charge of the system (float)tol (
float) – Tolarence for the charge solvermax_solver_iter (
int) – Maximum number of solver iterations If set to -1, use direct solvebackprop_solve (
bool) – Control variable to decide whether to do a solve to calculate the gradients of the charges wrt positions. By definition, the gradients should be 0 but if the solver tolerance is high, the gradients might be non-ignorable.tors_2013 (
bool) – Control variable to decide whether to use more stable version of the torsion interactionstapered_reaxff (
bool) – Control variable to decide whether to use tapered cutoffs for various bonded interactions, causes computational overheadsolver_model (
str) – Control variable for the solver model (“EEM” or “ACKS”)
- Returns:
System energy in kcal/mol
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_torsion_pot(species, body_4_inds, body_4_angles, body_4_mask, nbr_inds, bo, bopi, abo, force_field, tapered_reaxff=False, tors_2013=False)[source]#
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_valency_pot(species, body_3_inds, body_3_angles, body_3_mask, nbr_inds, vlp, bo, bopi, bopi2, abo, force_field, tapered_reaxff=False)[source]#
- jax_md.mm_forcefields.reaxff.reaxff_energy.calculate_vdw_pot(species, far_nbr_mask, nbr_inds, dists, tapered_dists, force_field)[source]#
- jax_md.mm_forcefields.reaxff.reaxff_energy.smooth_lone_pair_casting(number, p_lambda=0.9999, l1=-1.3, l2=-0.3, r1=0.3, r2=1.3)[source]#
jax_md.mm_forcefields.reaxff.reaxff_forcefield module#
Contains force field related code
Author: Mehmet Cagri Kaymak
- class jax_md.mm_forcefields.reaxff.reaxff_forcefield.ForceField(num_atom_types, name_to_index, params_to_indices, body3_indices_src, body3_indices_dst, body4_indices_src, body4_indices_dst, self_energies, shift, low_tap_rad, up_tap_rad, cutoff, cutoff2, hb_close_cutoff, hb_far_cutoff, body2_params_mask, body3_params_mask, body4_params_mask, body34_params_mask, hb_params_mask, global_params, electronegativity, idempotential, gamma, rvdw, p1co, p1co_off, p1co_off_mask, eps, p2co, p2co_off, p2co_off_mask, alf, p3co, p3co_off, p3co_off_mask, vop, amas, rat, rob1, rob1_off, rob1_off_mask, rapt, rob2, rob2_off, rob2_off_mask, vnq, rob3, rob3_off, rob3_off_mask, ptp, pdp, popi, pdo, bop1, bop2, de1, de2, de3, psp, psi, aval, vval3, bo131, bo132, bo133, ovc, v13cor, softcut, softcut_2d, stlp, valf, vval1, vval2, vval4, vkac, th0, vka, vkap, vka3, vka8, vlp1, valp1, vovun, vover, v1, v2, v3, v4, vconj, nphb, rhb, dehb, vhb1, vhb2, vdw_shiedling, trip_stab4, trip_stab5, trip_stab8, trip_stab11, over_coord1, over_coord2, val_par3, val_par15, val_par17, val_par18, val_par20, val_par21, val_par22, val_par31, val_par34, val_par39, par_16, par_6, par_7, par_9, par_10, par_32, par_33, par_24, par_25, par_26, par_28, par_35)[source]#
Bases:
objectContainer for ReaxFF parameters
- alf: Array#
- amas: Array#
- aval: Array#
- bo131: Array#
- bo132: Array#
- bo133: Array#
- body2_params_mask: Array#
- body34_params_mask: Array#
- body3_params_mask: Array#
- body4_params_mask: Array#
- bop1: Array#
- bop2: Array#
- cutoff: Array#
- cutoff2: Array#
- de1: Array#
- de2: Array#
- de3: Array#
- dehb: Array#
- electronegativity: Array#
- eps: Array#
- gamma: Array#
- global_params: Array#
- hb_close_cutoff: Array#
- hb_far_cutoff: Array#
- hb_params_mask: Array#
- idempotential: Array#
- low_tap_rad: Array#
- nphb: Array#
- ovc: Array#
- over_coord1: Array#
- over_coord2: Array#
- p1co: Array#
- p1co_off: Array#
- p1co_off_mask: Array#
- p2co: Array#
- p2co_off: Array#
- p2co_off_mask: Array#
- p3co: Array#
- p3co_off: Array#
- p3co_off_mask: Array#
- par_10: Array#
- par_16: Array#
- par_24: Array#
- par_25: Array#
- par_26: Array#
- par_28: Array#
- par_32: Array#
- par_33: Array#
- par_35: Array#
- par_6: Array#
- par_7: Array#
- par_9: Array#
- pdo: Array#
- pdp: Array#
- popi: Array#
- psi: Array#
- psp: Array#
- ptp: Array#
- rapt: Array#
- rat: Array#
- rhb: Array#
- rob1: Array#
- rob1_off: Array#
- rob1_off_mask: Array#
- rob2: Array#
- rob2_off: Array#
- rob2_off_mask: Array#
- rob3: Array#
- rob3_off: Array#
- rob3_off_mask: Array#
- rvdw: Array#
- self_energies: Array#
- set(**kwargs)#
- shift: Array#
- softcut: Array#
- softcut_2d: Array#
- stlp: Array#
- th0: Array#
- trip_stab11: Array#
- trip_stab4: Array#
- trip_stab5: Array#
- trip_stab8: Array#
- up_tap_rad: Array#
- v1: Array#
- v13cor: Array#
- v2: Array#
- v3: Array#
- v4: Array#
- val_par15: Array#
- val_par17: Array#
- val_par18: Array#
- val_par20: Array#
- val_par21: Array#
- val_par22: Array#
- val_par3: Array#
- val_par31: Array#
- val_par34: Array#
- val_par39: Array#
- valf: Array#
- valp1: Array#
- vconj: Array#
- vdw_shiedling: Array#
- vhb1: Array#
- vhb2: Array#
- vka: Array#
- vka3: Array#
- vka8: Array#
- vkac: Array#
- vkap: Array#
- vlp1: Array#
- vnq: Array#
- vop: Array#
- vover: Array#
- vovun: Array#
- vval1: Array#
- vval2: Array#
- vval3: Array#
- vval4: Array#
jax_md.mm_forcefields.reaxff.reaxff_helper module#
Contains helper functions ReaxFF
Author: Mehmet Cagri Kaymak
jax_md.mm_forcefields.reaxff.reaxff_interactions module#
Contains interaction list related functions for ReaxFF
Author: Mehmet Cagri Kaymak
- class jax_md.mm_forcefields.reaxff.reaxff_interactions.Filtration(candidate_fn, mask_fn, is_dense, idx, did_buffer_overflow)[source]#
Bases:
objectAllows filtering out the masked indices from the interaction lists for better performance. Supports dense -> dense and sparse -> sparse filtering.
- candidate_fn#
A function that creates candidate list to be filtered.
- mask_fn#
A function that decides which indices to mask. returns a boolean array.
- is_dense#
An boolean flag to show if it is a dense->dense filter.
- idx#
Index array.
- did_buffer_overflow#
A boolean specifying whether or not the cell list exceeded the maximum allocated capacity.
- allocate(candidate_args, capacity_multiplier=1.25, min_capacity=0)[source]#
Initial allocation
- Return type:
- did_buffer_overflow: Array#
- set(**kwargs)#
- class jax_md.mm_forcefields.reaxff.reaxff_interactions.ReaxFFNeighborListFns(allocate, update)[source]#
Bases:
object- set(**kwargs)#
- class jax_md.mm_forcefields.reaxff.reaxff_interactions.ReaxFFNeighborLists(close_nbrs, far_nbrs, filter2, filter3, filter34, filter4, filter_hb_close, filter_hb_far, filter_hb, did_buffer_overflow)[source]#
Bases:
objectStores the neighbor lists and filters required for ReaxFF
- close_nbrs: NeighborList#
- did_buffer_overflow: Array#
- far_nbrs: NeighborList#
- filter2: Filtration#
- filter3: Filtration#
- filter34: Filtration#
- filter4: Filtration#
- filter_hb: Filtration | None#
- filter_hb_close: Filtration | None#
- filter_hb_far: Filtration | None#
- set(**kwargs)#
- jax_md.mm_forcefields.reaxff.reaxff_interactions.body_34_candidate_fn(body_3_inds, nbr_inds, neigh_bo, species, cutoff2, param_mask)[source]#
- jax_md.mm_forcefields.reaxff.reaxff_interactions.body_3_candidate_fn(nbr_inds, neigh_bo, species, cutoff2, param_mask)[source]#
Creates full candidate index and value arrays for 3 body interactions, to be used by a filter.
- jax_md.mm_forcefields.reaxff.reaxff_interactions.body_4_candidate_fn(body_3_inds, nbr_inds, neigh_bo, species, cutoff2, param_mask)[source]#
Creates full candidate index and value arrays for 4 body interactions, to be used by a filter.
- jax_md.mm_forcefields.reaxff.reaxff_interactions.calculate_all_4_body_angles(body_4_inds, nbr_inds, nbr_disps)[source]#
Calculates the angle related terms for the provided 4-body interaction list
- jax_md.mm_forcefields.reaxff.reaxff_interactions.calculate_all_angles_and_distances(R, nbr_lists, map_metric, map_disp)[source]#
- jax_md.mm_forcefields.reaxff.reaxff_interactions.calculate_all_hbond_angles_and_dists(hbond_inds, close_nbr_disps, far_nbr_disps)[source]#
Calculates the angles and distances for the provided hydrogen-bond list
- jax_md.mm_forcefields.reaxff.reaxff_interactions.calculate_angle(disp12, disp32)[source]#
Assume there are 3 atoms: atom 1,2 and 3 where 2 is the center disp12 = pos1 - pos2 disp32 = pos3 - pos2
- jax_md.mm_forcefields.reaxff.reaxff_interactions.filtration(candidate_fn, mask_fn, is_dense=False)[source]#
Returns an empty Filtration object to be used
- Return type:
- jax_md.mm_forcefields.reaxff.reaxff_interactions.find_3_body_inter(N, ctr_ind, nbr_pot, nbr_inds, lcl_inds, cutoff2)[source]#
Finds all potential 3-body interactions based on bonded potentials
- jax_md.mm_forcefields.reaxff.reaxff_interactions.find_body_4_inter(body_3_item, neigh_inds, neigh_bo, cutoff2)[source]#
Finds all potential 4 body interactions involving a 3-body item
- jax_md.mm_forcefields.reaxff.reaxff_interactions.hbond_candidate_fn(donor_inds, close_nbr_inds, hb_short_inds, far_nbr_inds, hb_long_inds, species, param_mask)[source]#
Creates full candidate index and value arrays for hydrogen bonds, to be used by a filter.
- jax_md.mm_forcefields.reaxff.reaxff_interactions.reaxff_inter_list(displacement, box, species, species_AN, force_field, total_charge=0.0, tol=1e-06, max_solver_iter=500, backprop_solve=False, tors_2013=False, solver_model='EEM', short_inters_capacity_multiplier=1.2, long_inters_capacity_multiplier=1.2)[source]#
Contains all the necessary logic to run a reaxff simulation and allocate, reallocate, update and energy_fn functions.
- Parameters:
species (
Array) – An ndarray of shape[n, ]for the atom types.species_AN (
Array) – An ndarray of shape[n, ]for the atomic numbers of the atoms.total_charge (
float) – Total charge of the system (float)tol (
float) – Tolarence for the charge solvermax_solver_iter (
int) – Maximum number of solver iterationsbackprop_solve (
bool) – Control variable to decide whether to do a solve to calculate the gradients of the charges wrt positions. By definition, the gradients should be 0 but if the solver tolerance is high, the gradients might be non-ignorable.tors_2013 (
bool) – Control variable to decide whether to use more stable version of the torsion interactionssolver_model (
str) – Control variable for the solver model (“EEM” or “ACKS”)short_inters_capacity_multiplier (
float) – capacity multiplier for all short range interactionslong_inters_capacity_multiplier (
float) – capacity multiplier for all long range interactions
- Return type:
- Returns:
System energy in kcal/mol