# Free Time Dependent Schrodinger Equation with Inhomogeneous Dirichlet boundary

There exists a FFT-based method to solve the poisson equation in inhomogeneous Dirichlet boundary condition using the sine-transform. For example, Which fourier series is needed to solve a 2D poisson problem with mixed boundary conditions using Fast Fourier Transform?

I expect similar approach could be applied to Schrodinger equation, since they both have a Laplacian operator. After looking around, I failed to find a similar method to solve the Free Schrodinger equation with Dirichlet boundary condition. So either such method is not possible, since wave function is complex valued, or I must miss some of the papers.

Is there a FFT/DFT-based numerical method that can solve the Free Schrodinger equation with inhomogeneous Dirichlet Boundary condition?

Update based on the answer, and also one of the answer from Testing the time dependent Schrodinger Equation with an analytical solution? we could solve the following with inhomogeneous BC $$u_t = iu_{xx}\\ u(x,0) = u_0\\ u(0,t)=a(t)\\ u(L,t)=b(t)$$
by performing a shifting data $$v=u-\eta$$ to form a homogeneous problem where $$\eta=(1-x/L)a+bx/L$$. Note that $$a$$ and $$b$$ are complex values, and are often changing with time.

$$v_t = iv_{xx}\\ v(x,0) = v_0\\ v(0,t)=0\\ v(L,t)=0$$

The problem now can be solved using the FFT/DFT sine-transform. However, in my 1D Gaussian wave test, I found that the solution has numerical oscillations (green). Does anyone know how could we reduce the numerical oscillations when using the sine-transform based method? Note: y-axis is $$|u|^2$$ .

The TDSE is given by $$i\partial_t|\phi(t)\rangle = \hat H |\phi(t)\rangle\,.$$

Expanding the wavefunction $$|\phi \rangle$$ into a set of eigenfunctions of the Hamiltonian, $$\hat H |\psi_i\rangle = E_i |\psi_i\rangle\,,$$ one gets \begin{align} |\phi(t)\rangle = \sum_n c_n(t) |\psi_n\rangle\,.\tag{1}\label{1} \end{align}

Insertion into the TDSE yields a decoupled set of one-dimensional equations $$i {\dot c}_n(t) = c_n(t_0)\; e^{-iE_n (t-t_0)} \tag{2}\label{2}$$ which only depend on the system's eigenenergies and the initial coefficients at time $$t_0$$.

Now, the case of Dirichlet boundary conditions in 1D (wavefunction at $$\pm L/2$$) is well known as the "particle-in-a-box" model. The eigennergies and -functions (in position representation) can be calculated analytically as

$$E_n = \frac{\hbar^2 k_n^2}{2m}\,, \quad k_n=\frac{n \pi}{ L}\,\\ \psi_n(x,t) = \begin{cases} A \sin\left(k_n \left(x-x_c+\tfrac{L}{2}\right)\right) e^{-i\omega_n t}\quad & x_c-\tfrac{L}{2} < x < x_c+\tfrac{L}{2}\\ 0 & \text{otherwise} \end{cases}$$

With this one observes that one procedure for solving the TDSE is the following: Given an initial condition $$\psi_0(x)$$ satisfying the Dirichlet conditions, obtain the expansion coefficients in Eq. (\ref{1}). Once you have found them, the solution to the TDSE can be obtained exactly in the chosen basis according to Eq. (\ref{2}).

Now, the first step, finding the coefficients in a series of $$\sin(nx)$$, is exactly what the sine-transform is going to give you. And as usual, a fast sine-transform can be obtained via the FFT. So yes, the TDSE with Dirichlet conditions can be solved via the FFT.

The above is usually considered with homogeneous boundary conditions. If you want inhomogeneous BCs, e.g. $$\psi(-L/2) = 0$$, $$\psi(L/2) = a$$, you can make the following ansatz to your wavefunction: $$\phi(x,t) = g(x) + \eta(x,t)$$ where $$g(x)$$ is a straight line satisfying the Dirichlet BCs, and $$\eta(x,t)$$ satisfies homogeneous BCs.

In the example above, you would have to expand the linear function $$g(x)$$ in the Fourier basis series, which corresponds to the fourier series of a sawtooth wave. This will then further introduce cosine terms, and thus require a full Fourier transform instead of a sine transform, but it'll work as well.

EDIT2: and thinking again, in the Fourie setting you can also directly set up the term $$g(x)$$ using cosines ... the concept stays the same, but the function representation is likely easier.

• I suppose this is only applicable to homogenous BC where \psi=0 at both ends. Is it still applicable for inhomogeneous BC where \psi_0=a ,and \psi_N=b, which is more applicable to numerical simulations? We know that sine transforms-based solver for poisson equation in inhume BC exists. Dec 10, 2022 at 3:06
• @WhatsupAndThanks: I'd say not directly, Fourier requires periodicity. But you can rearrange the inhomogeneous BCs to homogeneous ones using e.g. this approach. Dec 10, 2022 at 8:53