1 Introduction

The nonlinear Schrödinger (NLS) equation has been used extensively in underwater acoustics, quantum mechanics, plasma physics, nonlinear optics, electromagnetic wave propagation, etc. [14]. In this paper, we consider the following 3D Schrödinger equation:

$$\begin{aligned} i\frac{\partial u}{\partial t}=-a(u_{xx}+u_{yy}+u_{zz})+ \beta \vert u \vert ^{2}u+v(x,y,z)u,\quad (x,y,z,t)\in\Omega\times(0,T], \end{aligned}$$
(1.1)

with the initial and boundary conditions

$$\begin{aligned} &u(x,y,z,0)=u_{0}(x,y,z),\quad (x,y,z)\in\Omega, \end{aligned}$$
(1.2)
$$\begin{aligned} &u(x,y,z,t)=0, \quad(x,y,z)\in \partial\Omega, t\in(0,T], \end{aligned}$$
(1.3)

where \(u=u(x,y,z,t)\) is a complex-valued function, \(v(x,y,z)\) is an arbitrary real-valued potential function, a and β are real constants. Here, we suppose \(\Omega=[L_{1},L_{2}]^{3}\), Ω is the boundary of Ω, \(u_{0}\) is a given sufficiently smooth function, and \(i=\sqrt{-1}\). There have been different kinds of numerical methods on the solution for various Schrödinger equations [510]. For example, Bao and Cai [11] established uniform error estimates of finite difference methods for the NLS equation perturbed by the wave operator. Chang et al. [12] studied several finite difference schemes and compared them for the generalized NLS equation. Kurkinaitis and Ivanauskas [13] investigated several types of finite difference schemes for solving a system of the NLS equations. Besides, Sulem et al. [14] proposed several finite difference schemes, including spectral method, to study the singular solutions to the two-dimensional cubic NLS equations.

In the past years, high-order compact (HOC) methods, which feature high-order accuracy and smaller stencils, have been proposed to solve multi-dimensional partial differential equations [1518]. For the 2D Schrödinger equations, Wang et al. [19] studied fourth-order compact and energy conservative difference schemes, which are fourth-order in space and second-order in time. Mohebbi and Dehghan [20] developed a compact boundary value method for solving a 2D Schrödinger equation, and this method has fourth-order accuracy in both space and time. Mahdi [21] used a compact finite difference scheme to get fourth-order solution for the 2D unsteady Schrödinger equation.

The alternating direction implicit (ADI) method is widely used to solve the multi-dimensional Schrödinger equations due to its unconditional stability and efficiency in saving CPU time, see for instance Xu and Zhang [22] and the references given there. In order to reduce the computational cost of HOC method, there has been growing work to develop HOC-ADI method. Tian and Yu [23] studied a HOC-ADI method for the solution of the unsteady 2D Schrödinger equation. Gao and Xie [24] proposed a fourth-order ADI compact finite difference scheme for two-dimensional Schrödinger equation. Liao et al. [25] established a compact ADI scheme for solving linear Schrödinger equations. These three articles are second-order in time and fourth-order in space with less computational cost. Li et al. [26] proposed a sixth-order ADI method based on the combined compact method for solving two-dimensional Schrödinger equations. Kong et al. [27] investigated HOC-ADI schemes for the multi-dimensional Schrödinger equations. In [28], Christian Hendricks et al. proposed high-order ADI finite difference schemes for parabolic equations in the combination technique with application in finance. These methods assimilate the advantages of the HOC method and ADI skill. There is very little literature concerning application of the HOC-ADI method to the 3D Schrödinger equation. This paper is just an effort on this subject. In this paper, we apply the standard Douglas–Gunn ADI method and HOC-ADI method to solve the 3D linear Schrödinger (LS) equation. Then, we combine the second-order standard Strang splitting [29] skills with the above methods to solve the 3D nonlinear Schrödinger (NLS) equation.

The rest of our paper is organized as follows: In Sect. 2, we present a standard Douglas–Gunn ADI scheme and a new HOC-ADI scheme for the 3D LS equation, and the stability of the standard Douglas–Gunn ADI scheme and the new HOC-ADI scheme is investigated. In Sect. 3, we develop the Douglas–Gunn ADI splitting scheme and the new HOC-ADI splitting scheme for the 3D NLS equation. In Sect. 4, we present numerical examples and detailed numerical results to verify our theoretical analysis. Finally, the conclusion will be made in Sect. 5.

2 A new high-order compact ADI finite difference scheme for LS equation

In this section, we consider the 3D LS equation by choosing \(\beta=0\) and \(v(x,y,z)=0\) in (1.1):

$$\begin{aligned} i\frac{\partial u}{\partial t}+a(u_{xx}+u_{yy}+u_{zz})=0,\quad (x,y,z,t)\in\Omega\times(0,T], \end{aligned}$$
(2.1)

with the initial and boundary conditions

$$\begin{aligned} &u(x,y,z,0)=u_{0}(x,y,z), \quad (x,y,z)\in\Omega, \end{aligned}$$
(2.2)
$$\begin{aligned} &u(x,y,z,t)=0,\quad (x,y,z)\in\partial\Omega, t\in(0,T], \end{aligned}$$
(2.3)

where \(u_{0}\) is a smooth function. If we discretize the region \(\Omega_{1}=\{(x,y,z,t)|(x,y,z,t)\in[L_{1},L_{2}]^{3}\times[0,T]\}\) with mesh of points with coordinates \(x_{j}=L_{1}+jh, y_{k}=L_{1}+kh, z_{l}=L_{1}+lh\ (h_{x}=h_{y}=h_{z}=h)\), \(j=k=l=0,1,\ldots,M\), \(t_{n}=n\tau\), \(n=0,1,\ldots,N\), where \(h=\frac{L_{2}-L_{1}}{M}\) and \(\tau=\frac{T}{N}\) are mesh sizes and time step, respectively. Let \(u_{jkl}^{n}\) be the approximation of \(u(x_{j},y_{k},z_{l},t_{n})\). Applying Crank–Nicolson implicit discretization to (2.1), we have

