lime/spo/SPO_1D_NAMD.py
def evolve(x, v, psi0, dt, nt=1, t0=0.):
    """
    Perform a series of time-steps via the time-dependent
    Schrodinger Equation.

    Parameters
    ----------
    dt : float
        the small time interval over which to integrate
    Nsteps : float, optional
        the number of intervals to compute.  The total change
        in time at the end of this method will be dt * Nsteps.
        default is N = 1
    """

    f = open('density_matrix.dat', 'w')
    t = t0
    psi_x = psi0
    dt2 = 0.5 * dt
    
    N = len(x)
    dx = interval(x)

    k = scipy.fftpack.fftfreq(N, dx)
    k[:] = 2.0 * np.pi * k[:]


    # SPO propagation
    x_evolve(dt2, x, v, psi_x)

    for i in range(nt - 1):

        t += dt

        k_evolve(dt, k, psi_x)
        x_evolve(dt, x, v, psi_x)

        # rho = density_matrix(psi_x, dx)
        # f.write('{} {} {} {} {} \n'.format(t, *rho))

    k_evolve(dt, k, psi_x)
    x_evolve(dt2, x, V_x, psi_x)

    t += dt
    f.close()

    return psi_x

    Perform a series of time-steps via the time-dependent
    Schrodinger Equation.

    Parameters
    ----------
    dt : float
        the small time interval over which to integrate
    Nsteps : float, optional
        the number of intervals to compute.  The total change
        in time at the end of this method will be dt * Nsteps.
        default is N = 1
    
Perform a series of time-steps via the time-dependent
Schrodinger Equation.

Parameters

dt : float
the small time interval over which to integrate
Nsteps : float, optional
the number of intervals to compute.  The total change
in time at the end of this method will be dt * Nsteps.
default is N = 1
Perform a series of time - steps via the time - dependent Schrodinger Equation . Parameters dt : float the small time interval over which to integrate Nsteps : float optional the number of intervals to compute . The total change in time at the end of this method will be dt * Nsteps . default is N = 1
def evolve(x, v, psi0, dt, nt=1, t0=0.):
    f = open('density_matrix.dat', 'w')
    t = t0
    psi_x = psi0
    dt2 = 0.5 * dt
    N = len(x)
    dx = interval(x)
    k = scipy.fftpack.fftfreq(N, dx)
    k[:] = 2.0 * np.pi * k[:]
    x_evolve(dt2, x, v, psi_x)
    for i in range(nt - 1):
        t += dt
        k_evolve(dt, k, psi_x)
        x_evolve(dt, x, v, psi_x)
    k_evolve(dt, k, psi_x)
    x_evolve(dt2, x, V_x, psi_x)
    t += dt
    f.close()
    return psi_x
def evolve ( x , v , psi0 , dt , nt = 1 , t0 = 0. ) : f = open ( 'density_matrix.dat' , 'w' ) t = t0 psi_x = psi0 dt2 = 0.5 * dt N = len ( x ) dx = interval ( x ) k = scipy . fftpack . fftfreq ( N , dx ) k [ : ] = 2.0 * np . pi * k [ : ] x_evolve ( dt2 , x , v , psi_x ) for i in range ( nt - 1 ) : t += dt k_evolve ( dt , k , psi_x ) x_evolve ( dt , x , v , psi_x ) k_evolve ( dt , k , psi_x ) x_evolve ( dt2 , x , V_x , psi_x ) t += dt f . close ( ) return psi_x
Perform a series of time-steps via the time-dependent
Schrodinger Equation.
Perform a series of time - steps via the time - dependent Schrodinger Equation .
"""
    Perform a series of time-steps via the time-dependent
    Schrodinger Equation.

    Parameters
    ----------
    dt : float
        the small time interval over which to integrate
    Nsteps : float, optional
        the number of intervals to compute.  The total change
        in time at the end of this method will be dt * Nsteps.
        default is N = 1
    """ # SPO propagation # rho = density_matrix(psi_x, dx) # f.write('{} {} {} {} {} \n'.format(t, *rho))
x
v
psi0
dt
nt
t0