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$ enter image description here.


1 Answer 1


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.

  • $\begingroup$ 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. $\endgroup$ Dec 10, 2022 at 3:06
  • $\begingroup$ @WhatsupAndThanks: I'd say not directly, Fourier requires periodicity. But you can rearrange the inhomogeneous BCs to homogeneous ones using e.g. this approach. $\endgroup$
    – davidhigh
    Dec 10, 2022 at 8:53
  • $\begingroup$ @WhatsupAndThanks: See also my edit. $\endgroup$
    – davidhigh
    Dec 10, 2022 at 9:27
  • $\begingroup$ That helps a lot. I googled more based on your edit, and found that they call the ansatz as the shifting of data when used for heat equation with inhomo-dirichlet too. One more question, the sine-transform using FFT often transform from real to complex/ or real to real, but the wave function is complex valued, so I am confused how we obtain c_n(t) for Eq. 1. $\endgroup$ Dec 10, 2022 at 16:18
  • $\begingroup$ @WhatsupAndThanks: Reconsidering my answer, it's maybe a bit too constructive. The story can be shortened: The eigenfunctions of the Laplacian are sines and cosines. If you have certain symmetries (like even parity symmetry), you can pick your eigenfunctions as sines only (resp. cosines for odd symmetry). Otherwise you have to use both function sets. Now your question: the coefficients can be chosen real w.l.o.g. (a complex phase does not change the physics). This is why in the sine transform, you get around with one vector only, whereas you need two vectors in general. $\endgroup$
    – davidhigh
    Dec 10, 2022 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.