(1143., 0.04094, damping), (1181., 0.01759, damping),
                     (1190., 0.00667, damping), (1208., 0.01850, damping),
                     (1216., 0.01759, damping), (1235., 0.00697, damping),
                     (1252., 0.00636, damping), (1260., 0.00636, damping),
                     (1286., 0.00454, damping), (1304., 0.00576, damping),
                     (1322., 0.03032, damping), (1338., 0.00394, damping),
                     (1354., 0.00576, damping), (1382., 0.00667, damping),
                     (1439., 0.00667, damping), (1487., 0.00788, damping),
                     (1524., 0.00636, damping), (1537., 0.02183, damping),
                     (1553., 0.00909, damping), (1573., 0.00454, damping),
                     (1580., 0.00454, damping), (1612., 0.00454, damping),
                     (1645., 0.00363, damping), (1673., 0.00097, damping)])


time = np.linspace(0, 0.1, 1000)
lbf_coeffs = os.lbf_coeffs(reorg_energy, cutoff_freq, temperature,
                           LHCII_mode_params(mode_damping), 20)
lbf = os.site_lbf_ed_alt(time, lbf_coeffs)

plt.plot(time, np.real(lbf), label=r'$\mathcal{R}$e g(t)')
plt.plot(time, np.imag(lbf), label=r'$\mathcal{I}$m g(t)')

time2 = np.linspace(0, 0.1, 1000)
lbf_coeffs2 = os.lbf_coeffs(reorg_energy, cutoff_freq, temperature,
                            LHCII_mode_params(mode_damping), 20)
lbf2 = os.site_lbf_ed_alt(time2, lbf_coeffs2)

plt.plot(time2, np.real(lbf2), label=r'$\mathcal{R}$e g(t)')
plt.plot(time2, np.imag(lbf2), label=r'$\mathcal{I}$m g(t)')

plt.xlim(0, 0.1)
plt.legend()
e1 = 1000.0
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')
Exemplo n.º 3
0
    return np.array([[delta_E / 2., V], [V, -delta_E / 2.]])


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
        ])
    time_step = t[1] - t[0]
    dynamics = te.liouvillian_time_evolution(np.array([1, 0]),
                                             time_propagator,
                                             t[-1],
                                             time_step,
                                             wave_nums=False)
    return dynamics[:, 0]


print '[Calculating Forster rates...]'
print 'Started at: ' + str(time_utils.getTime())
for i, v in enumerate(reorg_energy_values):
    #print 'Calculating rates for reorg energy: ' + str(v)
    forster_time = np.linspace(0, 20., 16000)
    lbf = os.site_lbf_ed(forster_time,
                         os.lbf_coeffs(v, cutoff_freq, temperature, None, 5))
    forster_rates[i] = os.forster_rate(100., 0, v, v, lbf, lbf, 0, 0,
                                       np.array([1., 0]), np.array([0, 1.]),
                                       system_hamiltonian, forster_time)
print 'Finished at: ' + str(time_utils.getTime())


def calculate_HEOM(reorg_energy):
    print reorg_energy
    system_hamiltonian = np.array([[100., 20.], [20., 0]])
    cutoff_freq = 53.
    temperature = 300.
    hs = HierarchySolver(system_hamiltonian,
                         environment(reorg_energy, beta, K),
                         beta,
                         N=trunc_level)
