def setUp(self): np.random.seed( 0 ) # set random seed in order for the examples to reproduce the exact references # setup molecules molecule = Molecule() molecule1 = molecule.copy() molecule1.set_coordinates([0]) molecule1.name = 'TypeA' molecule2 = molecule.copy() molecule2.set_coordinates([1]) molecule2.name = 'TypeB' molecule3 = molecule.copy() molecule3.set_coordinates([2]) molecule3.name = 'TypeC' # setup system self.system = System(molecules=[molecule1, molecule2, molecule3], supercell=[[3]]) # set initial exciton # self.system.add_excitation_index(tt, 1) # self.system.add_excitation_random(s1, 2) self.system.add_excitation_index(s1, 0) self.system.add_excitation_index(s1, 1)
def setUp(self): # setup molecules molecule = Molecule() molecule1 = molecule.copy() molecule1.set_coordinates([0]) molecule1.name = 'TypeA' molecule2 = molecule.copy() molecule2.set_coordinates([1]) molecule2.name = 'TypeB' molecule3 = molecule.copy() molecule3.set_coordinates([2]) molecule3.name = 'TypeC' # setup system self.system = System(molecules=[molecule1, molecule2, molecule3], supercell=[[3]]) # set initial exciton self.system.add_excitation_index(s1, 1) self.system.add_excitation_index(s1, 0)
def setUp(self): np.random.seed(0) # set random seed in order for the examples to reproduce the exact references # list of decay functions by state molecule = Molecule() # define system as a crystal self.system = crystal_system(molecules=[molecule], # molecule to use as reference scaled_site_coordinates=[[0.0, 0.0]], unitcell=[[5.0, 1.0], [1.0, 5.0]], dimensions=[2, 2], # supercell size orientations=[[0.0, 0.0, np.pi / 2]]) # if element is None then random, if list then Rx Ry Rz # set initial exciton self.system.add_excitation_index(s1, 1) self.system.add_excitation_index(s1, 0) # set additional system parameters self.system.cutoff_radius = 8 # interaction cutoff radius in Angstrom
# Test kimonet Forster coupling from kimonet.system.molecule import Molecule from kimonet.core.processes.couplings import forster_coupling, forster_coupling_extended from kimonet.system.state import State from kimonet.system.vibrations import MarcusModel, LevichJortnerModel, EmpiricalModel from kimonet.core.processes import GoldenRule, DecayRate, DirectRate from kimonet.core.processes.decays import einstein_radiative_decay au2dby = 1 / DEBYE_TO_AU # TODO: this has to be adapted to new inerface in KIMONET molecule = Molecule( states=[State(label='gs', energy=0), State(label='s1', energy=1.0)], transition_moment={ ('s1', 'gs'): [0.0001 * au2dby, 0.2673 * au2dby, -0.0230 * au2dby], # ('s1', 'gs'): [0.0001 * au2dby, 0.3379 * au2dby, -0.0296 * au2dby], ('s2', 'gs'): [0.0140 * au2dby, 0.1174 * au2dby, 1.8592 * au2dby] }, state='gs') donor = molecule.copy() acceptor = molecule.copy() donor.set_orientation([0, 0, 0]) donor.set_coordinates(center_f1) acceptor.set_orientation([0, 0, 0]) acceptor.set_coordinates(center_f2) print('\n------------ S1 ---------------')
test_list = ['a', 'b', 'c'] group_list = [1, 2] configuration = partition(test_list, group_list) print(configuration) combinations_list = combinations_group(test_list, group_list) for c in combinations_list: print(c, '---', configuration) print(c == configuration) print(c) s1 = State(label='s1', energy=1.0, multiplicity=1) molecule1 = Molecule(coordinates=[0]) molecule2 = Molecule(coordinates=[1]) molecule3 = Molecule(coordinates=[2]) molecule4 = Molecule(coordinates=[4]) supercell = [[6]] test_list = [molecule1, molecule2, molecule3, molecule4] group_list = [1, 3] configuration = partition(test_list, group_list) print('initial:', test_list) combinations_list = combinations_group(test_list, group_list, supercell)
print('Symmetry: ', sym_data) # Test kimonet Forster coupling from kimonet.system.molecule import Molecule from kimonet.core.processes.couplings import forster_coupling, forster_coupling_extended from kimonet.system.vibrations import Vibrations, MarcusModel, LevichJortnerModel, EmpiricalModel from kimonet.core.processes import GoldenRule, DecayRate, DirectRate from kimonet.core.processes.decays import einstein_singlet_decay au2dby = 1/DEBYE_TO_AU molecule = Molecule(state_energies={'gs': 0, 's1': 0}, transition_moment={('s1', 'gs'): [0.0001 * au2dby, 0.2673 * au2dby, -0.0230 * au2dby], # ('s1', 'gs'): [0.0001 * au2dby, 0.3379 * au2dby, -0.0296 * au2dby], ('s2', 'gs'): [0.0140 * au2dby, 0.1174 * au2dby, 1.8592 * au2dby]}, state='gs' ) donor = molecule.copy() acceptor = molecule.copy() donor.set_orientation([0, 0, 0]) donor.set_coordinates(center_f1) acceptor.set_orientation([0, 0, 0]) acceptor.set_coordinates(center_f2) print('\n------------ S1 ---------------') donor.state = 's1'
def theoretical_diffusion_values(system_information): """ :param system_information: dictionary with the system information (parameter to parameter) :return: dictionary with the theoretical lifetime, diffusion constant and length. (In the cases that they can be defined). """ # system information k = 2 # orientational factor. Always 2 in the systems where this model is possible r = system_information['lattice']['lattice_parameter'][0] # equall in all directions (nm) T = system_information['conditions']['temperature'] # temperature (K) n = system_information['conditions']['refractive_index'] # refractive index d = len(system_information['lattice']['dimensions']) # dimensionality of the system ############################################################################################################ # molecule information. Again a generic object of molecule is initialized excited_state = list(system_information['excitons'].keys())[0] # in a diffusion study there will be only on exciton, so only one key reorganization = system_information['reorganization_energies'][excited_state] # reorganization energy of the excited electronic state. eV transition_moment_vector = system_information['transition_moment'] # transition dipole moment (a.u) transition_moment = np.linalg.norm(transition_moment_vector) # modulus # initialization of a generic instance of class molecule generic_molecule = Molecule(state_energies=system_information['state_energies'], state='s1', reorganization_energies=system_information['reorganization_energies'], transition_moment=transition_moment_vector) ############################################################################################################ # The life time of the exciton is taken as the inverse of the sum of all decay rates # A theoretical value for the life time will be always computed. decay_rates = generic_molecule.decay_rates() decay_sum = 0 for decay in decay_rates: decay_sum =+ decay_rates[decay] life_time = 1 / decay_sum ############################################################################################################ # cases in which there is a theoretical model for the diffusion possible_cases = [['1d_ordered', 'parallel'], ['2d_ordered', 'parallel'], ['3d_ordered', 'parallel'], ['1d_ordered', 'antiparallel'], ['2d_ordered', 'antiparallel'], ['3d_ordered', 'antiparallel']] # the theoretical values for D and LD will always be computed for the possible cases: if [system_information['type'], system_information['orientation']] in possible_cases: factor_1 = 2 * pi * (transition_moment**2 * k**2 / ((r/0.053)**3 * n**2))**2 # in atomic units factor_2 = np.sqrt(1 / (4 * pi * reorganization * BOLTZMANN_CONSTANT * T)) * \ np.exp(- reorganization / (4 * BOLTZMANN_CONSTANT * T)) # in eV rate = factor_1 * factor_2 D = rate * r**2 # diffusion constant (nm² ns⁻¹) Ld = np.sqrt(2 * d * rate * r**2 * life_time) # diffusion length (nm) else: # Ld and D taken as None if there is no D = None # theoretical model Ld = None # return the 3 parameters in a dictionary return {'lifetime': life_time, 'diffusion_constant': D, 'diffusion_length': Ld}
fill_value=0, bounds_error=False) f_em = interp1d(data_em[0], data_em[1] / n_em, fill_value=0, bounds_error=False) molecule = Molecule( states=[ State(label='gs', energy=0, multiplicity=1), # energies in eV State(label='s1', energy=4.37, multiplicity=1) ], # energies in eV # vibrations=MarcusModel(reorganization_energies), vibrations=EmpiricalModel({ ('gs', 's1'): f_abs, ('s1', 'gs'): f_em }), transition_moment={ ('s1', 'gs'): [0.9226746648, -1.72419493e-02, 4.36234688e-05], #('s1', 'gs'): np.array([2.26746648e-01, -1.72419493e-02, 4.36234688e-05]), ('s2', 'gs'): [2.0, 0.0, 0.0] }, # transition dipole moment of the molecule (Debye) decays=decay_scheme, vdw_radius=1.7) ####################################################################################################################### # physical conditions of the system (as a dictionary) conditions = { 'refractive_index': 1 } # refractive index of the material (adimensional)
27.51e-3] # b triplet_couplings = [0.0e-3, # a 7.2e-3, # ab 7.2e-3, # ab 1.2e-3] # b # Vibrations vibrational_model = MarcusModel(reorganization_energies={(gs, s1): 0.07, (s1, gs): 0.07, (gs, t1): 0.07, # assuming triplet same reorganization (t1, gs): 0.07}, # energy as singlet temperature=300) ################################################################################# # 2D model (plane a-b) , not diffusion in C molecule = Molecule() system = crystal_system(molecules=[molecule, molecule], # molecule to use as reference scaled_site_coordinates=[[0.0, 0.0], [0.5, 0.5]], unitcell=[[7.3347, 0.0000], [-0.2242, 6.0167]], dimensions=[4, 4], # supercell size orientations=[[0.0, 0.0, np.pi/8], [0.0, 0.0, -np.pi/8]]) # if element is None then random, if list then Rx Ry Rz system.cutoff_radius = 8.1 # Angstroms # Transport system.process_scheme = [GoldenRule(initial_states=(s1, gs), final_states=(gs, s1), electronic_coupling_function=electronic_coupling_direction,
import numpy as np # states list s1 = State(label='s1', energy=20.0, multiplicity=1) # transition moments transitions = [ Transition( s1, gs, tdm=[0.1, 0.0], # a.u. reorganization_energy=0.08) ] # eV # define system as a crystal molecule = Molecule() #print(molecule, molecule.state, molecule.state.get_center()) molecule2 = Molecule(site_energy=2) print(molecule2, molecule2.state, molecule2.state.get_center()) print(molecule, molecule.state, molecule.state.get_center()) system = crystal_system( molecules=[molecule, molecule], # molecule to use as reference scaled_site_coordinates=[[0.0, 0.0], [0.0, 0.5]], unitcell=[[5.0, 1.0], [1.0, 5.0]], dimensions=[2, 2], # supercell size orientations=[[0.0, 0.0, np.pi / 2], [0.0, 0.0, 0.0] ]) # if element is None then random, if list then Rx Ry Rz
# custom decay functions def decay_rate(initial, final): rates = { 'TypeA': 1. / 100, # ns-1 'TypeB': 1. / 50, # ns-1 'TypeC': 1. / 25 } # ns-1 return rates[initial[0].get_center().name] # states list s1 = State(label='s1', energy=1.0, multiplicity=1, size=1) s2 = State(label='s2', energy=1.5, multiplicity=1) # setup molecules molecule = Molecule() molecule1 = molecule.copy() molecule1.set_coordinates([0]) molecule1.name = 'TypeA' molecule2 = molecule.copy() molecule2.set_coordinates([1]) molecule2.name = 'TypeB' molecule3 = molecule.copy() molecule3.set_coordinates([2]) molecule3.name = 'TypeC' # setup system system = System(molecules=[molecule1, molecule2, molecule3], supercell=[[3]])