$$\begin{aligned} \frac{u_{jkl}^{n+1}-u_{jkl}^{n}}{\tau}- \frac{a}{2}i\bigl(\delta_{x}^{2}+ \delta_{y}^{2}+\delta_{z}^{2}\bigr) \bigl(u_{jkl}^{n+1}+u_{jkl}^{n}\bigr)=0, \end{aligned}$$
(2.4)

where \(\delta_{x}^{2}u_{jkl}^{n}=(u_{j+1,kl}^{n}-2u_{jkl}^{n}+u_{j-1,kl}^{n})/h^{2}\), and \(\delta_{y}^{2}u_{jkl}^{n}\), \(\delta_{z}^{2}u_{jkl}^{n}\) are defined similarly. It is easy to see that (2.4) has second-order accuracy both in space and time.

Adding the term

$$\begin{aligned} \biggl[\frac{\tau}{4}a^{2}i^{2}\bigl( \delta_{x}^{2}\delta_{y}^{2}+\delta _{x}^{2}\delta_{z}^{2}+ \delta_{y}^{2}\delta_{z}^{2}\bigr)- \frac{\tau^{2}}{8}a^{3}i^{3}\delta _{x}^{2} \delta_{y}^{2}\delta_{z}^{2} \biggr] \bigl(u_{jkl}^{n+1}-u_{jkl}^{n}\bigr) \end{aligned}$$

to the left-hand side of (2.4), we get a second-order scheme

$$\begin{aligned} &\biggl(1-\frac{\tau}{2}ai\delta_{x}^{2} \biggr) \biggl(1-\frac{\tau }{2}ai\delta_{y}^{2} \biggr) \biggl(1- \frac{\tau}{2}ai\delta_{z}^{2} \biggr) \bigl(u_{jkl}^{n+1}-u_{jkl}^{n}\bigr) \\ &\quad=\tau ai\bigl(\delta_{x}^{2}+\delta_{y}^{2}+ \delta_{z}^{2}\bigr)u_{jkl}^{n}. \end{aligned}$$
(2.5)

Introducing three intermediate variables \(\Delta u^{*}\), \(\Delta u^{**}\), and Δu, we obtain the following second-order standard Douglas–Gunn ADI scheme (D–G ADI scheme):

$$\begin{aligned} & \biggl(1-\frac{\tau}{2}ai\delta_{x}^{2} \biggr)\Delta u_{jkl}^{*}=\tau ai\bigl(\delta_{x}^{2}+ \delta_{y}^{2}+\delta_{z}^{2} \bigr)u_{jkl}^{n}, \end{aligned}$$
(2.6a)
$$\begin{aligned} & \biggl(1-\frac{\tau}{2}ai\delta_{y}^{2} \biggr)\Delta u_{jkl}^{**}=\Delta u_{jkl}^{*}, \end{aligned}$$
(2.6b)
$$\begin{aligned} & \biggl(1-\frac{\tau}{2}ai\delta_{z}^{2} \biggr)\Delta u_{jkl}=\Delta u_{jkl}^{**}, \end{aligned}$$
(2.6c)
$$\begin{aligned} &u_{jkl}^{n+1}-u_{jkl}^{n}=\Delta u_{jkl}. \end{aligned}$$
(2.6d)

We note that the intermediate values of \(\Delta u^{**}\) and \(\Delta u^{*}\) at the boundary are easily obtained by (2.6c) and (2.6b).

Theorem 1

Suppose that the exact solution u of problem (2.1) is smooth enough, then the truncation order of the D–G ADI scheme (2.6a)(2.6d) is \(O(\tau^{2}+h^{2})\).

Proof

Eliminating the intermediate variables in the D–G ADI scheme (2.6a)–(2.6d), we obtain

$$\begin{aligned} &\frac{u_{jkl}^{n+1}-u_{jkl}^{n}}{\tau}-\frac{a}{2}i\bigl(\delta_{x}^{2}+ \delta_{y}^{2}+\delta_{z}^{2}\bigr) \bigl(u_{jkl}^{n+1}+u_{jkl}^{n}\bigr)+ \biggl[\frac{\tau^{2}}{4}a^{2}i^{2}\bigl(\delta_{x}^{2} \delta_{y}^{2}+ \delta_{x}^{2} \delta_{z}^{2}+ \delta_{y}^{2} \delta_{z}^{2}\bigr) \\ &\quad{}-\frac{\tau^{3}}{8}a^{3}i^{3}\delta_{x}^{2} \delta_{y}^{2}\delta _{z}^{2} \biggr] \frac{u_{jkl}^{n+1}-u_{jkl}^{n}}{\tau}=0. \end{aligned}$$

By the Taylor expansion, it is easy to check that the truncation error of the above scheme is

