delta_E_values = np.logspace(0, 3.0, 100)  # wavenumbers
coupling_values = np.array([20.0, 100.0, 500.0])  # wavenumbers


def hamiltonian(delta_E, V):
    return np.array([[delta_E / 2.0, V], [V, -delta_E / 2.0]])


reorg_energy = 100.0  # wavenumbers
cutoff_freq = 53.0  # wavenumbers
temperature = 300.0

time = np.linspace(0, 0.5, 1000)
lbf_coeffs = os.lbf_coeffs(reorg_energy, cutoff_freq, temperature, None, 0)
site_lbf = os.site_lbf_ed(time, lbf_coeffs)
site_lbf_dot = os.site_lbf_dot_ed(time, lbf_coeffs)
site_lbf_dot_dot = os.site_lbf_dot_dot_ed(time, lbf_coeffs)

"""
# comparison of reorganisation energy calculations
exciton_reorg_energies1 = []
exciton_reorg_energies2 = []
for i,delta_E in enumerate(delta_E_values):
    evals, evecs = utils.sorted_eig(hamiltonian(delta_E, 20.))
    exciton_reorg_energies1.append(os.generalised_exciton_reorg_energy(np.array([evecs[0], evecs[0], evecs[1], evecs[1]]), np.array([reorg_energy, reorg_energy])))
    exciton_reorg_energies2.append(np.sum(evecs[0]**2 * evecs[1]**2) * reorg_energy)
    
plt.plot(delta_E_values, exciton_reorg_energies1, label='1')
plt.plot(delta_E_values, exciton_reorg_energies2, label='2', linewidth=2, ls='--', color='red')
plt.legend()
plt.show()
try:
    data = np.load(data_filename)
    print 'data file already exists, do you want to append to it?' 
except:
    pass

time_interval = 10
integration_time = np.linspace(0, time_interval, time_interval*16000) # time_interval*16000
num_expansion_terms = 10
mode_params = PE545_mode_params(mode_damping)

coeffs = os.lbf_coeffs(reorg_energy1, cutoff_freq1, temperature, mode_params, num_expansion_terms)
coeffs = np.concatenate((coeffs, os.lbf_coeffs(reorg_energy2, cutoff_freq2, temperature, None, num_expansion_terms)))
g_site = os.site_lbf_ed(integration_time, coeffs)
g_site_dot = os.site_lbf_dot_ed(integration_time, coeffs)
g_site_dot_dot = os.site_lbf_dot_dot_ed(integration_time, coeffs)
total_site_reorg_energy = reorg_energy1 + reorg_energy2 + np.sum([mode[0]*mode[1] for mode in mode_params])

shift_before_diagonalisation = True

# in each realisation pick the next value from the distribution for each site to construct the Hamiltonian
for n in range(num_realisations):
    print 'Calculating realisation number ' + str(n+1)
    realisation_energies = np.zeros(site_energies.size)
    for i in range(site_energies.size):
        realisation_energies[i] = site_energy_samples[i][n]
    if not shift_before_diagonalisation:
        hamiltonian = np.diag(realisation_energies) + couplings + couplings.T
        evals, evecs = utils.sorted_eig(hamiltonian)
    else:
Exemplo n.º 3
0
reorg_energy = 100.  # wavenumbers
cutoff_freq = 53.  # wavenumbers
temperature = 300.

# rates, integrands, time = os.MRT_rate_ed(hamiltonian(10.,500.), reorg_energy, cutoff_freq, temperature, None, 0, 60.0)
# plt.plot(time, integrands[0,1])
# plt.show()

# try to reproduce dimer rates using code copied from Mathematica
rates_data = []
time_interval = 0.5
time = np.linspace(0, time_interval, int(time_interval * 2000))
lbf_coeffs = os.lbf_coeffs(reorg_energy, cutoff_freq, temperature, None, 0)
g_site = os.site_lbf_ed(time, lbf_coeffs)
g_site_dot = os.site_lbf_dot_ed(time, lbf_coeffs)
g_site_dot_dot = os.site_lbf_dot_dot_ed(time, lbf_coeffs)
scaling = 1.

for i, V in enumerate(coupling_values):
    print 'calculating rates for coupling ' + str(V)
    rates = []
    for delta_E in delta_E_values:
        evals, evecs = utils.sorted_eig(hamiltonian(delta_E, V))
        print evals
        exciton_reorg_energies = np.array([
            os.exciton_reorg_energy(exciton, [reorg_energy, reorg_energy])
            for exciton in evecs
        ])
        print exciton_reorg_energies
        rates.append(
Exemplo n.º 4
0
exciton_init_states = data['D0_save_ex']
num_realisations = site_shifts.shape[0]

time_interval = 5  #10
integration_time = np.linspace(0, time_interval,
                               time_interval * 32000)  # 16000
num_expansion_terms = 40
mode_params = PE545_mode_params(mode_damping)
coeffs = os.lbf_coeffs(reorg_energy1, cutoff_freq1, temperature, mode_params,
                       num_expansion_terms)
coeffs = np.concatenate(
    (coeffs,
     os.lbf_coeffs(reorg_energy2, cutoff_freq2, temperature, None,
                   num_expansion_terms)))
g_site = os.site_lbf_ed(integration_time, coeffs)
g_site_dot = os.site_lbf_dot_ed(integration_time, coeffs)
g_site_dot_dot = os.site_lbf_dot_dot_ed(integration_time, coeffs)
total_site_reorg_energy = reorg_energy1 + reorg_energy2 + np.sum(
    [mode[0] * mode[1] for mode in mode_params])
# parameters for time evolution
duration = 5.
timestep = 0.01
time = np.arange(0, duration + timestep, timestep)
#init_dv = np.array([0.35, 0.12, 0.1, 0.1, 0.34, 0.61, 0.46, 0.5]) # init state in site basis

site_history_sum = np.zeros((average_site_hamiltonian.shape[0], time.size))

for n in range(num_realisations):
    print 'Calculating realisation ' + str(n + 1) + ' at time ' + str(
        datetime.now().time())