Exemplo n.º 5
0
                                    total_site_reorg_energy, total_site_reorg_energy, total_site_reorg_energy])

    lbf_fn = '../../data/PSIIRC_lbfs_' + str(
        int(temperature)) + 'K_site_reorg_' + str(
            int(total_site_reorg_energy)) + '_cutoff_freq_' + str(
                int(cutoff_freq)) + '_no_modes_data.npz'
    #lbf_fn = '../../data/PSIIRC_lbfs_' + str(int(temperature)) + 'K_site_reorg_' + str(int(total_site_reorg_energy)) + '_single_mode_data.npz'
    try:
        data = np.load(lbf_fn)
        lbf = data['lbf']
        lbf_dot = data['lbf_dot']
        lbf_dot_dot = data['lbf_dot_dot']
        time = data['time']
    except IOError:
        print 'Starting lbf calculations at ' + str(time_utils.getTime())
        lbf_coeffs = os.lbf_coeffs(site_drude_reorg_energy, cutoff_freq,
                                   temperature, single_mode_params, 100)
        lbf = os.site_lbf_ed(time, lbf_coeffs)
        lbf_dot = os.site_lbf_dot_ed(time, lbf_coeffs)
        lbf_dot_dot = os.site_lbf_dot_dot_ed(time, lbf_coeffs)
        print 'Finished calculating lbfs at ' + str(time_utils.getTime())
        np.savez(lbf_fn,
                 lbf=lbf,
                 lbf_dot=lbf_dot,
                 lbf_dot_dot=lbf_dot_dot,
                 time=time)

    # calculate MRT rates
    evals, evecs = utils.sorted_eig(hamiltonian[:6, :6])

    exciton_reorg_energies = np.array([
        os.exciton_reorg_energy(exciton, site_reorg_energies)
Exemplo n.º 6
0
total_reorg_energy = 540.
CT1_scaling = 3.
CT2_scaling = 4.

bare_chl_energy = system_hamiltonian[4,4] - total_reorg_energy
bare_phe_energy = system_hamiltonian[6,6] - total_reorg_energy
bare_CT1_energy = average_site_CT_energies[6] - total_reorg_energy*CT1_scaling
bare_CT2_energy = average_site_CT_energies[7] - total_reorg_energy*CT2_scaling

chl_state = np.array([0, 0, 1., 0, 0, 0, 0, 0])
phe_state = np.array([0, 0, 0, 0, 1., 0, 0, 0])
CT1_state = np.array([0, 0, 0, 0, 0, 0, 1., 0])
CT2_state = np.array([0, 0, 0, 0, 0, 0, 0, 1.])

time = np.linspace(0,2.,256000)
site_lbf = os.site_lbf_ed(time, os.lbf_coeffs(reorg_energy, cutoff_freq, temperature, None, 100))

# primary CT rates in site basis
chl_CT1_rate = os.forster_rate(bare_chl_energy, bare_CT1_energy, reorg_energy, reorg_energy*CT1_scaling, \
                                    site_lbf, site_lbf*CT1_scaling, 0, 0, chl_state, CT1_state, coherent_hamiltonian, time)
CT1_chl_rate = os.forster_rate(bare_CT1_energy, bare_chl_energy, reorg_energy, reorg_energy*CT1_scaling, \
                                    site_lbf, site_lbf*CT1_scaling, 0, 0, chl_state, CT1_state, coherent_hamiltonian, time)
phe_CT1_rate = os.forster_rate(bare_phe_energy, bare_CT1_energy, reorg_energy, reorg_energy*CT1_scaling, \
                                    site_lbf, site_lbf*CT1_scaling, 0, 0, phe_state, CT1_state, coherent_hamiltonian, time)
CT1_phe_rate = os.forster_rate(bare_CT1_energy, bare_phe_energy, reorg_energy, reorg_energy*CT1_scaling, \
                                    site_lbf, site_lbf*CT1_scaling, 0, 0, phe_state, CT1_state, coherent_hamiltonian, time)

forward_exciton_CT_rates = [2.86359127e+00, 2.09614196e-02, 7.89708095e+01, 5.47195323e+00, 2.91393623e+00, 2.92997893e-01]
backward_exciton_CT_rates = [2.32445332e+00, 1.40848357e-02, 4.18754762e+01, 2.46325661e+00, 1.25847348e+00, 3.69904601e-02]

# secondary CT rates
Exemplo n.º 7
0
cutoff_freq = 40.
temperature = 77.
mode_damping = 10.
time = np.linspace(
    0, 10, 1000000)  # need loads of time steps to get MRT rates to converge

lbf_fn = '../../data/PSIIRC_lbfs_' + str(int(temperature)) + 'K_data4.npz'
try:
    data = np.load(lbf_fn)
    lbf = data['lbf']
    lbf_dot = data['lbf_dot']
    lbf_dot_dot = data['lbf_dot_dot']
    time = data['time']
except IOError:
    print 'Starting lbf calculations at ' + str(time_utils.getTime())
    lbf_coeffs = os.lbf_coeffs(site_drude_reorg_energy, cutoff_freq,
                               temperature, mode_params(mode_damping), 100)
    lbf = os.site_lbf_ed(time, lbf_coeffs)
    lbf_dot = os.site_lbf_dot_ed(time, lbf_coeffs)
    lbf_dot_dot = os.site_lbf_dot_dot_ed(time, lbf_coeffs)
    print 'Finished calculating lbfs at ' + str(time_utils.getTime())
    np.savez(lbf_fn,
             lbf=lbf,
             lbf_dot=lbf_dot,
             lbf_dot_dot=lbf_dot_dot,
             time=time)

# calculate MRT rates
evals, evecs = utils.sorted_eig(hamiltonian)

exciton_reorg_energies = np.array([
    os.exciton_reorg_energy(exciton, site_reorg_energies) for exciton in evecs
data_filename = '../../data/modified_redfield_test_PE545_disorder_data5.npz'


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:
energy_gap_values = np.logspace(0, 3, 10)
coupling = 20.

hamiltonians = [hamiltonian(energy_gap, coupling) for energy_gap in energy_gap_values]

print 'Calculating line broadening function at ' + str(time_utils.getTime())
time = np.linspace(0, 10, 1000000)
num_expansion_terms = 500
lbf_fn = '../../data/hierarchy_MRT_comparison_lbf_data.npz'
try:
    data = np.load(lbf_fn)
    lbf = data['lbf']
    lbf_dot = data['lbf_dot']
    lbf_dot_dot = data['lbf_dot_dot']
except IOError:
    lbf_coeffs = os.lbf_coeffs(reorg_energy, cutoff_freq, temperature, None, num_expansion_terms)
    lbf = os.site_lbf_ed(time, lbf_coeffs)
    lbf_dot = os.site_lbf_dot_ed(time, lbf_coeffs)
    lbf_dot_dot = os.site_lbf_dot_ed(time, lbf_coeffs)
    np.savez(lbf_fn, lbf=lbf, lbf_dot=lbf_dot, lbf_dot_dot=lbf_dot_dot, time=time)

print 'Calculating MRT rates at ' + str(time_utils.getTime())
MRT_rates = np.zeros(energy_gap_values.size)
for i,H in enumerate(hamiltonians):
    evals,evecs = utils.sorted_eig(H)
    MRT_rates[i] = os.modified_redfield_rates_general(evals, evecs, lbf, lbf_dot, lbf_dot_dot, reorg_energy, temperature, time)[0][0,1]

# define function for HEOM calculation pool
def HEOM_calculation(hamiltonian):
    reorg_energy = 100.
    cutoff_freq = 53.
hamiltonians = [
    hamiltonian(energy_gap, coupling) for energy_gap in energy_gap_values
]

print 'Calculating line broadening function at ' + str(time_utils.getTime())
time = np.linspace(0, 10, 1000000)
num_expansion_terms = 500
lbf_fn = '../../data/hierarchy_MRT_comparison_lbf_data.npz'
try:
    data = np.load(lbf_fn)
    lbf = data['lbf']
    lbf_dot = data['lbf_dot']
    lbf_dot_dot = data['lbf_dot_dot']
except IOError:
    lbf_coeffs = os.lbf_coeffs(reorg_energy, cutoff_freq, temperature, None,
                               num_expansion_terms)
    lbf = os.site_lbf_ed(time, lbf_coeffs)
    lbf_dot = os.site_lbf_dot_ed(time, lbf_coeffs)
    lbf_dot_dot = os.site_lbf_dot_ed(time, lbf_coeffs)
    np.savez(lbf_fn,
             lbf=lbf,
             lbf_dot=lbf_dot,
             lbf_dot_dot=lbf_dot_dot,
             time=time)

print 'Calculating MRT rates at ' + str(time_utils.getTime())
MRT_rates = np.zeros(energy_gap_values.size)
for i, H in enumerate(hamiltonians):
    evals, evecs = utils.sorted_eig(H)
    MRT_rates[i] = os.modified_redfield_rates_general(evals, evecs, lbf,
                                                      lbf_dot, lbf_dot_dot,
                         (1354.,0.00576,damping),
                         (1382.,0.00667,damping),
                         (1439.,0.00667,damping),
                         (1487.,0.00788,damping),
                         (1524.,0.00636,damping),
                         (1537.,0.02183,damping),
                         (1553.,0.00909,damping),
                         (1573.,0.00454,damping),
                         (1580.,0.00454,damping),
                         (1612.,0.00454,damping),
                         (1645.,0.00363,damping),
                         (1673.,0.00097,damping)])
        

time = np.linspace(0,0.1,1000)
lbf_coeffs = os.lbf_coeffs(reorg_energy, cutoff_freq, temperature, LHCII_mode_params(mode_damping), 20)
lbf = os.site_lbf_ed_alt(time, lbf_coeffs)


plt.plot(time, np.real(lbf), label=r'$\mathcal{R}$e g(t)')
plt.plot(time, np.imag(lbf), label=r'$\mathcal{I}$m g(t)')

time2 = np.linspace(0, 0.1, 1000)
lbf_coeffs2 = os.lbf_coeffs(reorg_energy, cutoff_freq, temperature, LHCII_mode_params(mode_damping), 20)
lbf2 = os.site_lbf_ed_alt(time2, lbf_coeffs2)

plt.plot(time2, np.real(lbf2), label=r'$\mathcal{R}$e g(t)')
plt.plot(time2, np.imag(lbf2), label=r'$\mathcal{I}$m g(t)')

plt.xlim(0,0.1)
plt.legend()
Exemplo n.º 12
0
                     (1450., 0.1013, damping), (1520., 0.0265, damping),
                     (1790., 0.0072, damping), (2090., 0.0113, damping)])


data = io.loadmat('../../data/data_for_Richard.mat')

site_shifts = data['site_shift']
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
    total_site_reorg_energy = site_drude_reorg_energy# + single_mode_params[0][0]*single_mode_params[0][1]
    site_reorg_energies = np.array([total_site_reorg_energy, total_site_reorg_energy, total_site_reorg_energy, \
                                    total_site_reorg_energy, total_site_reorg_energy, total_site_reorg_energy])
    
    lbf_fn = '../../data/PSIIRC_lbfs_' + str(int(temperature)) + 'K_site_reorg_' + str(int(total_site_reorg_energy)) + '_cutoff_freq_'+str(int(cutoff_freq))+'_no_modes_data.npz'
    #lbf_fn = '../../data/PSIIRC_lbfs_' + str(int(temperature)) + 'K_site_reorg_' + str(int(total_site_reorg_energy)) + '_single_mode_data.npz'
    try:
        data = np.load(lbf_fn)
        lbf = data['lbf']
        lbf_dot = data['lbf_dot']
        lbf_dot_dot = data['lbf_dot_dot']
        time = data['time']
    except IOError:
        print 'Starting lbf calculations at ' + str(time_utils.getTime())
        lbf_coeffs = os.lbf_coeffs(site_drude_reorg_energy, cutoff_freq, temperature, single_mode_params, 100)
        lbf = os.site_lbf_ed(time, lbf_coeffs)
        lbf_dot = os.site_lbf_dot_ed(time, lbf_coeffs)
        lbf_dot_dot = os.site_lbf_dot_dot_ed(time, lbf_coeffs)
        print 'Finished calculating lbfs at ' + str(time_utils.getTime())
        np.savez(lbf_fn, lbf=lbf, lbf_dot=lbf_dot, lbf_dot_dot=lbf_dot_dot, time=time)
    
    # calculate MRT rates
    evals,evecs = utils.sorted_eig(hamiltonian[:6,:6])
    
    exciton_reorg_energies = np.array([os.exciton_reorg_energy(exciton, site_reorg_energies) for exciton in evecs])
    # print evals - exciton_reorg_energies
    # evals,evecs = utils.sort_evals_evecs(evals-exciton_reorg_energies, evecs)
    # print evals
    
    # MRT_rates2 = os.modified_redfield_rates_general_unordered(evals-exciton_reorg_energies, evecs, lbf, lbf_dot, lbf_dot_dot, total_site_reorg_energy, temperature, time)
Exemplo n.º 14
0
temperature = 300.
init_state = np.array([[1., 0], [0, 0]])

hs = HierarchySolver(system_hamiltonian, 1., cutoff_freq, temperature)

# error function for least squares fit
def residuals(p, y, pops1, pops2):
        k12, k21 = p
        return y - (-k12*pops1 + k21*pops2)

print '[Calculating Forster rates...]'
print 'Started at: ' + str(time_utils.getTime())
for i,v in enumerate(reorg_energy_values):
    #print 'Calculating rates for reorg energy: ' + str(v)
    forster_time = np.linspace(0, 20., 16000)
    lbf = os.site_lbf_ed(forster_time, os.lbf_coeffs(v, cutoff_freq, temperature, None, 5))
    forster_rates[i] = os.forster_rate(100., 0, v, v, lbf, lbf, 0, 0, np.array([1., 0]), np.array([0, 1.]), system_hamiltonian, forster_time)
print 'Finished at: ' + str(time_utils.getTime())
    
def calculate_HEOM(reorg_energy):
    system_hamiltonian = np.array([[100., 20.], [20., 0]])
    cutoff_freq = 53.
    temperature = 300.
    init_state = np.array([[1., 0], [0, 0]])
    
    time_step = 0.00005
    duration = 5.

    hs = HierarchySolver(system_hamiltonian, reorg_energy, cutoff_freq, temperature)
    HEOM_history, time = hs.hierarchy_time_evolution(init_state, 18, time_step, duration)
    return HEOM_history
                                total_site_reorg_energy, total_site_reorg_energy, total_site_reorg_energy, total_site_reorg_energy*1.5])