$$\begin{aligned} R_{jkl}^{n+\frac{1}{2}}={}& \biggl(\frac{1}{24}\tau^{2} \frac{\partial^{3} u}{\partial t^{3}}-\frac{ai}{8}\tau^{2} \biggl(\frac{\partial^{4} u}{\partial t^{2}\,\partial x^{2}}+ \frac{\partial^{4} u}{\partial t^{2}\,\partial y^{2}}+\frac{\partial^{4} u}{\partial t^{2}\,\partial z^{2}} \biggr) \\ &{}+\frac{a^{2}i^{2}}{4}\tau^{2} \biggl(\frac{\partial^{5} u}{\partial t\,\partial x^{2}\partial y^{2}}+ \frac{\partial^{5} u}{\partial t\,\partial z^{2}\,\partial x^{2}}+\frac{\partial^{5} u}{\partial t\,\partial y^{2}\,\partial z^{2}} \biggr) \\ &{}-\frac{a^{3}i^{3}}{8}\tau^{3} \biggl(\frac{\partial^{7} u}{\partial t\,\partial x^{2}\,\partial y^{2}\,\partial z^{2}} \biggr) - \frac{ai}{12}h^{2} \biggl(\frac{\partial^{4} u}{\partial x^{4}}+\frac{\partial^{4} u}{\partial y^{4}} \\ &{}+\frac{\partial^{4} u}{\partial z^{4}} \biggr) \biggr) (x_{j},y_{k},z_{l},t_{n+\frac{1}{2}}) +O\bigl(\tau^{4}+\tau^{2}h^{2}+h^{4} \bigr) \\ ={}&O\bigl(\tau^{2}+h^{2}\bigr), \end{aligned}$$

where \(O(h^{2})=O(h_{x}^{2}+h_{y}^{2}+h_{z}^{2})\). This ends the proof.

However, scheme (2.6a)–(2.6d) is only second-order accurate in both space and time, so we want to use the fourth-order compact finite difference method to improve the accuracy of space.

Using the fourth-order accurate compact finite difference space discretization [23] and the Crank–Nicolson time discretization to (2.1), we obtain

$$\begin{aligned} \frac{u_{jkl}^{n+1}-u_{jkl}^{n}}{\tau}-\frac{a}{2}i \biggl(\frac{\delta _{x}^{2}}{1+\frac{h^{2}}{12}\delta_{x}^{2}}+ \frac{\delta_{y}^{2}}{1+\frac{h^{2}}{12}\delta_{y}^{2}}+ \frac{\delta_{z}^{2}}{1+\frac{h^{2}}{12}\delta_{z}^{2}} \biggr) \bigl(u_{jkl}^{n+1}+u_{jkl}^{n} \bigr)=0, \end{aligned}$$
(2.7)

where \(j=k=l=1,2,\ldots,M-1\). For convenience, we define the following finite difference operators:

$$L_{x}=1+\frac{h^{2}}{12}\delta_{x}^{2},\qquad L_{y}=1+\frac{h^{2}}{12}\delta_{y}^{2},\qquad L_{z}=1+\frac{h^{2}}{12}\delta_{z}^{2}. $$

Applying to both sides of (2.7) with the operator \(L_{x}L_{y}L_{z}\), we have

$$\begin{aligned} L_{x}L_{y}L_{z} \biggl(\frac{u_{jkl}^{n+1}-u_{jkl}^{n}}{\tau} \biggr)- \frac{a}{2}i \bigl(L_{y}L_{z} \delta_{x}^{2}+ L_{x}L_{z} \delta_{y}^{2}+ L_{x}L_{y} \delta_{z}^{2} \bigr) \bigl(u_{jkl}^{n+1}+u_{jkl}^{n} \bigr)=0. \end{aligned}$$
(2.8)

Adding the extra term

$$\begin{aligned} \biggl[\frac{\tau}{4}a^{2}i^{2}\bigl(L_{z} \delta_{x}^{2}\delta _{y}^{2}+L_{y} \delta_{x}^{2}\delta_{z}^{2}+ L_{x}\delta_{y}^{2}\delta_{z}^{2} \bigr)-\frac{\tau^{2}}{8}a^{3}i^{3}\delta _{x}^{2} \delta_{y}^{2}\delta_{z}^{2} \biggr] \bigl(u_{jkl}^{n+1}-u_{jkl}^{n}\bigr) \end{aligned}$$

to the left-hand side of (2.8), we get the following scheme:

$$\begin{aligned} &\biggl(L_{x}-\frac{\tau}{2}ai\delta_{x}^{2} \biggr) \biggl(L_{y}-\frac{\tau }{2}ai\delta_{y}^{2} \biggr) \biggl(L_{z}-\frac{\tau}{2}ai\delta_{z}^{2} \biggr) \bigl(u_{jkl}^{n+1}-u_{jkl}^{n} \bigr) \\ &\quad =\tau ai\bigl(L_{y}L_{z}\delta_{x}^{2}+L_{x}L_{z} \delta_{y}^{2}+L_{x}L_{y}\delta _{z}^{2}\bigr)u_{jkl}^{n}. \end{aligned}$$
(2.9)

Introducing the intermediate variables, we obtain the new HOC-ADI scheme

$$\begin{aligned} & \biggl(L_{x}-\frac{\tau}{2}ai\delta_{x}^{2} \biggr)\Delta u_{jkl}^{*}=\tau ai\bigl(L_{y}L_{z} \delta_{x}^{2}+L_{x}L_{z} \delta_{y}^{2}+L_{x}L_{y}\delta _{z}^{2}\bigr)u_{jkl}^{n}, \end{aligned}$$
(2.10a)
$$\begin{aligned} & \biggl(L_{y}-\frac{\tau}{2}ai\delta_{y}^{2} \biggr)\Delta u_{jkl}^{**}=\Delta u_{jkl}^{*}, \end{aligned}$$
(2.10b)
$$\begin{aligned} & \biggl(L_{z}-\frac{\tau}{2}ai\delta_{z}^{2} \biggr)\Delta u_{jkl}=\Delta u_{jkl}^{**}, \end{aligned}$$
(2.10c)
$$\begin{aligned} &u_{jkl}^{n+1}-u_{jkl}^{n}=\Delta u_{jkl}. \end{aligned}$$
(2.10d)

For this method, intermediate values of \(\Delta u^{**}\) and \(\Delta u^{*}\) at the boundary are easily obtained by (2.10c) and (2.10b). □

Theorem 2

