示例#1
0
def correlation_es(H, rho0, tlist, taulist, c_op_list, a_op, b_op):
    """
    Internal function for calculating correlation functions using the 
    exponential series solver. See :func:`correlation` usage.
    """
    
    # contruct the Liouvillian
    L = liouvillian(H, c_op_list)

    if rho0 == None:
        rho0 = steady(L)

    C_mat = zeros([size(tlist),size(taulist)],dtype=complex)

    solES_t = ode2es(L, rho0)

    for t_idx in range(len(tlist)):

        rho_t = esval_op(solES_t, [tlist[t_idx]])

        solES_tau = ode2es(L, b_op * rho_t)

        C_mat[t_idx, :] = esval(expect(a_op, solES_tau), taulist)
   
    return C_mat
示例#2
0
def correlation_es(H, rho0, tlist, taulist, c_op_list, a_op, b_op):
    """
    Internal function for calculating correlation functions using the 
    exponential series solver. See :func:`correlation` usage.
    """

    # contruct the Liouvillian
    L = liouvillian(H, c_op_list)

    if rho0 == None:
        rho0 = steady(L)

    C_mat = zeros([size(tlist), size(taulist)], dtype=complex)

    solES_t = ode2es(L, rho0)

    for t_idx in range(len(tlist)):

        rho_t = esval_op(solES_t, [tlist[t_idx]])

        solES_tau = ode2es(L, b_op * rho_t)

        C_mat[t_idx, :] = esval(expect(a_op, solES_tau), taulist)

    return C_mat
示例#3
0
def spectrum_ss(H, wlist, c_op_list, a_op, b_op):
    """
    Calculate the spectrum corresponding to a correlation function
    :math:`\left<A(\\tau)B(0)\\right>`, i.e., the Fourier transform of the
    correlation function:
    
    .. math::
    
        S(\omega) = \int_{-\infty}^{\infty} \left<A(\\tau)B(0)\\right> e^{-i\omega\\tau} d\\tau.

    Parameters
    ----------
        
    H : :class:`qutip.Qobj`
        system Hamiltonian.
            
    wlist : *list* / *array*    
        list of frequencies for :math:`\\omega`.
           
    c_op_list : list of :class:`qutip.Qobj`
        list of collapse operators.
    
    a_op : :class:`qutip.Qobj`
        operator A.
    
    b_op : :class:`qutip.Qobj`
        operator B.

    Returns
    -------

    spectrum: *array*  
        An *array* with spectrum :math:`S(\omega)` for the frequencies specified
        in `wlist`.
        
    """

    # contruct the Liouvillian
    L = liouvillian(H, c_op_list)

    # find the steady state density matrix and a_op and b_op expecation values
    rho0 = steady(L)

    a_op_ss = expect(a_op, rho0)
    b_op_ss = expect(b_op, rho0)

    # eseries solution for (b * rho0)(t)
    es = ode2es(L, b_op * rho0)
   
    # correlation
    corr_es = expect(a_op, es)

    # covarience
    cov_es = corr_es - real(conjugate(a_op_ss) * b_op_ss)

    # spectrum
    spectrum = esspec(cov_es, wlist)

    return spectrum
示例#4
0
def spectrum_ss(H, wlist, c_op_list, a_op, b_op):
    """
    Calculate the spectrum corresponding to a correlation function
    :math:`\left<A(\\tau)B(0)\\right>`, i.e., the Fourier transform of the
    correlation function:
    
    .. math::
    
        S(\omega) = \int_{-\infty}^{\infty} \left<A(\\tau)B(0)\\right> e^{-i\omega\\tau} d\\tau.

    Parameters
    ----------
        
    H : :class:`qutip.Qobj`
        system Hamiltonian.
            
    wlist : *list* / *array*    
        list of frequencies for :math:`\\omega`.
           
    c_op_list : list of :class:`qutip.Qobj`
        list of collapse operators.
    
    a_op : :class:`qutip.Qobj`
        operator A.
    
    b_op : :class:`qutip.Qobj`
        operator B.

    Returns
    -------

    spectrum: *array*  
        An *array* with spectrum :math:`S(\omega)` for the frequencies specified
        in `wlist`.
        
    """

    # contruct the Liouvillian
    L = liouvillian(H, c_op_list)

    # find the steady state density matrix and a_op and b_op expecation values
    rho0 = steady(L)

    a_op_ss = expect(a_op, rho0)
    b_op_ss = expect(b_op, rho0)

    # eseries solution for (b * rho0)(t)
    es = ode2es(L, b_op * rho0)

    # correlation
    corr_es = expect(a_op, es)

    # covarience
    cov_es = corr_es - real(conjugate(a_op_ss) * b_op_ss)

    # spectrum
    spectrum = esspec(cov_es, wlist)

    return spectrum
示例#5
0
def correlation_ss_ode(H, tlist, c_op_list, a_op, b_op, rho0=None):
    """
    Internal function for calculating correlation functions using the master
    equation solver. See :func:`correlation_ss` usage.
    """

    L = liouvillian(H, c_op_list)
    if rho0 == None:
        rho0 = steady(L)

    return mesolve(H, b_op * rho0, tlist, c_op_list, [a_op]).expect[0]
示例#6
0
def correlation_ss_ode(H, tlist, c_op_list, a_op, b_op, rho0=None):
    """
    Internal function for calculating correlation functions using the master
    equation solver. See :func:`correlation_ss` usage.
    """

    L = liouvillian(H, c_op_list)
    if rho0 == None:
        rho0 = steady(L)

    return mesolve(H, b_op * rho0, tlist, c_op_list, [a_op]).expect[0]
示例#7
0
def correlation_ss_es(H, tlist, c_op_list, a_op, b_op, rho0=None):
    """
    Internal function for calculating correlation functions using the 
    exponential series solver. See :func:`correlation_ss` usage.
    """

    # contruct the Liouvillian
    L = liouvillian(H, c_op_list)

    # find the steady state
    if rho0 == None:
        rho0 = steady(L)

    # evaluate the correlation function
    solC_tau = ode2es(L, b_op * rho0)

    return esval(expect(a_op, solC_tau), tlist)
示例#8
0
def correlation_ss_es(H, tlist, c_op_list, a_op, b_op, rho0=None):
    """
    Internal function for calculating correlation functions using the 
    exponential series solver. See :func:`correlation_ss` usage.
    """

    # contruct the Liouvillian
    L = liouvillian(H, c_op_list)

    # find the steady state
    if rho0 == None:
        rho0 = steady(L)

    # evaluate the correlation function
    solC_tau = ode2es(L, b_op * rho0)

    return esval(expect(a_op, solC_tau), tlist)