1 Introduction

The numerical computation of nonlocal Schrödinger equations (SEs) on the unbounded spatial domain is considered as

$$\begin{aligned}&\mathrm {i}\partial _t q(x,t) = - \mathcal {L}_\delta q(x,t) + V(x)q(x,t),&\quad (x,t)\in \mathbb {R} \times (0,T], \end{aligned}$$
(1)
$$\begin{aligned}&q(x,0) = \varphi (x),&\quad x \in \mathbb {R}, \end{aligned}$$
(2)
$$\begin{aligned}&\lim \limits _{x\rightarrow \pm \infty }q(x,t)=0,&\quad t\in [0,T], \end{aligned}$$
(3)

where \(\mathrm {i}= \sqrt{-1}\) is the imagine unit, q(xt) is the complex-valued wave function, V(x) and \(\varphi (x)\) are the real-valued external potential and the initial value, respectively. The nonlocal operator \(\mathcal {L}_\delta\) is defined by

$$\begin{aligned} \mathcal {L}_\delta q(x)=\int _{0}^{\delta } \left[ q(x+s)-2q(x)+q(x-s)\right] \gamma (s){\text {d}}s, \quad x \in \mathbb {R}, \end{aligned}$$
(4)

where \(\delta\) stands for the interaction horizon used to measure the range of nonlocal interaction, and the nonnegative interaction kernel \(\gamma (s)\) satisfies the following moment condition:

$$\begin{aligned} 0< C_\delta = \int _0^{\delta }s^2\gamma (s){\text {d}}s<\infty . \end{aligned}$$
(5)

Under assumptions (5) and \(C_\delta \rightarrow C >0\) as \(\delta \rightarrow 0\), the nonlocal operator \(\mathcal {L}_\delta\) converges to the classical second-order operator; see discussions in [10, 33, 57]. The nonlocal operator \(\mathcal {L}_\delta\) is widely used in various applications, such as the peridynamic models and the nonlocal diffusion problems [5, 6, 10, 37, 57].

The classical SE is well known as the fundamental equation in classical quantum mechanics and has been widely studied over many areas in physics such as optics, electromagnetic, superfluidity. The SE can be interpreted by the Feynman path integral approach over the Brownian-like quantum paths [14]. Recently, Laskin [27, 28] extended the Feynmann path integral approach over Lévy-like quantum paths and obtained a fractional Schrödinger equation (FSE) by involving the fractional Laplacian operator (FLO) \((-\Delta )^\alpha\) (\(0<\alpha <1\)). The FSE is used to model the fractional oscillator of the Bohr atom [27] and the quantum chromodynamics [29], and also to describe the long-range dispersive interaction [26] in the mathematical description of boson stars [12] and in some models of water wave dynamics [25].

The fractional Laplacian operator is associated with \(\alpha\)-stable Lévy processes and Lévy path integrals in anomalous diffusion problems [34, 36] and quantum theory [27]. Unlike Brownian processes for which paths are continuous, \(\alpha\)-stable Lévy processes are jump processes for which paths can include jumps of arbitrarily large length. This pseudo-differential operator is defined by the Fourier transform in [38] as

$$\begin{aligned} \mathcal {F}[(-\Delta)^\alpha ] q(\xi ) = |\xi |^{2\alpha }\mathcal {F}[q](\xi ). \end{aligned}$$

More precisely, the FLO in one dimension can be rewritten; see [3, 35], as

$$\begin{aligned} (-\Delta)^\alpha q(x) = \frac{4^\alpha \Gamma (\frac{1}{2} +\alpha )}{ \sqrt{\pi }|\Gamma (-\alpha )|}\int _0^\infty \frac{2q(x) - q(x-s)- q(x+s)}{s^{1+2\alpha }} {\text {d}}s. \end{aligned}$$
(6)

Thus, there exists an intimate connection between the nonlocal operator (4) and the FLO (6). As discussed in [8, 24, 41] when confining the interaction in a smaller neighborhood, we can approximate (6) by

$$\begin{aligned} (-\Delta)^\alpha q(x) \approx \frac{4^\alpha \Gamma (\frac{1}{2} +\alpha )}{ \sqrt{\pi }|\Gamma (-\alpha )|}\int _0^\delta \frac{2q(x) - q(x-s)- q(x+s)}{s^{1+2\alpha }} {\text {d}}s. \end{aligned}$$
(7)

A variety of numerical methods for nonlocal problems with volume constraints have been extensively studied in [7, 11, 13, 32, 42, 43, 57]. Most of these works focus on numerical computations of nonlocal problems on bounded spatial domains. The numerical study on unbounded domains has so far received little attention. The essential difficulty in the numerical solution of the problems (1)–(3) is how to truncate the computational domain of interest and select suitable boundary conditions such that the solution in the truncated domain is the same as the original one confined in the computational domain.