Suppose that the exact solution u of problem (2.1) is smooth enough, then the truncation order of the new HOC-ADI scheme (2.10a)(2.10d) is \(O(\tau^{2}+h^{4})\).

Proof

Eliminating the intermediate variables in the new HOC-ADI scheme (2.10a)–(2.10d), we have

$$\begin{aligned} &L_{x}L_{y}L_{z} \biggl(\frac{u_{jkl}^{n+1}-u_{jkl}^{n}}{\tau} \biggr)- \frac{a}{2}i \bigl(L_{y}L_{z} \delta_{x}^{2}+ L_{x}L_{z} \delta_{y}^{2}+ L_{x}L_{y} \delta_{z}^{2} \bigr) \bigl(u_{jkl}^{n+1}+u_{jkl}^{n} \bigr) \\ &\quad{}+ \biggl[\frac{\tau^{2}}{4}a^{2}i^{2}\bigl(L_{z} \delta_{x}^{2}\delta_{y}^{2} +L_{y}\delta_{x}^{2}\delta_{z}^{2}+ L_{x}\delta_{y}^{2}\delta_{z}^{2} \bigr) -\frac{\tau^{3}}{8}a^{3}i^{3}\delta_{x}^{2} \delta_{y}^{2}\delta _{z}^{2} \biggr] \frac{u_{jkl}^{n+1}-u_{jkl}^{n}}{\tau}=0. \end{aligned}$$

For the above scheme using Taylor expansion, we have the following truncation error:

$$\begin{aligned} R_{jkl}^{n+\frac{1}{2}}={}& \biggl(\frac{1}{24}\tau^{2}L_{x}L_{y}L_{z} \frac {\partial^{3} u}{\partial t^{3}}-\frac{ai}{8}\tau^{2} \biggl(L_{y}L_{z} \frac{\partial^{4} u}{\partial t^{2}\,\partial x^{2}}+L_{x}L_{z}\frac{\partial^{4} u}{\partial t^{2}\,\partial y^{2}} \\ &{}+L_{x}L_{y}\frac{\partial^{4} u}{\partial t^{2}\,\partial z^{2}} \biggr) +\frac{a^{2}i^{2}}{4} \tau^{2} \biggl(L_{z}\frac{\partial^{5} u}{\partial t\,\partial x^{2}\,\partial y^{2}}+L_{y} \frac{\partial^{5} u}{\partial t\,\partial z^{2}\,\partial x^{2}} \\ &{}+L_{x}\frac{\partial^{5} u}{\partial t\,\partial y^{2}\,\partial z^{2}} \biggr) -\frac{a^{3}i^{3}}{8} \tau^{3} \biggl(\frac{\partial^{7} u}{\partial t\,\partial x^{2}\partial y^{2}\partial z^{2}} \biggr) -\frac{ai}{240}h^{4} \biggl(L_{y}L_{z}\frac{\partial^{4} u}{\partial x^{4}} \\ &{}+L_{x}L_{z}\frac{\partial^{4} u}{\partial y^{4}} +L_{x}L_{y} \frac{\partial^{4} u}{\partial z^{4}} \biggr) \biggr) (x_{j},y_{k},z_{l},t_{n+\frac{1}{2}}) \\ &{}+O\bigl(\tau^{4}+\tau^{2}h^{4}+h^{6} \bigr) \\ ={}&O\bigl(\tau^{2}+h^{4}\bigr), \end{aligned}$$

where \(O(h^{4})=O(h_{x}^{4}+h_{y}^{4}+h_{z}^{4})\). This completes the proof.

We now investigate the stability of D-G ADI scheme using the Fourier analysis method. The D-G ADI scheme (2.6a)–(2.6d) can be written as the following product form:

$$\begin{aligned} & \biggl(1-\frac{\tau}{2}ai\delta_{x}^{2} \biggr) \biggl(1-\frac{\tau }{2}ai\delta_{y}^{2} \biggr) \biggl(1- \frac{\tau}{2}ai\delta_{z}^{2} \biggr)u_{jkl}^{n+1} \\ &\quad = \biggl(1+\frac{\tau}{2}ai\delta_{x}^{2} \biggr) \biggl(1+\frac{\tau }{2}ai\delta_{y}^{2} \biggr) \biggl(1+ \frac{\tau}{2}ai\delta_{z}^{2} \biggr)u_{jkl}^{n}. \end{aligned}$$
(2.11)

We assume that the numerical solution can be expressed by using a Fourier series, whose typical term is

$$\begin{aligned} u_{jkl}^{n}=\rho^{n}e^{i(j\theta_{x}h+k\theta_{y}h+l\theta_{z}h)}, \end{aligned}$$
(2.12)

where \(i=\sqrt{-1}\), \(\rho^{n}\) is the amplitude at time level n, and \(\theta_{x},\theta_{y},\theta_{z}\) are the wave numbers in the \(x, y, z\) directions, respectively. Substituting (2.12) into (2.11), we have the following growth factor:

$$\begin{aligned} G_{1}=\frac{ (1-ai\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta _{x}h}{2} ) (1-ai\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta _{y}h}{2} ) (1-ai\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta _{z}h}{2} )}{ (1+ai\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta _{x}h}{2} ) (1+ai\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta _{y}h}{2} ) (1+ai\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta _{z}h}{2} )}. \end{aligned}$$

We find that

