diff --git a/repsample_acetylcall.py b/repsample_acetylcall.py index 06fcc2d..fdc7722 100644 --- a/repsample_acetylcall.py +++ b/repsample_acetylcall.py @@ -30,18 +30,11 @@ oscillator_strengths_array = np.array(oscillator_strengths) excitation_energies_cm_array = np.array(excitation_energies_cm) -excitation_energies_ev_array = excitation_energies_cm_array*(0.0001239841984) +excitation_energies_ev_array = excitation_energies_cm_array * 0.0001239841984 -excitation_energies_help_array = excitation_energies_ev_array/27.211396 -tdpx = np.sqrt((3*oscillator_strengths_array)/(2*excitation_energies_help_array)) - -trans_dip_mom_y = np.zeros((2000,3)) -trans_dip_mom_z = np.zeros((2000,3)) - -MYGEOM = rstd.GeomReduction(2000, 3, 20, 1000, 8, 16, weighted=True, pdfcomp = "KLdiv", intweights=False, verbose=False, dim1=False) #create an instance of GeomReduction with specified parameters: 500 samples, 3 states, 20 representative molecules, 100 cycles, 1 core, 1 job, without weighting, using KL divergence for PDF comparison, no integer weights, and verbose off +MYGEOM = rstd.GeomReduction(2000, 3, 5, 1000, 8, 16, weighted=True, pdfcomp = "KLdiv", intweights=False, verbose=False, dim1=False) #create an instance of GeomReduction with specified parameters: 500 samples, 3 states, 20 representative molecules, 100 cycles, 1 core, 1 job, without weighting, using KL divergence for PDF comparison, no integer weights, and verbose off np.random.seed(42) #set the seed for reproducibility - -MYGEOM.read_data_direct(excitation_energies_ev_array, tdpx, trans_dip_mom_y, trans_dip_mom_z) #directly feed the generated data into the GeomReduction instance +MYGEOM.read_data_direct_osc(excitation_energies_ev_array, oscillator_strengths_array) #directly feed the generated data into the GeomReduction instance MYGEOM.reduce_geoms() #start the geometry reduction process to select representative geometries diff --git a/src/pyneapples/rep_sampler_2d.py b/src/pyneapples/rep_sampler_2d.py index 1a2887c..08f2209 100644 --- a/src/pyneapples/rep_sampler_2d.py +++ b/src/pyneapples/rep_sampler_2d.py @@ -212,6 +212,19 @@ def read_data_direct(self, excitation_energies, transition_dipole_moments_x, tra self.weights = self.exc*self.trans #calculate the weight for each transition as the product of excitation energy and the (summed) dipole moment self.wnorms = np.sum(self.weights, axis=0)/np.sum(self.weights) #provides a normalization factor for each state, ensuring that the weights are comparable across states + def read_data_direct_osc(self, excitation_energies, oscillator_stregths): + + evs_in_au = 27.211396 # Conversion factor from electronvolts to atomic units + + self.infile = "Test_Filename" #stores the filename + self.exc = excitation_energies # Assign excitation energies in eV units + self.time = datetime.datetime.now() #records the current date and time + + self.trans = abs((3*oscillator_stregths)/(2*(self.exc/evs_in_au))) # Calculate transition dipole moment scaler value (as above) using energy in a.u. + + self.weights = self.exc*self.trans #calculate the weight for each transition as the product of excitation energy and the (summed) dipole moment + self.wnorms = np.sum(self.weights, axis=0)/np.sum(self.weights) #provides a normalization factor for each state, ensuring that the weights are comparable across states + def read_data(self, infile): """Reads and parses input data from given input file."""