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$ .