To deal with the unboundedness of spatial domains, one of the most powerful tools is the artificial boundary method (ABM); see [16, 18, 22, 44]. The ideal artificial boundary conditions (ABCs) usually refer to the exact nonreflecting boundary conditions (NRBCs) for wave-like equations in the literature. This means that ABCs should absorb the waves impinging on the artificial boundary and do not generate reflected spurious waves to disrupt the solution inside of the computational domain. The exact and approximate ABCs for the classical linear equations have been extensively derived [1, 2, 4, 17, 19, 20, 23, 40, 45, 46, 49,50,51]. Due to the nonlocality of the interaction horizon, only a few works can construct approximate/exact ABCs [9, 52, 55] for nonlocal wave and diffusion equations, and perfectly matched layer (PML) [47, 48] for the nonlocal wave equation.

Differing from classical diffusion equations, the foundation of the SE is structured to be a linear differential equation based on the classical energy conservation, and consistent with the de Broglie relations. The solution is the wave function, which contains all the information that can be known about the system. On the other hand, even for the classical SE, the exact ABCs are nonlocal in time, containing certain temporal convolutions in the formulations [21]. The nonlocal convolutions in exact ABCs indeed bring the difficulty in developing and analyzing numerical methods for the reduced problems [4]. For example, only sub-optimal error estimate has been proved for the SE under exact ABCs [39, Theorem 4.3]. The error estimate is not optimal since they use the \(L^2\)-norm error estimate to control the boundary terms from the ABC through utilizing the Sobolev embedding inequality. Very recently, the optimal error estimate in [30, 31] was obtained with the application of a stronger \(H^1\)-norm error estimate. Not like SEs, the error estimate for classical diffusion equations can be obtained by \(L^2\)-norm error estimate directly through the Sobolev embedding inequality; see [56].

The aim of this paper is to develop an efficiently numerical implementation to simulate its dynamical behaviors by employing the asymptotically compatible scheme proposed in [43]. For this, we first apply the spatial Laplace transform, and its inverse to obtain exact ABCs. These exact ABCs are in forms of multiple integrals, which are hard to be implemented in practical simulations. To circumvent the intractable discretization of exact ABCs, we then employ the quadrature scheme proposed in [43] to discretize the nonlocal SE in the spatial direction. The resulting scheme is analyzed to remain valid for more general interaction kernels and preserves the discrete versions of properties associated with continuum models. After that, by applying the z-transform in the spatial direction, we extend the techniques in [15, 54, 55] to derive an exact solution expression for an exterior infinite system. This solution expression can be treated as our exact NABC of the generalized Dirichlet-to-Dirichlet (DtD) type, while we constrain them on the artificial boundary points of the discrete nonlocal system. Since our exact ABCs include a contour integral induced by the inverse z-transform. We discretize contour integrals using the trapezoidal quadrature rule to approximate the exact ABCs. With these treatments, we finally derive an ODE system with a finite number of degrees of freedom, which can be integrated out with a Runge–Kutta ODE solver. In the end, numerical examples are provided to demonstrate the effectiveness of our approach.

2 Design of Exact ABCs for Nonlocal Schrödinger Equations

In this section, we will extend and develop the ABM in [22] to construct exact ABCs for nonlocal SEs. We assume that the initial value \(\varphi (x)\) and the potential V(x) are compactly supported functions. These assumptions imply that these exist constants \(x_-\) and \(x_+\) such that \(V(x) = \varphi (x) = 0\) when \(x\leqslant x_-\) and \(x\geqslant x_+\).

We point out that the methodology of the Laplace transform in time to design ABCs for the local SE will fail for the nonlocal SE since we cannot express the exact solution of the resulting nonlocal ODEs in complex space. Motivating from the works on deviating the Dirichlet-to-Neumann (DtN) map in [15, 53, 54], we alternatively use the Laplace transform in space to derive exact ABCs for the nonlocal SE. By this technique, we can obtain the DtD map on the artificial layers.

To construct ABCs, we consider the exterior problem on an exterior domain \((0,+\infty )\) (without loss of generality, assume \(x_+ = 0\) in this section) as

$$\begin{aligned}&\mathrm {i}q_t(x,t) = -\mathcal {L}_{\delta } q(x,t), \quad (x,t)\in (0,+\infty ) \times (0,T], \end{aligned}$$
(8)
$$\begin{aligned}&q(x,0) =0, \quad x \in (0,+\infty ), \end{aligned}$$
(9)
$$\begin{aligned}&|q| \rightarrow 0 \quad \quad \quad \text {as} \quad x \rightarrow \infty . \end{aligned}$$
(10)

Denote the Laplace transform with respect to the x-variable by

$$\begin{aligned} \hat{q}(s,t) = \int _0^\infty {\text {e}}^{-sx} q(x,t) {\text {d}}x. \end{aligned}$$

Applying the Laplace transform to Eq. (8), we have

