lime/spo/NAMD_2D.py
def gauss_x_2d(sigma, x0, y0, kx0, ky0):
    """
    generate the gaussian distribution in 2D grid
    :param x0: float, mean value of gaussian wavepacket along x
    :param y0: float, mean value of gaussian wavepacket along y
    :param sigma: float array, covariance matrix with 2X2 dimension
    :param kx0: float, initial momentum along x
    :param ky0: float, initial momentum along y
    :return: gauss_2d: float array, the gaussian distribution in 2D grid
    """
    gauss_2d = np.zeros((len(x), len(y)))

    for i in range(len(x)):
        for j in range(len(y)):
            delta = np.dot(np.array([x[i]-x0, y[j]-y0]), inv(sigma))\
                      .dot(np.array([x[i]-x0, y[j]-y0]))
            gauss_2d[i, j] = (np.sqrt(det(sigma))
                              * np.sqrt(np.pi) ** 2) ** (-0.5) \
                              * np.exp(-0.5 * delta + 1j
                                       * np.dot(np.array([x[i], y[j]]),
                                                  np.array([kx0, ky0])))

    return gauss_2d

    generate the gaussian distribution in 2D grid
    :param x0: float, mean value of gaussian wavepacket along x
    :param y0: float, mean value of gaussian wavepacket along y
    :param sigma: float array, covariance matrix with 2X2 dimension
    :param kx0: float, initial momentum along x
    :param ky0: float, initial momentum along y
    :return: gauss_2d: float array, the gaussian distribution in 2D grid
    
generate the gaussian distribution in 2D grid
generate the gaussian distribution in 2D grid
def gauss_x_2d(sigma, x0, y0, kx0, ky0):
    gauss_2d = np.zeros((len(x), len(y)))
    for i in range(len(x)):
        for j in range(len(y)):
            delta = np.dot(np.array([x[i]-x0, y[j]-y0]), inv(sigma))\
                      .dot(np.array([x[i]-x0, y[j]-y0]))
            gauss_2d[i, j] = (np.sqrt(det(sigma))
                              * np.sqrt(np.pi) ** 2) ** (-0.5) \
                              * np.exp(-0.5 * delta + 1j
                                       * np.dot(np.array([x[i], y[j]]),
                                                  np.array([kx0, ky0])))
    return gauss_2d
def gauss_x_2d ( sigma , x0 , y0 , kx0 , ky0 ) : gauss_2d = np . zeros ( ( len ( x ) , len ( y ) ) ) for i in range ( len ( x ) ) : for j in range ( len ( y ) ) : delta = np . dot ( np . array ( [ x [ i ] - x0 , y [ j ] - y0 ] ) , inv ( sigma ) ) . dot ( np . array ( [ x [ i ] - x0 , y [ j ] - y0 ] ) ) gauss_2d [ i , j ] = ( np . sqrt ( det ( sigma ) ) * np . sqrt ( np . pi ) ** 2 ) ** ( - 0.5 ) * np . exp ( - 0.5 * delta + 1j * np . dot ( np . array ( [ x [ i ] , y [ j ] ] ) , np . array ( [ kx0 , ky0 ] ) ) ) return gauss_2d
generate the gaussian distribution in 2D grid
generate the gaussian distribution in 2D grid
"""
    generate the gaussian distribution in 2D grid
    :param x0: float, mean value of gaussian wavepacket along x
    :param y0: float, mean value of gaussian wavepacket along y
    :param sigma: float array, covariance matrix with 2X2 dimension
    :param kx0: float, initial momentum along x
    :param ky0: float, initial momentum along y
    :return: gauss_2d: float array, the gaussian distribution in 2D grid
    """
float array, the gaussian distribution in 2D grid
float array the gaussian distribution in 2D grid
sigma
float array, covariance matrix with 2X2 dimension
float array covariance matrix with 2X2 dimension
x0
float, mean value of gaussian wavepacket along x
float mean value of gaussian wavepacket along x
y0
float, mean value of gaussian wavepacket along y
float mean value of gaussian wavepacket along y
kx0
float, initial momentum along x
float initial momentum along x
ky0
float, initial momentum along y
float initial momentum along y