$$\begin{aligned} \vert G_{1} \vert &=\frac{ \vert (1-ai\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta _{x}h}{2} ) (1-ai\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta _{y}h}{2} ) (1-ai\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta _{z}h}{2} ) \vert }{ \vert (1+ai\frac{2\tau}{h^{2}}\sin^{2}\frac {\theta_{x}h}{2} ) (1+ai\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta _{y}h}{2} ) (1+ai\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta _{z}h}{2} ) \vert } \\ &=\frac{ \vert (1-ai\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta _{x}h}{2} ) \vert }{ \vert (1+ai\frac{2\tau}{h^{2}}\sin^{2}\frac {\theta_{x}h}{2} ) \vert }\frac{ \vert (1-ai\frac{2\tau}{h^{2}}\sin ^{2}\frac{\theta_{y}h}{2} ) \vert }{ \vert (1+ai\frac{2\tau }{h^{2}}\sin^{2}\frac{\theta_{y}h}{2} ) \vert }\frac{ \vert (1-ai\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta_{z}h}{2} ) \vert }{ \vert (1+ai\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta_{z}h}{2} ) \vert } \\ &=\frac{ \sqrt{ 1+ (a\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta _{x}h}{2} )^{2} } }{ \sqrt{ 1+ (a\frac{2\tau}{h^{2}}\sin^{2}\frac {\theta_{x}h}{2} )^{2} } }\frac{ \sqrt{ 1+ (a\frac{2\tau}{h^{2}}\sin ^{2}\frac{\theta_{y}h}{2} )^{2} } }{ \sqrt{ 1+ (a\frac{2\tau }{h^{2}}\sin^{2}\frac{\theta_{y}h}{2} )^{2} } }\frac{ \sqrt{ 1+ (a\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta_{z}h}{2} )^{2} } }{ \sqrt{ 1+ (a\frac{2\tau}{h^{2}}\sin^{2}\frac{\theta_{z}h}{2} )^{2} } } \\ &=1. \end{aligned}$$

Therefore, it meets the unconditional stability criterion (\(|G|\leqslant1\)) and the D-G ADI scheme (2.6a)–(2.6d) is unconditionally stable.

Next, we study the stability of the new HOC-ADI scheme in a similar way used above. The new HOC-ADI scheme (2.10a)–(2.10d) can be rewritten as

$$\begin{aligned} & \biggl(L_{x}-\frac{\tau}{2}ai\delta_{x}^{2} \biggr) \biggl(L_{y}-\frac{\tau }{2}ai\delta_{y}^{2} \biggr) \biggl(L_{z}-\frac{\tau}{2}ai\delta_{z}^{2} \biggr)u_{jkl}^{n+1} \\ &\quad = \biggl(L_{x}+\frac{\tau}{2}ai\delta_{x}^{2} \biggr) \biggl(L_{y}+\frac {\tau}{2}ai\delta_{y}^{2} \biggr) \biggl(L_{z}+\frac{\tau}{2}ai\delta_{z}^{2} \biggr)u_{jkl}^{n}. \end{aligned}$$
(2.13)

Substituting (2.12) into (2.13), we get

$$\begin{aligned} G_{2}={}&\frac{ (1-\frac{1}{3}\sin^{2}\frac{\theta_{x}h}{2}-ai\frac {2\tau}{h^{2}}\sin^{2}\frac{\theta_{x}h}{2} ) (1-\frac{1}{3}\sin^{2}\frac{\theta_{y}h}{2}-ai\frac{2\tau }{h^{2}}\sin^{2}\frac{\theta_{y}h}{2} ) }{ (1-\frac{1}{3}\sin^{2}\frac{\theta_{x}h}{2}+ai\frac{2\tau }{h^{2}}\sin^{2}\frac{\theta_{x}h}{2} ) (1-\frac{1}{3}\sin^{2}\frac{\theta_{y}h}{2}+ai\frac{2\tau }{h^{2}}\sin^{2}\frac{\theta_{y}h}{2} )} \\ &{}\times \frac{ (1-\frac{1}{3}\sin^{2}\frac{\theta_{z}h}{2}-ai\frac{2\tau }{h^{2}}\sin^{2}\frac{\theta_{z}h}{2} )}{ (1-\frac{1}{3}\sin^{2}\frac{\theta_{z}h}{2}+ai\frac{2\tau }{h^{2}}\sin^{2}\frac{\theta_{z}h}{2} )}. \end{aligned}$$

Also we can easily see that \(|G_{2}|=1\), so scheme (2.10a)–(2.10d) is also unconditionally stable. Therefore, the above results prove the following theorem. □

Theorem 3

The D-G ADI scheme (2.6a)(2.6d) and the new HOC-ADI scheme (2.10a)(2.10d) are unconditionally stable.

3 A new HOC-ADI splitting scheme for the NLS equation

In this section, we extend the D-G ADI splitting scheme and the new HOC-ADI splitting scheme which combines the D-G ADI skill and the HOC-ADI skill with splitting strategy to the initial-boundary problems of three-dimensional NLS equations (by choosing \(a=\frac{1}{2}\) in (1.1)):

$$\begin{aligned} &i\frac{\partial u}{\partial t}=-\frac{1}{2}(u_{xx}+u_{yy}+u_{zz})+ \beta \vert u \vert ^{2}u+v(x,y,z)u,\quad (x,y,z,t)\in \Omega \times(0,T], \end{aligned}$$
(3.1)
$$\begin{aligned} &u(x,y,z,0)=u_{0}(x,y,z), \quad (x,y,z)\in\Omega, \end{aligned}$$
(3.2)
$$\begin{aligned} &u(x,y,z,t)|_{\partial\Omega}=0, \quad t\in(0,T]. \end{aligned}$$
(3.3)

Here, we use the standard Strang splitting method [30, 31] with second-order splitting error. To this end, we split (3.1) into the following two subequations.

• Linear equation:

$$\begin{aligned} i\frac{\partial u(x,y,z,t)}{\partial t}=-\frac{1}{2} \biggl(\frac{\partial^{2} u(x,y,z,t)}{\partial x^{2}}+ \frac{\partial^{2} u(x,y,z,t)}{\partial y^{2}}+\frac{\partial^{2} u(x,y,z,t)}{\partial z^{2}} \biggr); \end{aligned}$$
(3.4)