$$\begin{aligned} \hat{q}_t(s,t)= & {} \mathrm {i}\int _{0}^{\delta } \int _0^\infty \left[ q(x-y,t)-2q(x,t)+q(x+y,t)\right] {\text {e}}^{-sx} {\text {d}}x\gamma _{\delta }(y){\text {d}}y \nonumber \\= & {} \mathrm {i}\int _{0}^{\delta } \Bigg ( \int _{-y}^\infty q(x,t){\text {e}}^{-s(x+y)}{\text {d}}x -2\hat{q}(s,t) + \int _{y}^\infty q(x,t){\text {e}}^{-s(x-y)}{\text {d}}x \Bigg ) \gamma _{\delta }(y){\text {d}}y \nonumber \\= & {} -\mathrm {i}\omega (s)\hat{q}(s,t) + \mathrm {i}\int _{0}^{\delta } \Bigg (\int _{-y}^0 q(x,t){\text {e}}^{-s(x+y)}-\int _{0}^y q(x,t){\text {e}}^{-s(x-y)}\Bigg ) {\text {d}}x\gamma _{\delta }(y){\text {d}}y, \end{aligned}$$
(11)

where \(\omega (s)\) is defined by

$$\begin{aligned} \omega (s) = \mathrm {i}\int _{0}^{\delta } \left( 2-{\text {e}}^{-sy} - {\text {e}}^{sy} \right) \gamma _{\delta }(y){\text {d}}y. \end{aligned}$$

Multiplying both sides of (11) by \({\text {e}}^{\omega (s) t}\), and integrating the resulting from 0 to t, we arrive at

$$\begin{aligned} \hat{q}(s,t)= \mathrm {i}\int _0^t {\text {e}}^{\omega (s) (\tau - t)}\int _{0}^{\delta } \Bigg (\int _{-y}^0 q(x,\tau ){\text {e}}^{-s(x+y)}-\int _{0}^y q(x,\tau ){\text {e}}^{-s(x-y)}\Bigg ) {\text {d}}x\gamma _{\delta }(y){\text {d}}y{\text {d}}\tau . \end{aligned}$$
(12)

Denote

$$\begin{aligned} g(\omega (s),x,t) = \int _0^t {\text {e}}^{\omega (s) (\tau - t)} q(x,\tau ) {\text {d}}\tau . \end{aligned}$$

Equation (12) can be rewritten as

$$\begin{aligned} \hat{q}(s,t)= \mathrm {i}\int _{0}^{\delta } \Bigg ( \int _{-y}^0 g(\omega (s),x,t){\text {e}}^{-s(x+y)}- \int _{0}^y g(\omega (s),x,t){\text {e}}^{-s(x-y)} \Bigg ) {\text {d}}x\gamma _{\delta }(y){\text {d}}y. \end{aligned}$$
(13)

Performing the inverse Laplace transformation to (13) yields

$$\begin{aligned} {q}(x,t)= & {} \frac{\mathrm {i}}{2\pi \mathrm {i}} \int _{\sigma -\mathrm {i}\infty }^{\sigma + \mathrm {i}\infty }\int _{0}^{\delta } \Bigg ( \int _{-y}^0 g(\omega (s),x,t){\text {e}}^{-s(x+y)}\nonumber \\&- \int _{0}^y g(\omega (s),x,t){\text {e}}^{-s(x-y)} \Bigg ) {\text {d}}x\gamma _{\delta }(y){\text {d}}y {\text {e}}^{sx}{\text {d}}s, \end{aligned}$$
(14)

where \(\sigma = \mathfrak {R}\{s\} >0\).

Thus, we achieve a solution expression (14) for the exterior problem (8)–(10), which is the so-called DtD map in [15, 53, 54]. When we introduce artificial boundary layers to truncate the computational domain of interest, this solution expression (14) still holds and will be considered as our ABCs on the artificial boundary layers. In the practical numerical simulations, we may discretize the nonlocal problem (1)–(3) firstly and then construct corresponding ABCs for the resulting discrete nonlocal system. This is our motivation to construct ABCs for a discrete version of (14) as given in the section below.

3 Discrete Nonlocal Schrödinger System

For the nonlocal operator (4), we use the asymptotically compatible scheme proposed in [42] to discretize. Let \(h>0\) be the spatial stepsize and let \(x_n=nh\) be the spatial gridpoints. Denote \(q_n\) and \(V_n\) be the numerical approximations of \(q(x_n,t)\) and \(V(x_n)\), \(M = \lceil \delta /h \rceil\) and the intervals \(I_m = ((m-1)h,mh)\) for \(m = 1,\cdots , M -1\) and \(I_{M} = ( (M-1)h, \delta )\). Define the piecewise linear hat basis functions by

