Example #1
0
def liouvillian_time_evolution(init_density_vector, liouvillian, duration, timestep, trace_basis=None, wave_nums=True):
    
    if wave_nums:
        liouvillian = utils.hamiltonian_to_picosecs(liouvillian)
        
    timestep_operator = la.expm(liouvillian*timestep)
    density_vector = init_density_vector
    dv_history = []
    dv_history.append(density_vector)
    
    for step in range(int(duration/timestep)):
        density_vector = np.dot(timestep_operator, density_vector)
        dv_history.append(density_vector)

    return np.array(dv_history)
Example #2
0
def von_neumann_eqn(init_density_matrix, hamiltonian, duration, timestep, trace_basis=None, wave_nums=True):

    if wave_nums:
        hamiltonian = utils.hamiltonian_to_picosecs(hamiltonian)

    timestep_operator = la.expm(-1j*hamiltonian*timestep)
    timestep_operator_dagger = timestep_operator.conj().T
    density_matrix = init_density_matrix
    dm_history = []
    if trace_basis:
        dm_history.append(utils.partial_trace(density_matrix, trace_basis))
    else:
        dm_history.append(density_matrix) 

    for step in range(int(duration/timestep)):
        density_matrix = np.dot(np.dot(timestep_operator, density_matrix), timestep_operator_dagger)
        if trace_basis:
            dm_history.append(utils.partial_trace(density_matrix, trace_basis))
        else:
            dm_history.append(density_matrix)

    return np.array(dm_history)