lime/signal/sos.py
def TPA2D(E, dip, omegaps, omega1s, g_idx, e_idx, f_idx, gamma):
    """
    2D two-photon-absorption signal with classical light scanning the omegap = omega1 + omega2 and omega1
    """

    g = 0

    signal = np.zeros((len(omegaps), len(omega1s)))

    for i, omegap in enumerate(omegaps):

        for j, omega1 in enumerate(omega1s):

            omega2 = omegap - omega1

            for f in f_idx:

                tmp = 0.

                for m in e_idx:

                     tmp += dip[f, m] * dip[m, g] * ( 1./(omega1 - (E[m] - E[g]) + 1j * gamma[m])\
                      + 1./(omega2 - (E[m] - E[g]) + 1j * gamma[m]) )

                signal[i,j] += np.abs(tmp)**2 * lorentzian(omegap - E[f] + E[g], width=gamma[f])

    return signal

    2D two-photon-absorption signal with classical light scanning the omegap = omega1 + omega2 and omega1
    
2D two-photon-absorption signal with classical light scanning the omegap = omega1 + omega2 and omega1
2D two - photon - absorption signal with classical light scanning the omegap = omega1 + omega2 and omega1
def TPA2D(E, dip, omegaps, omega1s, g_idx, e_idx, f_idx, gamma):
    g = 0
    signal = np.zeros((len(omegaps), len(omega1s)))
    for i, omegap in enumerate(omegaps):
        for j, omega1 in enumerate(omega1s):
            omega2 = omegap - omega1
            for f in f_idx:
                tmp = 0.
                for m in e_idx:
                     tmp += dip[f, m] * dip[m, g] * ( 1./(omega1 - (E[m] - E[g]) + 1j * gamma[m])\
                      + 1./(omega2 - (E[m] - E[g]) + 1j * gamma[m]) )
                signal[i,j] += np.abs(tmp)**2 * lorentzian(omegap - E[f] + E[g], width=gamma[f])
    return signal
def TPA2D ( E , dip , omegaps , omega1s , g_idx , e_idx , f_idx , gamma ) : g = 0 signal = np . zeros ( ( len ( omegaps ) , len ( omega1s ) ) ) for i , omegap in enumerate ( omegaps ) : for j , omega1 in enumerate ( omega1s ) : omega2 = omegap - omega1 for f in f_idx : tmp = 0. for m in e_idx : tmp += dip [ f , m ] * dip [ m , g ] * ( 1. / ( omega1 - ( E [ m ] - E [ g ] ) + 1j * gamma [ m ] ) + 1. / ( omega2 - ( E [ m ] - E [ g ] ) + 1j * gamma [ m ] ) ) signal [ i , j ] += np . abs ( tmp ) ** 2 * lorentzian ( omegap - E [ f ] + E [ g ] , width = gamma [ f ] ) return signal
2D two-photon-absorption signal with classical light scanning the omegap = omega1 + omega2 and omega1
2D two - photon - absorption signal with classical light scanning the omegap = omega1 + omega2 and omega1
"""
    2D two-photon-absorption signal with classical light scanning the omegap = omega1 + omega2 and omega1
    """
E
dip
omegaps
omega1s
g_idx
e_idx
f_idx
gamma