$$\begin{aligned} \phi _m(x)= \left\{ \begin{aligned}& \frac{x-(m-1)h}{h}, \quad x \in I_m,\\& \frac {(m+1)h-x}{h}, \quad x\in I_{m+1},\\& 0,\qquad\qquad\qquad \text{otherwise.} \end{aligned} \right. \end{aligned}$$
(15)

Using the fact that \(\begin{aligned}\sum _{m=0}^{M}\phi _m(\cdot )=1,\end{aligned}\) the approximation for \(\mathcal {L}_\delta\) parametrized by a constant \(\beta \in [0,2]\) is given by

$$\begin{aligned} \mathcal {L}_\delta ^h q_n= \sum _{m=1}^Ma_{m}(q_{n-m}-2q_n+q_{n+m}), \end{aligned}$$
(16)

where the coefficients \(a_{m}\) can be evaluated by

$$a_{m}= \left\{ \begin{aligned}{ll} \frac{ 1 }{(mh)^\beta } \int _{I_m\bigcup I_{m+1}} \phi _m(s)s^\beta \gamma (s){\text {d}}s, &{}\quad m = 1,\cdots , M-1,\\ \frac{ 1 }{(mh)^\beta } \int _{I_m} \phi _m(s)s^\beta \gamma (s){\text {d}}s, &{}\quad m = M. \end{aligned} \right.$$
(17)

Thus, it leads us to the discrete counterpart for the nonlocal problem (1)–(3):

$$\begin{aligned}&\mathrm {i}\dot{q}_n= - \sum _{m=1}^{M}a_{m}(q_{n-m}-2q_n+q_{n+m}) + V_n q_n,\ \forall n\in \mathbb {Z},\ \forall t>0, \end{aligned}$$
(18)
$$\begin{aligned}&q_n(0)=\varphi (x_n),\ \forall n\in \mathbb {Z}, \end{aligned}$$
(19)
$$\begin{aligned}&\lim _{n\rightarrow \pm \infty }q_n(t)=0,\ \forall t>0. \end{aligned}$$
(20)

As seen in the system (18)–(20), there are an infinite number of degrees of freedoms. To limit our computation into a finite set of indices, we assume that the initial data and the external potential are compactly supported. This is, there exists a positive number L, it holds that for all x with \(|x|\geqslant L,\)

$$\begin{aligned} \varphi (x)=0\quad \text {and} \quad V(x) = 0. \end{aligned}$$
(21)

Set \(N=\lceil L/h\rceil\) and \(M=\lceil \delta /h \rceil\), we then have an exterior problem

$$\begin{aligned}&\mathrm {i}\dot{q}_n= - \sum _{m=1}^{M}a_{m}(q_{n-m}-2q_n+q_{n+m}),\ \forall |n|\geqslant N,\;\; \forall t>0. \end{aligned}$$
(22)
$$\begin{aligned}&\varphi (x_n) = 0 ,\ \forall |n|\geqslant N, \end{aligned}$$
(23)
$$\begin{aligned}&\lim _{n\rightarrow \pm \infty }q_n(t)=0,\ \forall t>0. \end{aligned}$$
(24)

3.1 The z-Transform

Given a bounded infinite sequence \(\{q_n\}_{n=1}^\infty\), we define its z-transform as

$$\begin{aligned} \hat{q}(z)=\sum _{n=1}^\infty z^{-n}q_n,\ \forall |z|> 1. \end{aligned}$$

Note that \(z=\infty\) is a zero point of first order under the above definition. The function \(\hat{q}\) can be analytically extended into a larger domain enclosing the unit circle \(S^1\) if the sequence \(\{q_n\}\) decays suitably fast. In this case, the inverse z-transform is given by

$$\begin{aligned} q_n=\frac{1}{2\pi \mathrm {i}}\int _{S^1}\hat{q}(z)z^{n-1}{\text {d}}z,\ \forall n\geqslant 1. \end{aligned}$$

3.2 Exact ABC for Discrete Nonlocal Schrödinger System

To derive exact ABCs, we now consider the following discrete nonlocal dynamical system on the half-line by

$$\begin{aligned}&\mathrm {i}\dot{q}_n= - \sum _{m=1}^Ma_m(q_{n-m}-2q_n+q_{n+m}),\ \forall n\geqslant 1, \end{aligned}$$
(25)
$$\begin{aligned}&q_n(0)=0,\ \forall n>1,\end{aligned}$$
(26)
$$\begin{aligned}&\lim _{n\rightarrow \infty }q_n(t)=0,\ \forall t>0. \end{aligned}$$
(27)

Multiplying (26) with the imagine unit \(\mathrm {i}\), we have

$$\begin{aligned} \dot{q}_n= \mathrm {i}\sum _{m=1}^Ma_m(q_{n-m}-2q_n+q_{n+m}),\ \forall n\geqslant 1. \end{aligned}$$
(28)

For any \(z\in C\) with \(|z|\geqslant 1\), multiplying (28) with \(z^{-n}\), summing up the index n from 1 to \(\infty\), we have

$$\begin{aligned} \dot{\hat{q}}_n= & {} \mathrm {i}\sum _{n=1}^{\infty } z^{-n}\sum _{m=1}^Ma_m(q_{n-m}-2q_n+q_{n+m}) \nonumber \\= & {} -\mathrm {i}\sum _{m=1}^Ma_m(2-z^{-m}-z^m) \hat{q}_n + \sum _{m=-M+1}^Mf_m(z)q_m, \end{aligned}$$
(29)

where \(\hat{q}(z,t)\) is the z-transform of the sequence \(q_n\) and

$$\begin{aligned} f_m(z)=\left\{ \begin{array}{ll} \mathrm {i}\sum \limits _{n=1-m}^Ma_nz^{-n-m},&{}\quad \forall m=-M+1,\cdots ,0,\\ -\mathrm {i}\sum \limits _{n=m}^Ma_nz^{n-m},&{}\quad \forall m=1,\cdots ,M. \end{array} \right. \end{aligned}$$

Denote

$$\begin{aligned} w(z)=\mathrm {i}\sum _{m=1}^M a_m(2-z^{-m}-z^m),\ \forall z\in C\backslash \{0\}. \end{aligned}$$
(30)

It follows that (29) can be rewritten as

$$\begin{aligned} \dot{\hat{q}}_n +w(z)\hat{q}_n = \sum _{m=-M+1}^Mf_m(z)q_m. \end{aligned}$$
(31)

Multiplying (31) with \({\text {e}}^{w(z)t}\), we arrive at

$$\begin{aligned} \left[ {\text {e}}^{w(z)t}\hat{q}\right] _t={\text {e}}^{w(z)t}\sum _{m=-M+1}^Mf_m(z)q_m. \end{aligned}$$
(32)

Taking integral over [0, t] for (32) with the initial condition (26), we have

$$\begin{aligned} \hat{q}(z,t)=\sum _{m=-M+1}^Mf_m(z)\int _0^t{\text {e}}^{w(z)(t-\tau )}q_m(\tau ){\text {d}}\tau ,\ \forall |z|\geqslant 1. \end{aligned}$$
(33)

Denote

$$\begin{aligned} g_m(w(z),t)=\int _0^t{\text {e}}^{w(z)(t-\tau )}q_m(\tau ){\text {d}}\tau ,\ \forall t>0. \end{aligned}$$
(34)

Applying the inverse z-transform on both sides of (33) yields

$$\begin{aligned} q_n(t)=\frac{1}{2\pi \mathrm {i}}\int _{S^1}z^{n-1}\sum _{m=-M+1}^Mf_m(z)g_m(w(z),t){\text {d}}z,\ \forall n\geqslant 1. \end{aligned}$$
(35)

3.3 Truncated Nonlocal Schrödinger System

The formula (35) implies that if the sequence \(\{q_n\}_{n=-M+1}^\infty\) satisfies (25)–(27), then for any index \(n>M\), \(q_n\) is a linear functional of the variables \(\{q_{-M+1},\cdots ,q_M\}\). Thus, the expression (35) is taken as our ABCs to make the truncated system close. More precisely, for the system (22), we can derive the expression (22)–(24) for all \(n\in [M+1,2M]\) on the artificial points to satisfy that

$$\left\{\begin{aligned} & q_{N+n}= {} \frac{1}{2\pi \mathrm {i}}\int _{S^1}z^{n-1}\sum _{m=-M+1}^Mf_m(z)g_{ N+m}(w(z),t){\text {d}}z,\nonumber \\ &q_{-N-n}= {} \frac{1}{2\pi \mathrm {i}}\int _{S^1}z^{n-1}\sum _{m=-M+1}^Mf_m(z)g_{-N-m}(w(z),t){\text {d}}z, \end{aligned}\right.$$
(36)

where \(g_m(w,t)\) is given as in (34).

Combining the exact solution expressions (36), we can reformulate the infinite system (18)–(20) into the following ODE system on the finite points:

$$\begin{aligned} \mathrm {i}\dot{q}_n= & {} - \sum _{m=1}^{M}a_{m}(q_{n-m}-2q_n+q_{n+m}) + V_n q_n, \end{aligned}$$
(37)
$$\begin{aligned} q_{N+n}= & {} \frac{1}{2\pi \mathrm {i}}\int _{S^1}z^{n-1}\sum _{m=-M+1}^Mf_m(z)g_{ N+m}(w(z),t){\text {d}}z,\end{aligned}$$
(38)
$$\begin{aligned} q_{-N-n}= & {} \frac{1}{2\pi \mathrm {i}}\int _{S^1}z^{n-1}\sum _{m=-M+1}^Mf_m(z)g_{-N-m}(w(z),t){\text {d}}z \end{aligned}$$
(39)

with the initial condition

$$\begin{aligned} q_n(0)=\varphi _n,\ \forall n\in [-N-M,N+M]. \end{aligned}$$
(40)

In (37), the index n is chosen in the set of \([-N-M,N+M]\). In (38) and (39), the index n is chosen in the set of \([M+1,2M]\). Furthermore, for (38) and (39), there are integrals with respect to the variable z over the unit circle. In practical simulation, we can discretize the integrals in (38) and (39) to approximate those \(q_n\) with a spectral accuracy. To do so, we choose a positive integer P and set

$$\begin{aligned} z_l=\exp (2\pi \mathrm {i} l /MP),\ \forall l=0,\cdots ,MP-1, \end{aligned}$$

and approximate those \(q_n\) in (38) and (39) by

$$\left\{\begin{aligned} & q_{N+n}= {} \frac{1}{MP}\sum _{l=0}^{MP-1}z_l^{n}\sum _{m=-M+1}^Mf_m(z_l)\mathcal {G}_{ N+m}^l,\ \forall n\in [M+1,2M],\nonumber \\& q_{-N-n}= {} \frac{1}{MP}\sum _{l=0}^{MP-1}z_l^{n}\sum _{m=-M+1}^Mf_m(z_l)\mathcal {G}_{-N-m}^l,\ \forall n\in [M+1,2M]. \end{aligned}\right.$$
(41)

In the above, we have used the definition that

$$\begin{aligned} \mathcal {G}_{m}^l(t)=g_{m}(w(z_l),t). \end{aligned}$$

By the definition (34) for all m with \(|m|\in [N-M+1,N+M]\), the function \(\mathcal {G}_{m}^l(t)\) satisfies the following ODE with zero initial data:

$$\begin{aligned} \frac{{\text {d}}}{{\text {d}}t}\mathcal {G}_{m}^l(t)=-w(z_l)\mathcal {G}_{m}^l(t)+q_{m}. \end{aligned}$$
(42)

The equations (37) and (42), together with the algebraic relation (41), form a complete ODE system

$$\begin{aligned} \mathrm {i}\dot{q}_n= & {} - \sum _{m=1}^{M}a_{m}(q_{n-m}-2q_n+q_{n+m}) + V_n q_n, \end{aligned}$$
(43)
$$\begin{aligned} q_{ N+n}= & {} \frac{1}{MP}\sum _{l=0}^{MP-1}z_l^{n}\sum _{m=-M+1}^Mf_m(z_l)\mathcal {G}_{ N+m}^l,\ \forall n\in [M+1,2M],\end{aligned}$$
(44)
$$\begin{aligned} q_{-N-n}= & {} \frac{1}{MP}\sum _{l=0}^{MP-1}z_l^{n}\sum _{m=-M+1}^Mf_m(z_l)\mathcal {G}_{-N-m}^l,\ \forall n\in [M+1,2M], \end{aligned}$$
(45)
$$\begin{aligned} \frac{{\text {d}}}{{\text {d}}t}\mathcal {G}_{m}^l= & {} -w(z_l)\mathcal {G}_{m}^l+q_{m},\ \forall |m|\in [N-M+1,N+M] \end{aligned}$$
(46)

with the initial conditions

$$\begin{aligned}&q_n(0)=\varphi _n,\ \forall n\in [-N-M,N+M], \end{aligned}$$
(47)
$$\begin{aligned}&\mathcal {G}_{m}^l(0)=0, \; \forall l \in [0,MP-1]. \end{aligned}$$
(48)

In (37), the index n is chosen in the interval of \([-N-M,N+M]\). The complete ODE systems (43)–(48) are solved by Runge–Kutta methods.

4 Numerical Examples

In the simulations, two kinds of kernel functions are considered as

  1. i)

    the integrable kernel: \(\gamma (s) = 3\delta ^{-3}\),

  2. ii)

    the nonintegrable kernel: \(\gamma (s) = \frac{2-2\alpha }{\delta ^{2-2\alpha }}\frac{1}{s^{1+2\alpha }}\).

In Example 1, we use the integrable kernel with different initial values: (i) the Gaussian function

$$\begin{aligned} \varphi (x)=\exp (-25x^2),\quad \forall x\in (-\infty ,\infty ), \end{aligned}$$
(49)

and, (ii) the wave function

$$\begin{aligned} \varphi (x)=\exp (-25x^2 + 5\mathrm {i}(x+x^2)) ,\quad \forall x\in (-\infty ,\infty ). \end{aligned}$$
(50)

To test the effectiveness of our ABCs, we check the convergence properties of the approximate problem (18)–(20) to the nonlocal problem (1)–(3). The convergence order in space is consistent with the result analyzed in [42]. This implies that the choice of ABCs does not affect the accuracy of our numerical schemes.

Similarly, in Example 2 for different Gaussian and wave initial values, we consider the nonintegrable kernel ii) with \(\alpha =0\) and 0.5, respectively. In Example 3, we also investigate the wave propagation of the numerical solutions for different sizes of \(\delta\) using the nonintegrable kernel ii) with various \(\alpha\).

On the other hand, the discrete scheme used in (17) is analyzed to be convergent to the corresponding local operator with \(\beta =1\) when \(\delta \rightarrow 0\). In Example 4, we will investigate the convergence to local problems by vanishing \(\delta\) and h.

Fig. 1
figure 1

Example 1. Comparison between numerical solutions and reference solutions in the cases of \(\delta = 0.5,1,2\), respectively. In the calculation, we take \(M = 32\), \(N=M/\delta ; P=16/\delta ,h = \delta /M, T=1\)

Fig. 2
figure 2

Example 1 (left panel for Gaussian initial value and right panel for wave initial value ). The second-order convergence rate in space is observed by taking \(M =12,24,48,96\) in the cases of \(\delta = 0.5,1,2\). In the calculation, the parameters are taken by \(N=M/\delta , P=16/\delta ,h = \delta /M, T=1\)

Example 1

Here, we consider the constant kernel i), using the scheme (17) with \(\beta =1\), to have the coefficients \(a_{m}\) as