• Nonlinear equation:

$$\begin{aligned} i\frac{\partial u(x,y,z,t)}{\partial t}=\beta \bigl\vert u(x,y,z,t) \bigr\vert ^{2}u(x,y,z,t)+v(x,y,z)u(x,y,z,t), \end{aligned}$$
(3.5)

where (3.4) will be solved by the D-G ADI scheme and the HOC-ADI scheme, respectively, which are proposed in the previous section, and the nonlinear equation (3.5) is solved exactly. If we discretize \(\Omega_{1}=\{(x,y,z,t)|(x,y,z,t)\in[L_{1},L_{2}]^{3}\times[0,T]\}\) with mesh of points with coordinates \(x_{j}=L_{1}+jh, y_{k}=L_{1}+kh, z_{l}=L_{1}+lh\ (h_{x}=h_{y}=h_{z}=h)\), \(j=k=l=0,1,\ldots,M\), \(t_{n}=n\tau\), \(n=0,1,\ldots,N\), where \(h=\frac{L_{2}-L_{1}}{M}\) and \(\tau=\frac{T}{N}\) are the mesh sizes and time step, respectively. Let \(u_{jkl}^{n}\) be the approximation of \(u(x_{j},y_{k},z_{l},t_{n})\), and use the D-G ADI scheme for linear equation (3.4), then we can derive the D-G ADI splitting scheme for the above 3D nonlinear equations (3.1)–(3.3) as follows:

$$ \textstyle\begin{cases} u_{jkl}^{(1)}=e^{-i(v_{jkl}+\beta|u_{jkl}^{n}|^{2})\tau /2}u_{jkl}^{n},\\ (1-\frac{\tau}{4}i\delta_{x}^{2} )u_{jkl}^{(2)}=\frac{\tau i}{2}(\delta_{x}^{2}+\delta_{y}^{2}+\delta_{z}^{2})u_{jkl}^{(1)},\\ (1-\frac{\tau}{4}i\delta_{y}^{2} )u_{jkl}^{(3)}=u_{jkl}^{(2)},\\ (1-\frac{\tau}{4}i\delta_{z}^{2} )u_{jkl}^{(4)}=u_{jkl}^{(3)},\\ u_{jkl}^{(5)}-u_{jkl}^{(1)}=u_{jkl}^{(4)},\\ u_{jkl}^{n+1}=e^{-i(v_{jkl}+\beta|u_{jkl}^{(5)}|^{2})\tau/2}u_{jkl}^{(5)},\quad j,k,l=0,1,2,\ldots,M. \end{cases} $$
(3.6)

In the same way, if we use the HOC-ADI scheme for linear equation (3.4), then we can derive the new HOC-ADI splitting scheme for the above 3D nonlinear equations (3.1)–(3.3) as follows:

$$ \textstyle\begin{cases} u_{jkl}^{(1)}=e^{-i(v_{jkl}+\beta|u_{jkl}^{n}|^{2})\tau /2}u_{jkl}^{n},\\ (L_{x}-\frac{\tau}{4}i\delta_{x}^{2} ) u_{jkl}^{(2)}=\frac{\tau i}{2}(L_{y}L_{z}\delta_{x}^{2}+L_{x}L_{z}\delta_{y}^{2}+L_{x}L_{y}\delta _{z}^{2})u_{jkl}^{(1)},\\ (L_{y}-\frac{\tau}{4}i\delta_{y}^{2} )u_{jkl}^{(3)}=u_{jkl}^{(2)},\\ (L_{z}-\frac{\tau}{4}i\delta_{z}^{2} )u_{jkl}^{(4)}=u_{jkl}^{(3)},\\ u_{jkl}^{(5)}-u_{jkl}^{(1)}=u_{jkl}^{(4)},\\ u_{jkl}^{n+1}=e^{-i(v_{jkl}+\beta|u_{jkl}^{(5)}|^{2})\tau/2}u_{jkl}^{(5)},\quad j,k,l=0,1,2,\ldots,M. \end{cases} $$
(3.7)

The accuracy of the D-G ADI splitting scheme (3.6) is of second-order in time and space. The new HOC-ADI splitting scheme (3.7) has a truncation error of order \(O(\tau^{2}+h^{4})\). In the following we study the stability of the above two methods.

Theorem 4

The D-G ADI splitting scheme (3.6) and the new HOC-ADI splitting scheme (3.7) are unconditionally stable.

Proof

We define the norm and error term as follows:

$$\begin{aligned} \begin{aligned} & \Vert u \Vert _{\infty}= \max_{{jkl}} \vert u_{jkl} \vert , \\ &\epsilon= \bigl\vert u_{\mathrm{exact}}(x,y,z,t)-u_{\mathrm{approx}}(x,y,z,t) \bigr\vert . \end{aligned} \end{aligned}$$
(3.8)

Because nonlinear equation (3.5) is solved exactly, by substituting (3.8) into the first equation of (3.6), we have

$$\begin{aligned} \bigl\Vert \epsilon^{n} \bigr\Vert _{\infty}= \bigl\Vert \epsilon ^{(1)} \bigr\Vert _{\infty}, \end{aligned}$$
(3.9)

and also, for the sixth equation of (3.6), we can write

$$\begin{aligned} & \bigl\Vert \epsilon^{n+1} \bigr\Vert _{\infty}= \bigl\Vert \epsilon ^{(5)} \bigr\Vert _{\infty}. \end{aligned}$$
(3.10)

For the linear equation (3.4), by using Theorem 3, we get

$$\begin{aligned} & \bigl\Vert \epsilon^{(5)} \bigr\Vert _{\infty} \leqslant \bigl\Vert \epsilon^{(1)} \bigr\Vert _{\infty}. \end{aligned}$$
(3.11)