cutoff_freq = 40.
temperature = 77.
mode_damping = 10.
time = np.linspace(0,10,1000000) # need loads of time steps to get MRT rates to converge

lbf_fn = '../../data/PSIIRC_lbfs_' + str(int(temperature)) + 'K_data4.npz'
try:
    data = np.load(lbf_fn)
    lbf = data['lbf']
    lbf_dot = data['lbf_dot']
    lbf_dot_dot = data['lbf_dot_dot']
    time = data['time']
except IOError:
    print 'Starting lbf calculations at ' + str(time_utils.getTime())
    lbf_coeffs = os.lbf_coeffs(site_drude_reorg_energy, cutoff_freq, temperature, mode_params(mode_damping), 100)
    lbf = os.site_lbf_ed(time, lbf_coeffs)
    lbf_dot = os.site_lbf_dot_ed(time, lbf_coeffs)
    lbf_dot_dot = os.site_lbf_dot_dot_ed(time, lbf_coeffs)
    print 'Finished calculating lbfs at ' + str(time_utils.getTime())
    np.savez(lbf_fn, lbf=lbf, lbf_dot=lbf_dot, lbf_dot_dot=lbf_dot_dot, time=time)

# calculate MRT rates
evals,evecs = utils.sorted_eig(hamiltonian)

exciton_reorg_energies = np.array([os.exciton_reorg_energy(exciton, site_reorg_energies) for exciton in evecs])
# print evals - exciton_reorg_energies
# evals,evecs = utils.sort_evals_evecs(evals-exciton_reorg_energies, evecs)
# print evals

reorgs = np.array([total_site_reorg_energy, total_site_reorg_energy, total_site_reorg_energy,\