$$ \begin{aligned}a_{m}= \left\{ \begin{aligned}& 3h\delta ^{-3}, \qquad\qquad m = 1,\cdots , M-1,\\& \frac{(3m-1)h}{2m\delta ^{-3}}, \qquad m = M. \end{aligned} \right. \end{aligned} $$
(51)

In the simulations, the parameters are taken by \(M = 32, h = \delta /M\), \(N=M/\delta , P=16/\delta , T = 1\) and the external potential \(V(x) = 0\).

The reference solutions are computed using the spectral method in a large computational domain with sufficiently fine mesh sizes. Figure 1 shows the comparison of numerical solutions with reference solutions in cases of \(\delta = 0.5,1,2\) for initial values (49) and (50), respectively. Figure 2 shows the convergence behavior up to the second order by redoubling M. Figures 1 and 2 show that the numerical solution matches the reference solution perfectly and the scheme (17) has the expected convergence order in space.

Fig. 3
figure 3

Example 2. Comparison between numerical solutions and reference solutions in the cases of \(\delta = 0.5,1,2\), respectively. In the calculation, the parameters are taken by \(M = 32\), \(N=M/\delta ; P=16/\delta ,h = \delta /M, T=1\)

Fig. 4
figure 4

Example 2 (left panel for Gaussian initial value and right panel for wave initial value ). The second-order convergence rate in space is observed by taking \(M =12,24,48,96\) in the cases of \(\delta = 0.5,1,2\). In the calculation, we take \(N=M/\delta , P=16/\delta ,h = \delta /M, T=1\)

Example 2

We consider the nonintegrable kernel ii) with \(\alpha = 0\), by using the scheme (17) with \(\beta =1+2\alpha\), the coefficients \(a_{m}\) can be calculated as

