print hs.system_dimension ** 2 * hs.number_density_matrices() print "Calculating time evolution..." start = tutils.getTime() init_state = np.array([[1.0, 0], [0, 0]]) # init_state = np.dot(hs.system_evectors.T, np.dot(init_state, hs.system_evectors)) # print init_state hs.init_system_dm = init_state hs.truncation_level = 11 dm_history, time = hs.calculate_time_evolution(time_step, duration) # exciton_dm_history = hs.transform_to_exciton_basis(dm_history) end = tutils.getTime() print "Calculation took " + str(tutils.duration(end, start)) # convert time in inverse wavenums to picoseconds time /= utils.WAVENUMS_TO_INVERSE_PS plt.subplot(121) plt.plot(time, [dm[0, 0] for dm in dm_history], linewidth=2) # plt.plot(time, [dm[1,1] for dm in dm_history], linewidth=2) plt.ylim(0.3, 1) plt.xlim(0, 1) plt.subplot(122) plt.plot(time, np.abs([dm[0, 1] for dm in dm_history]), linewidth=2) plt.show() # print 'Calculating steady state...' # start = tutils.getTime()
jump_operators=jump_operators, jump_rates=jump_rates) # start_time = tutils.getTime() # print 'Calculating steady state...' # steady_state = hs.calculate_steady_state(6,6) # print steady_state # # end_time = tutils.getTime() # print 'Calculation took ' + str(tutils.duration(end_time, start_time)) start_time = tutils.getTime() print 'Calculating time evolution...' dm_history, time = hs.hierarchy_time_evolution(np.array([[0, 0, 0, 0], [0, 1., 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]), 8, 8, 0.005, 15., sparse=True) end_time = tutils.getTime() print 'Calculation took ' + str(tutils.duration(end_time, start_time)) print time.shape print dm_history.shape for i in range(4): plt.plot(time[:-1], dm_history[:, i, i], label=i) plt.legend() plt.show()
temperature = 300. mode_params = []#[(342., 342.*0.4, 100.)] hs = HierarchySolver(system_hamiltonian, reorg_energy, cutoff_freq, temperature, underdamped_mode_params=mode_params) init_state = np.zeros(system_hamiltonian.shape) init_state[0,0] = 1. # exciton basis init_state = np.dot(hs.system_evectors, np.dot(init_state, hs.system_evectors.T)) # transform to site basis for HEOM calculation #dm_history, time = hs.converged_time_evolution(init_state, 6, 6, time_step, duration) hs.init_system_dm = init_state hs.truncation_level = 8 dm_history, time = hs.calculate_time_evolution(time_step, duration) exciton_dm_history = hs.transform_to_exciton_basis(dm_history) end_time = tutils.getTime() print 'Calculation took ' + str(tutils.duration(end_time, start_time)) # print 'Calculating steady state...' # start_time = tutils.getTime() # # steady_state = hs.calculate_steady_state(8,8) # exciton_steady_state = np.dot(hs.system_evectors.T, np.dot(steady_state, hs.system_evectors)) # # end_time = tutils.getTime() # print 'Calculation took ' + str(tutils.duration(end_time, start_time)) # print 'Exciton steady state trace: ' + str(np.trace(exciton_steady_state)) # # print steady_state # print exciton_steady_state print 'Saving data...'
environment = [(OBOscillator(reorg_energy, cutoff_freq, beta, K=K),), (OBOscillator(reorg_energy, cutoff_freq, beta, K=K),)] hs = HierarchySolver(system_hamiltonian, environment, beta, num_matsubara_freqs=K, temperature_correction=True) hs.truncation_level = 12 print 'Calculating time evolution...' start = tutils.getTime() init_state = np.array([[0,0],[0,1.]]) init_state = np.dot(hs.system_evectors.T, np.dot(init_state, hs.system_evectors)) hs.init_system_dm = init_state dm_history, time = hs.calculate_time_evolution(time_step, duration) exciton_dm_history = hs.transform_to_exciton_basis(dm_history) end = tutils.getTime() print 'Calculation took ' + str(tutils.duration(end, start)) # convert time in inverse wavenums to picoseconds time /= utils.WAVENUMS_TO_INVERSE_PS ax1.plot(time, [dm[0,0] for dm in exciton_dm_history], linewidth=1, color='k', label='no mode') damping_values = [0.0001, 0.4, 2., 10., 50.] colours = ['k', 'r', '#7b2fb6', '#279a08', '#f38f3f'] linestyles = ['--', '-', '-', '-', '-'] labels = [r'Qmode ($\gamma = 0$)', r'$\gamma = 0.2$', r'$\gamma = 1$', r'$\gamma = 5$', r'$\gamma = 25$'] colours.reverse() linestyles.reverse() labels.reverse()
(OBOscillator(reorg_energy, cutoff_freq, beta, K=K),)] hs = HierarchySolver(system_hamiltonian, environment, beta, num_matsubara_freqs=K, temperature_correction=False) #hs = HierarchySolverNonRenorm(system_hamiltonian, environment, beta, num_matsubara_freqs=K, temperature_correction=False) hs.truncation_level = 30 print 'Calculating time evolution...' start = tutils.getTime() init_state = np.array([[1.,0],[0,0]]) #init_state = np.dot(hs.system_evectors.T, np.dot(init_state, hs.system_evectors)) hs.init_system_dm = init_state dm_history, time = hs.calculate_time_evolution(time_step, duration) #exciton_dm_history = hs.transform_to_exciton_basis(dm_history) end = tutils.getTime() print 'Calculation took ' + str(tutils.duration(end, start)) # convert time in inverse wavenums to picoseconds time /= utils.WAVENUMS_TO_INVERSE_PS fig,(ax1,ax2) = plt.subplots(1, 2) #plt.subplot(121) ax1.plot(time, [dm[0,0] for dm in dm_history], linewidth=2) #plt.plot(time, [dm[1,1] for dm in dm_history], linewidth=2) ax1.set_ylim(0.3, 1.0) ax1.set_xlim(0,1) ax1.yaxis.set_minor_locator(AutoMinorLocator()) #plt.subplot(122) ax2.plot(time, np.abs([dm[0,1] for dm in dm_history]), linewidth=2)