Combining (3.10), (3.11) with (3.9) we conclude that

$$\begin{aligned} & \bigl\Vert \epsilon^{n+1} \bigr\Vert _{\infty} \leqslant \bigl\Vert \epsilon^{n} \bigr\Vert _{\infty}. \end{aligned}$$
(3.12)

Hence the D-G ADI splitting scheme (3.6) is unconditionally stable. Similarly, the new HOC-ADI splitting scheme (3.7) is also unconditionally stable. □

4 Numerical results

In this section, we performed numerical examples to show the accuracy and efficiency of the proposed methods, all the numerical experiments are obtained by Matlab R2015b on a Lenovo L450 computer (CPU is Intel Core i7-5500U, and Memory is 4.00 GB). It is well known that NLS equation has two conservation laws (mass and energy) [31].

Proposition 1

If the wave function u is the solution of (1.1), then this wave function satisfies the following conservation laws:

  1. (1)

    Mass conservation

    $$\begin{aligned} Q(t)= \int_{\mathbf{R}^{3}} \bigl\vert u(\mathbf{x},t) \bigr\vert ^{2} \,\mathrm{d}\mathbf{x}= \int_{\mathbf{R}^{3}} \bigl\vert u(\mathbf{x},0) \bigr\vert ^{2} \,\mathrm{d}\mathbf {x}=Q(0). \end{aligned}$$
    (4.1)
  2. (2)

    Energy conservation

    $$\begin{aligned} E(t)={}& \int_{\mathbf{R}^{3}} \biggl[a \bigl\vert \nabla u(\mathbf{x},t) \bigr\vert ^{2}+\frac{\beta}{2} \bigl\vert u(\mathbf{x},t) \bigr\vert ^{4} +v(\mathbf{x}) \bigl\vert u(\mathbf{x},t) \bigr\vert ^{2} \biggr] \,\mathrm{d}\mathbf{x}, \\ ={}& \int_{\mathbf{R}^{3}} \biggl[a \bigl\vert \nabla u(\mathbf{x},0) \bigr\vert ^{2}+\frac{\beta}{2} \bigl\vert u(\mathbf{x},0) \bigr\vert ^{4} +v(\mathbf{x}) \bigl\vert u(\mathbf{x},0) \bigr\vert ^{2} \biggr] \,\mathrm{d}\mathbf {x}=E(0). \end{aligned}$$
    (4.2)

The above conservation laws (4.1) and (4.2) are approximated by

$$\begin{aligned} h^{3}\sum_{jkl} \bigl\vert u_{jkl}^{n+1} \bigr\vert ^{2}=h^{3}\sum _{jkl} \bigl\vert u_{jkl}^{n} \bigr\vert ^{2} \end{aligned}$$
(4.3)

and

$$\begin{aligned} &h^{3}\sum_{jkl} \biggl(a \biggl\vert \frac {u_{j+1,kl}^{n+1}-u_{j-1,kl}^{n+1}}{2h} \biggr\vert ^{2}+ a \biggl\vert \frac{u_{j,k+1,l}^{n+1}-u_{j,k-1,l}^{n+1}}{2h} \biggr\vert ^{2} \\ &\qquad{}+a \biggl\vert \frac{u_{jk,l+1}^{n+1}-u_{jk,l-1}^{n+1}}{2h} \biggr\vert ^{2}+ \frac {\beta}{2} \bigl\vert u_{jkl}^{n+1} \bigr\vert ^{4} +v_{jkl} \bigl\vert u_{jkl}^{n+1} \bigr\vert ^{2} \biggr) \\ &\quad =h^{3}\sum_{jkl} \biggl(a \biggl\vert \frac {u_{j+1,kl}^{n}-u_{j-1,kl}^{n}}{2h} \biggr\vert ^{2}+ a \biggl\vert \frac{u_{j,k+1,l}^{n}-u_{j,k-1,l}^{n}}{2h} \biggr\vert ^{2} \\ &\qquad{}+a \biggl\vert \frac{u_{jk,l+1}^{n}-u_{jk,l-1}^{n}}{2h} \biggr\vert ^{2}+ \frac{\beta }{2} \bigl\vert u_{jkl}^{n} \bigr\vert ^{4}+ v_{jkl} \bigl\vert u_{jkl}^{n} \bigr\vert ^{2} \biggr), \end{aligned}$$
(4.4)

which will be used to verify the conservation laws of our scheme numerically.

Example 1

(3D LS equation)

We consider (2.1) with parameters \(a=1\) and the initial condition

$$\begin{aligned} &i\frac{\partial u}{\partial t}+u_{xx}+u_{yy}+u_{zz}=0,\quad (x,y,z)\in [0,2\pi]^{3}, t\in(0,T], \\ &u_{0}(x,y,z)=\sin x\sin y\sin z. \end{aligned}$$

The exact solution is given by \(u_{\mathrm{exact}}(x,y,z,t)=\sin x\sin y\sin z\exp(-i3t)\).

We are now applying the D-G ADI scheme (2.6a)–(2.6d) and the new HOC-ADI scheme (2.10a)–(2.10d) to solve this example. Table 1 gives the maximum of numerical errors \(|u_{\mathrm{exact}}(x,y,z,t)-u_{\mathrm{approx}}(x,y,z,t)|\), orders, and CPU times of the two methods. Table 2 shows the maximum of numerical errors until time \(T=4\) using two methods. Figure 1 shows the contour plot of exact solution and numerical solutions by the D-G ADI scheme and the new HOC-ADI scheme in the \(x-y\) plane at \(T=0.01\), \(z=0.5\) with \(N=100\) and \(M=20\). Figure 2 gives relative errors for the two methods, where \(\tau=0.005, h=2\pi/25\). The relative errors are defined by