$$a_{m}= \left\{ \begin{aligned}\frac{2(1-\alpha ) h}{\delta ^{2-2\alpha }} \frac{1}{(mh)^{1+2\alpha }}, &\quad m = 1,\cdots , M-1,\\ \frac{(1-\alpha ) h}{\delta ^{2-2\alpha }} \frac{1}{(mh)^{1+2\alpha }}, &\quad m = M. \end{aligned} \right.$$
(52)

The initial values are also given by (49) and (50), respectively. We again use the spectral method to achieve reference solutions in a large computational domain with sufficiently fine mesh sizes. In the calculation for any given \(\delta\), we take \(M = 32\), \(N=M/\delta ; P=16/\delta ,h = \delta /M, T=1.\) Figure 3 shows the comparison of numerical solutions with reference solutions. Figure 4 shows the convergence behavior up to the second order by redoubling M.

Fig. 5
figure 5

Example 3. Comparison between numerical solutions and reference solutions in the cases of \(\delta = 0.5,1,2\), respectively. In the calculation, the parameter is taken by \(M = 32\), \(N=M/\delta ; P=16/\delta ,h = \delta /M, T=1\)

Fig. 6
figure 6

Example 3 (left panel for Gaussian initial value and right panel for wave initial value ). The convergence rate in space by taking \(M =12,24,48,96\) in the cases of \(\delta = 0.5,1,2\). In the calculation, we take \(N=M/\delta , P=16/\delta ,h = \delta /M, T=1\)

Example 3

We take the nonintegrable kernel for case (ii) with \(\alpha = 0.3\). The coefficients \(a_{m}\) are given in (52). Figure 5 shows the comparison of numerical solutions with reference solutions for initial values (49) and (50), respectively. Again, one can see that numerical solutions match reference solutions well for various values of \(\delta\). Figure 6 shows the convergence behavior up to more than the first order with a decreasing h. It is impossible to exhaust all cases to investigate the effectiveness of our ABCs. We end the example in Figs. 7 and 8 to plot the evolutions of numerical solutions for case (ii) by taking \(\alpha = 0,0.3,0.5\) and \(\delta = 2,1,0.5\), respectively. From the results of simulations, one can see that the ABCs have a good performance to absorb the waves when they approach the artificial boundary gridpoints, and no numerical instability had been observed. To confirm the stability, we define the discrete energy by

$$\begin{aligned} \text {Energy} = \sum _{n = -N-M}^{N+M} h\left\{ u_n^2 + \sum _{m=1}^M a_m[(u_n-u_{n-m})^2+(u_n-u_{n+m})^2] + V_n u_n^2\right\} . \end{aligned}$$

Figure 9 shows the energy remained in the computational domains for different values of \(\alpha\) and \(\delta\). From Fig. 9, one can see that the energy remains conservative and begins to decay when the wave propagates outside the computational domains.

Example 4

The results in [10] suggest that the nonlocal operator (4) converges to the corresponding local operator while \(\delta \rightarrow 0\). Meanwhile, the discrete scheme used in (17) is analyzed to be convergent to the corresponding local operator with \(\beta =1\) when \(\delta \rightarrow 0\).

To verify convergence property of our schemes as \(\delta \rightarrow 0\), we choose the exact solution to the Cauchy problem for the classical local SE in the absence of the external potential \(V(x) = 0\). The exact solution is given as

$$\begin{aligned} q(x,t) = \frac{1}{\zeta +\mathrm {i}t}{\text {e}}^{\mathrm {i}k(x-kt)-\frac{(x-2kt)^2}{4(\zeta +\mathrm {i}t)} }, \end{aligned}$$
(53)

where k is the phase velocity (group velocity 2k) and \(\zeta\) is a real parameter. The \(\zeta\) is selected such that the initial value q(x, 0) is negligible small outside the computation domain \([-4,4]\) (\(L = 4\)). In the simulation, we take \(\zeta = 0.04\) and \(k = -10\), and the constant kernel i) by taking \(\beta\) and \(a_m\) as the same as those in Example 1. We consider the solution at time \(T = 0.5\) in the cases of \(h = \delta\) and \(h = 2\delta\) for \(\delta = 2^{-3},2^{-4},2^{-5},2^{-6}\). The number of trapezoidal quadrature point is chosen as \(P = 32/\delta\).

