def set_cor_func(for_agg, params, ax_len = 10000): ax_length = ax_len # Needs to have small step for the dynamics to converge t_ax_sd = qr.TimeAxis(0.0, ax_length, 1) db = SpectralDensityDB() # Parameters for spectral density. ODBO, Renger or Silbey params = params with qr.energy_units('1/cm'): sd_low_freq = qr.SpectralDensity(t_ax_sd, params) reorg = qr.convert(sd_low_freq.measure_reorganization_energy(), "int", "1/cm") print("spectral density reorg -", reorg) # Adding the high freq modes sd_high_freq = db.get_SpectralDensity(t_ax_sd, "Wendling_JPCB_104_2000_5825") ax = sd_low_freq.axis sd_high_freq.axis = ax sd_tot = sd_low_freq + sd_high_freq cf = sd_tot.get_CorrelationFunction(temperature=params['T'], ta=t_ax_sd) # Assigning the correlation function to the list of molecules for mol in for_agg: mol.set_transition_environment((0,1),cf)
def assign_spec_dens(self, sd_type = 'OverdampedBrownian', high_freq = True): t_ax_sd = qr.TimeAxis(0.0, 10000, 1) db = SpectralDensityDB() # Parameters for spectral density. ODBO, Renger or Silbey params = { "ftype": sd_type, "alternative_form": True, "reorg": self.reorg, "T": self.temp, "cortime": self.cor_time } with qr.energy_units('1/cm'): sd_low_freq = qr.SpectralDensity(t_ax_sd, params) if high_freq: # Adding the high freq modes sd_high_freq = db.get_SpectralDensity(t_ax_sd, "Wendling_JPCB_104_2000_5825") ax = sd_low_freq.axis sd_high_freq.axis = ax sd_tot = sd_low_freq + sd_high_freq cf = sd_tot.get_CorrelationFunction(temperature=self.temp, ta=t_ax_sd) # Assigning the correlation function to the list of molecules else: cf = sd_low_freq.get_CorrelationFunction(temperature=self.temp, ta=t_ax_sd) for mol in self.mol_list: mol.set_transition_environment((0,1),cf)
print("Calculating spectra from 0 to ", t2_ax_len, " fs\n") ####################################################################### # Creation of the aggregate ring ####################################################################### for_agg = myFuncs.circularAgg(num_mol, dipole_strength) #myFuncs.show_dipoles(for_agg) ####################################################################### # Spectral density ####################################################################### # Needs to have small step for the dynamics to converge t_ax_sd = qr.TimeAxis(0.0, 10000, 1) db = SpectralDensityDB() # Parameters for spectral density. ODBO, Renger or Silbey params = { "ftype": "OverdampedBrownian", #"ftype": "B777", "alternative_form": True, "reorg": reorganisation, "T": temperature, "cortime": cor_time } myFuncs.set_cor_func(for_agg, params) ####################################################################### # Dynamics
''' moleculeOne = qr.Molecule() moleculeTwo = qr.Molecule() moleculeOne.position = [0.0, 0.0, 0.0] moleculeTwo.position = [0.0, 10.0, 0.0] moleculeOne.set_dipole(0,1,[10.0, 0.0, 0.0]) moleculeTwo.set_dipole(0,1,[0.0, 10.0, 0.0]) for_agg = [moleculeOne, moleculeTwo] ''' ####################################################################### # Spectral density ####################################################################### # Needs to have small step for the dynamics to converge t_ax_sd = qr.TimeAxis(0.0, 10000, 1) db = SpectralDensityDB() # Parameters for spectral density. ODBO, Renger or Silbey params = { "ftype": "OverdampedBrownian", #"ftype": "B777", "alternative_form": True, "reorg": reorganisation, "T": temperature, "cortime": cor_time } with qr.energy_units('1/cm'): sd_low_freq = qr.SpectralDensity(t_ax_sd, params) # Adding the high freq modes sd_high_freq = db.get_SpectralDensity(t_ax_sd, "Wendling_JPCB_104_2000_5825")
if _save_: try: os.mkdir(saveDir) except OSError: print ("Creation of the directory %s failed" % saveDir) t1 = time.time() print("Calculating spectra from 0 to ", t2Length, " fs\n") ####################################################################### # Spectral density ####################################################################### # Needs to have small step for the dynamics to converge timeSD = qr.TimeAxis(0.0, 10000, 1) db = SpectralDensityDB() # Renger form of spec dens #paramsReng = {"ftype": "B777", # "alternative_form": False, # "reorg": reorganisation, # "T":temperature, # "cortime":cTime} #with qr.energy_units("1/cm"): # sdLowFreq = qr.SpectralDensity(timeSD, paramsReng) ''' # Over Damped Brownian Oscillaotr params = {"ftype":"OverdampedBrownian", "T":temperature, "reorg":reorganisation, "cortime":cTime}
# -*- coding: utf-8 -*- import numpy from quantarhei.models.spectdens import SpectralDensityDB #from quantarhei.models.spectdens import CorrelationFunctionDB from quantarhei import SpectralDensity from quantarhei import TimeAxis, energy_units _show_plots_ = True axis = TimeAxis(0.0, 10000, 1.0) db = SpectralDensityDB(verbose=True) sdw = db.get_SpectralDensity(axis, "Wendling_JPCB_104_2000_5825") #sdw = db.get_SpectralDensity(axis, "Renger_JCP_2002") params = dict(ftype="OverdampedBrownian", reorg=300.0, cortime=100.0) with energy_units("1/cm"): sdob = SpectralDensity(axis, params) ax = sdw.axis sdob.axis = ax sd_tot = sdob + sdw with energy_units("1/cm"): if _show_plots_: sd_tot.plot(axis=[0, 1300, 0.0, numpy.max(sd_tot.data)]) # here we get correlation function at a given temperature in K
# -*- coding: utf-8 -*- import numpy from quantarhei.models.spectdens import SpectralDensityDB #from quantarhei.models.spectdens import CorrelationFunctionDB from quantarhei import SpectralDensity from quantarhei import TimeAxis, energy_units axis = TimeAxis(0.0, 10000, 1.0) db = SpectralDensityDB(verbose=True) #sdw = db.get_SpectralDensity(axis, "Wendling_JPCB_104_2000_5825") sdw = db.get_SpectralDensity(axis, "Renger_JCP_2002") params = dict(ftype="OverdampedBrownian", reorg=300.0, cortime=100.0) with energy_units("1/cm"): sdob = SpectralDensity(axis, params) ax = sdw.axis sdob.axis = ax sd_tot = sdob + sdw with energy_units("1/cm"): sd_tot.plot(axis=[0, 1300, 0.0, numpy.max(sd_tot.data)]) cf = sd_tot.get_CorrelationFunction(300.0) print(db.get_status_string()) cf.plot()