$$\text{Relative Error}=\frac{ \Vert u_{\mathrm{exact}}(x,y,z,t)-u_{\mathrm{approx}}(x,y,z,t) \Vert _{\infty}}{ \Vert u_{\mathrm{exact}}(x,y,z,t) \Vert _{\infty}}. $$

In Fig. 3, we use the two methods to investigate the discrete mass and energy conservation errors for Example 1, where \(\tau=0.005, h=2\pi/25\). The errors are measured by

$$\text{Error of }Q(t)=Q^{n}-Q^{o},\qquad \text{Error of }E(t)=E^{n}-E^{o}. $$

The results in Table 1, Table 2, and Fig. 1 show that the new HOC-ADI scheme is more accurate than the D-G ADI scheme, and the new HOC-ADI scheme and D-G ADI scheme have the order \(O(\tau^{2}+h^{4})\) and \(O(\tau^{2}+h^{2})\), respectively. From Fig. 3 we can observe that two schemes for this linear problem preserve the mass and energy conservation.

Figure 1
figure 1

The contour plot of exact solution and numerical solutions to Example 1 at \(T=0.01\), \(z=0.5\) with \(N=100\) and \(M=20\). Left panel for real part and right panel for imaginary part correspond to the exact solution, solutions by the D-G ADI scheme, and solutions by the new HOC-ADI scheme, respectively)

Figure 2
figure 2

Comparison of relative error using D-G ADI scheme and new HOC-ADI scheme for Example 1

Figure 3
figure 3

Discrete conservation errors using two methods for Example 1 under \(\tau=0.005, h=2\pi/25\)

Table 1 Numerical comparison results of the D-G ADI scheme and the new HOC-ADI scheme for Example 1, at \(T=2\), time step \(\tau=0.001\)
Table 2 Comparison of maximum errors at different time T for the equation in Example 1, \(h=2\pi/20\), time step \(\tau=0.01\)

Example 2

(3D NLS equation)

For this example, we consider the following three-dimensional NLS equation:

$$\begin{aligned} &i\frac{\partial u(x,y,z,t)}{\partial t}=-\frac{1}{2} \biggl(\frac{\partial^{2} }{\partial x^{2}} + \frac{\partial^{2} }{\partial y^{2}}+\frac{\partial^{2} }{\partial z^{2}} \biggr)u(x,y,z,t) \\ &\phantom{i\frac{\partial u(x,y,z,t)}{\partial t}=}{} +\beta \bigl\vert u(x,y,z,t) \bigr\vert ^{2}u(x,y,z,t)+v(x,y,z)u(x,y,z,t), \\ &\quad(x,y,z)\in[0,2\pi]\times[0,2\pi]\times[0,2\pi], t\in(0,T], \\ &u_{0}(x,y,z)=\sin(x)\sin(y)\sin(z), \end{aligned}$$

where \(v(x,y,z)=1-\sin^{2}x\sin^{2}y\sin^{2}z\) and \(\beta=1\). The exact solution for this equation is in the following form:

$$u_{\mathrm{exact}}(x,y,z,t)=\sin x\sin y\sin z\exp(-i5t/2). $$

We solved the equation by both D-G ADI splitting scheme (3.6) and the new HOC-ADI splitting scheme (3.7) with homogeneous boundary conditions. Table 3 illustrates the maximum error of \(|u_{\mathrm{exact}}(x,y,z,t)-u_{\mathrm{approx}}(x,y,z,t)|\) and orders from the two methods at \(T=2\), and we can see that the new HOC-ADI splitting scheme and the D-G ADI splitting scheme have the order \(O(\tau^{2}+h^{4})\) and \(O(\tau^{2}+h^{2})\), respectively. Table 4 shows the maximum of numerical errors until time \(T=5\) using two methods. Figure 4 shows the contour plot of exact solution and numerical solutions by the D-G ADI splitting scheme and the new HOC-ADI splitting scheme in the \(x-y\) plane at \(T=0.01\), \(z=0.5\) with \(N=100\) and \(M=20\). Figure 5 gives the relative errors for the two methods, where \(\tau=0.005, h=2\pi/25\). The results show that the new HOC-ADI splitting scheme is more accurate. Figure 6 shows that the numerical mass and energy for the nonlinear problem preserve the conservation laws.

Figure 4
figure 4

The contour plot of exact solution and numerical solutions to Example 2 at \(T=0.01\), \(z=0.5\) with \(N=100\) and \(M=20\). (Left panel for real part and right panel for imaginary part corresponding to the exact solution, solutions by the D-G ADI splitting scheme, and solutions by the new HOC-ADI splitting scheme, respectively)

Figure 5
figure 5

Comparison of relative error using D-G ADI splitting scheme and new HOC-ADI splitting scheme for Example 2

Figure 6
figure 6

Discrete conservation errors using two methods for Example 2 under \(\tau=0.005, h=2\pi/25\)

Table 3 Numerical comparison results of the D-G ADI splitting scheme and the new HOC-ADI splitting scheme for Example 2, at \(T=2\), time step \(\tau=0.001\)
Table 4 Comparison of maximum errors at different time T for the equation in Example 2, \(h=2\pi/15\), time step \(\tau=0.01\)

5 Conclusions

In this article, we proposed a new high-order compact alternating direction implicit finite difference scheme for the linear and nonlinear Schrödinger equation in three dimensions. For the nonlinear problem, the methods adopted the Strang splitting technique to split the nonlinear problem into linear and nonlinear subproblems for handling the nonlinearity. These methods are proven to be unconditionally stable and preserve the mass and energy conservation for linear and nonlinear problems. Computational results were shown in the tables and figures, and the accuracy and discrete conservation laws were tested. These results show that the proposed methods are efficient and accurate for numerically solving 3D Schrödinger equations.