Table 1 (Example 4) The L2- errors and the convergence orders

Table 1 shows the L2-errors and the convergence orders between the solution of our approach and the exact solution (53) with vanishing \(\delta\) and h. This table implies that our schemes converge to the correct local model with both \(\delta ,h\rightarrow 0\).

Fig. 7
figure 7

Example 3 (Gaussian initial value). Evolutions of numerical solutions for case (ii) with \(\alpha = 0,0.3,0.5\) (from up to down) and \(\delta = 0.5,1,2\) (from left to right). In the calculation, we take \(M = 16\), \(N=M/\delta ; P=16/\delta ,h = \delta /M, T=1\)

Fig. 8
figure 8

Example 3 (wave initial value). Evolutions of numerical solutions for case (ii) with \(\alpha = 0,0.3,0.5\) (from up to down) and \(\delta = 0.5,1,2\) (from left to right). In the calculation, we take \(M = 16\), \(N=M/\delta ; P=16/\delta ,h = \delta /M, T=1\)

Fig. 9
figure 9

Example 3 (left: Gaussian initial value; right: wave initial value). Energy evolutions of numerical solutions for case (ii) with \(\alpha = 0,0.3,0.5,0.8,0.95\) and \(\delta = 0.5,1,2\). In the calculation, we take \(M = 16\), \(N=M/\delta ; P=32/\delta , t=0:0.05:2\)

5 Conclusion

This paper is concerned with numeral simulations of nonlocal SEs defined on the whole real axis. We first discretized the nonlocal SEs and obtained a discrete nonlocal system. After that, we derived an exact nonreflecting boundary condition (NRBC) for the discrete nonlocal Schrödinger system on artificial boundary gridpoints. This exact NRBC allowed us to reformulate the nonlocal system on the whole real axis into a finite nonlocal one on the truncated computational domain. As far as we know, this is a pioneering work in the designing of exact NRBCs for the nonlocal SE. We point out that the difference from the construction of ABCs from the nonlocal diffusion equations is that there is an imagine unit \(\mathrm{i}\), which results in the different contour integral for the inverse Laplace transform. The numerical examples were provided to demonstrate the effectiveness of our NRBCs. In all simulations, the ABCs perfectly absorbed the waves which touched on the artificial boundary gridpoints, and no numerical instability had been observed.

For the further stability and convergence analysis of the reduced problem, we will consider to construct Dirichlet-to-Neumann (DtN) type ABCs in the future. The key step is to find out how to formulate the Neumann data for the nonlocal operator (4). Thus, we derive the exact DtN-type ABCs in view of the DtD-type ABCs.