DeltaMatrix
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix — Module
module DeltaMatrixA module designed to update an existing matrix of symmetry function values based on a small perturbation in the positions.
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix.adjust_angular_symm_val! — Method
adjust_angular_symm_val!(g_value,θ_new,θ_old,exp_new,exp_old,tpz)
adjust_angular_symm_val!(g_value,exp_old,exp_new,θ_old,θ_new,λ,ζ,tpz)Functions for adjusting angular symmetry function value from g_value by calculating the exponential component exp_old,exp_new, theta components θ_val_old,θ_val_new from the angles θ_old,θ_new and the normalisaiton factor tpz These are used to subtract the old g value and add the new one.
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix.adjust_radial_symm_val! — Method
adjust_radial_symm_val!(g_value1,g_value2,rnew_ij,r2_ij,fnew_ij,f2_ij,η,g_norm)Taking the i and j symmetry function values g_value1,g_value2 we use the hyperparameters η,g_norm as well as the old and new distances and cutoff functions rnew_ij,fnew_ij r2_ij,f2_ij adds the new symmetry value and subtracts the old one based on g_{ij}
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix.adjust_symm_val! — Method
adjust_symm_val!(g_value,r_sum,f_prod,η,g_norm)Designed to update the radial symmetry function value g_value. Accepts the hyperparameter η as well as r_sum, f_prod and g_norm and adds the individual contribution of g_{ij}.
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix.angular_symmetry_calculation! — Method
angular_symmetry_calculation!(g_vector, atomindex, newposition, position, dist2_mat, new_dis_vector, f_matrix, new_f_vector, symmetry_function::AngularType3)This method is designed to do the same as the radial symmetry function for the angular symmetry function using the same inputs. Double loop over all j,k and use calc_new_symmetry_value! over g_vector.
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix.calc_delta_matrix — Method
calc_delta_matrix(g_mat,positions,newposition,atomindex,dist2_mat,new_dist2_vector,f_mat,new_f_vector,radsymmfunctions,angsymmfunctions,nrad,nang,n1,n2)Having moved a single atom indexed by atomindex, we calcualte the changes to the total symmetry matrix gmat using the calcdeltasymmval functions
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix.calc_delta_symm_val! — Method
calc_delta_symm_val!(g_vector,atomindex,dist2_mat,new_dist2_vector,f_matrix,new_f_vector,n1,n2,η,g_norm)
calc_delta_symm_val!(g_vector,positions,newposition,atomindex,dist2_mat,new_dist2_vector,f_matrix,new_f_vector,n1,n2,η,λ,ζ,tpz)Generic function to calculate the total update to the vector of symmetry values having moved a single atom defined by atomindex. The first method calculates the changes to a vector of radial symmetry values, the second calculates the changes to a vector of angular symmetry values.
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix.calc_new_symmetry_value! — Method
calc_new_symmetry_value!(g_vector,indices,newposition,position1,position2,position3,rnew_ij,rnew_ik,r2_ij,r2_ik,r2_jk,fnew_ij,fnew_ik,f_ij,f_ik,f_jk,η,λ,ζ,tpz)
calc_new_symmetry_value!(g_vector,indexi,indexj,indexk,newposition,position,dist2_mat,new_dist2_vector,f_matrix,new_f_vector,η,λ,ζ,tpz)Currying functions from higher-level data structures such as the radial distances in dist2_mat,new_dist2_vector and cutoff functions f_matrix,new_f_vector as well as positions in newposition,position and passes these to lower level functions along with hyperparameters η,λ,ζ,tpz to adjust the values in g_vector at positions indexi,indexj,indexk calculates the required exponential component and angles to pass down to adjust_angular_symm_val!
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix.calc_new_symmetry_value! — Method
calc_new_symmetry_value!(g_vector,indexi,indexj,dist2_mat,new_dist2_vector,f_matrix,new_f_vector,η,g_norm)Call for the radial symmetry value designed to curry the input from g_vector at positions indexi,indexj to the adjust_radial_symm_val! function. It unpacks the radial distances from dist2_mat,new_dist2_vector and the cutoff functions from f_matrix,new_f_vec as well as the hyperparameters η,g_norm and gives these values to the lower level functions.
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix.calc_swap_matrix — Method
calc_swap_matrix(g_mat,positions,atomindex1,atomindex2,dist2_mat,f_mat,radsymmfunctions,angsymmfunctions,nrad,nang,n1,n2)having swapped atom at atomindex1 and atomindex2 in a system with n1 atoms of type 1 and n2 atoms of type 2, with nrad radial and nang angular symmetry functions, we calculate the changes to g_mat based on the swap.
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix.calc_swap_symm_val — Method
calc_swap_symm_val(g_vector,atomindex1,atomindex2,dist2_mat,f_mat,n1,n2,η,g_norm)
calc_swap_symm_val(g_vector,positions,atomindex1,atomindex2,dist2_mat,f_mat,n1,n2,η,λ,ζ,tpz)function to calculate the changes to a symmetry vector gvector assuming we have swapped the positions of atomindex1 and atomindex2. The first method is defined for a radial symmetry function with parameters η and gnorm. Works for a system with n1 atoms of type 1 and n2 atoms of type 2.
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix.new_angular_symm_vals — Method
new_angular_symm_vals(newposition,position1,position2,position3,rnew_ij,rnew_ik,r2_ij,r2_ik,r2_jk,fnew_ij,fnew_ik,f_ij,f_ik,f_jk,η,λ,ζ)Function to calculate the updated value of an angular symmetry function: Using the old and new interatomic distances and positions along with cutoff values and parameters, we calculate the old and new symmetry value and return a static vector of the three new angular symmetry value, one for each atom i,j,k being the centre of the calculation.
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix.new_radial_symm_val! — Method
new_radial_symm_val!(rnew_ij,r2_ij,fnew_ij,f2_ij,η)Function to calculate the updated value of a radial symmetry function: That is, how much does the radial symmetry value calculated using the old distance r2ij change when using the new distance rnewij using the old and new cutoff values f2ij,fnewij and the parameter η.
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix.radial_symmetry_calculation! — Method
radial_symmetry_calculation!(g_vector, atomindex, dist2_mat, new_dist2_vector, f_matrix, new_f_vector, symmetry_function::RadialType2)
symmetry_calculation!(g_vector,atomindex,newposition,position,dist2_mat,new_dis_vector,f_matrix,new_f_vector,symmetry_function::AngularType3)This method is designed for radial symmetry functions. Given an atom at atomindex along with high level data structures: dist2_mat,new_dist2_vector,f_matrix,new_f_vector containing the new and old positions, distances and cutoff functions. We iterate over all other atoms and pass their index to lower level currying functions. The positions newposition,position are included for consistency with the higher-level function.
ParallelTemperingMonteCarlo.MachineLearningPotential.DeltaMatrix.total_symm! — Method
total_symm!(g_matrix,position,new_position,dist2_matrix,new_dist_vector,f_matrix,new_f_vector,atomindex,total_symmetry_vector)Top level function to calculate the total change to the matrix of symmetry function values g_matrix. Given position,dist2_matrix,f_matrix containing the original state of the system, and new_position,new_dist_vector,new_f_vector the change to this state based on the motion of atomindex, we iterate over the total_symmetry_vector using the defined radial_symmetry_calculation! and angular_symmetry_calculation! functions.