1 Introduction

Operator splitting methods have gained a lot of attention in recent years to numerically solve partial differential equations, as the subsystems obtained are usually easier to solve and even can be solved exactly, which allows a keen reduction of the computational cost and the derivation of high order time integrators. For a general introduction to splitting methods, we refer to [25, 30] and references therein. To obtain high order splitting methods, usually more subsystems in every step are needed to be solved, and proper regularity conditions about the original systems must be assumed. However, there exist some systems for which some specific splitting methods, called exact splittings, can give exact solutions indeed, such as in [2, 6, 7, 13, 29].

Exact splittings are special splitting methods that can give exact solutions for the original systems. Usually, exact splittings are only available for very simple cases (for example when the operators involved commute). In [12], exact splittings are obtained for a large class of PDEs, namely inhomogeneous quadratic differential equations (see Definition 1 below). In this framework, each subsystem can be solved accurately and efficiently by pseudo-spectral methods or pointwise multiplications. Exact splittings are important and useful for the studies of PDEs theoretically and numerically. They can be of great interest at the theoretical level since they can decompose the original complicated evolution operators into several simpler operators, which gives a way to analyze the properties for the original systems (see [1]). On the numerical side, since the exact splittings we propose can be combined with highly accurate space discretization methods (spectral methods for instance), the resulting fully discrete methods are very accurate and efficient and turn out to be very useful to study the long time behaviors of the original systems.

In this work, our goal is to construct, implement and test in practice the efficiency and accuracy of the exact splitting methods proposed for inhomogeneous quadratic differential equations in [12] on different configurations. Note that even if exact splittings are proposed only for inhomogeneous quadratic differential equations, they can be used to derive new efficient methods for non-quadratic equations by using composition techniques such as Strang splitting. Indeed, equations can be simply split into quadratic parts and non-quadratic parts. First, we will focus on high dimensional transport equations for which efficient exact splittings can be derived from the exact splittings of the underlying linear ordinary differential equations. We compare exact splittings with standard methods from the literature, namely operator splitting method and direct semi-Lagrangian method (combined with NUFFT interpolation). Second, we will apply the exact splittings to solve Fokker–Planck type equations and illustrate two properties of these systems; first, for Fokker–Planck equation, our exact splittings are able to recover the exponential rate of convergence towards the equilibrium and second, the regularizing effects of Kramer–Fokker–Planck equation is captured by our approach. And last but not least, several applications are proposed in the case of Schrödinger type equations. More precisely, we consider the magnetic Schrödinger equation (see [17, 28]) and Gross–Pitaevskii equation with a rotation term (see [3, 9, 11]) for which we compare our exact splittings with efficient methods from the literature. When non-quadratic terms are included in these models (non quadratic potential or nonlinear terms for instance), it is worth mentioning that the new splittings proposed here have a better efficiency (in terms of accuracy and complexity) than methods from the literature and their accuracy increases when the amplitude of the non-quadratic terms becomes smaller. Both for the Fokker–Planck and Schrödinger type equations the derivations of the exact splittings rely on Fourier integral operators developed by Hörmander in [26], which reduces infinite dimensional systems to corresponding finite dimensional systems.

2 Exact Splittings

In this section, we introduce exact splittings for three kinds of inhomogeneous quadratic differential equations: transport, Fokker–Planck, and quadratic

Schrödinger equations, which were studied theoretically in [12]. We start by introducing what we mean by inhomogeneous quadratic equations and exact splittings.

Inhomogeneous quadratic partial differential equations can be written as

$$\begin{aligned} \left\{ \begin{array}{llll} \partial _t u({\mathbf{x }}, t) &{} =&{} - p^w u({\mathbf{x }}, t), &{} t\ge 0,\ {\mathbf{x }}\in \mathbb {R}^n \\ u(0,{\mathbf{x }}) &{}=&{} u_0({\mathbf{x }}), &{} {\mathbf{x }}\in {\mathbb {R}}^n \end{array} \right. \end{aligned}$$
(1)

where \(n\ge 1\), \(u_0\in L^2({\mathbb {R}}^n)\) and \(p^w\) is an inhomogeneous quadratic differential operator acting on \(L^2({\mathbb {R}}^n)\). When the solution at time t of this equation is well defined, it is denoted, as usual, by \(e^{-t p^w}u_0\). This operator \(p^w\) is the Weyl quantization of a polynomial function (called symbol) p on \({\mathbb {C}}^{2n}\) of degree 2 or less. Usually this quantization is defined through an oscillatory integral (see e.g. Sect. 18.5 in [27] or Chapter 1 in [33]). Nevertheless, since we only deal with inhomogeneous quadratic differential operators, it can be defined much more elementarily. Indeed, in this context, one can write the polynomial function p as

(2)

where

figure a

denotes the transposition, , Q is a symmetric matrix of size 2n with complex coefficients, \(Y\in {\mathbb {C}}^{2n}\) is a vector and \(c\in {\mathbb {C}}\) is a constant. The associated differential operator \(p^w\) then writes

For \((-p^w)\) whose real part is bounded by below on \({\mathbb {R}}^{2n}\), it generates a strongly continuous semigroup on \(L^2({\mathbb {R}}^n)\) (see e.g. [26]). In [12], one of the authors proved that that \(e^{-p^w}\) can be split exactly into simple semigroups. As we shall see below, there are several examples which enter in this framework and for which the solutions can be split into operators which are easy to compute. In the following definition, we define what we mean by exact splittings.

Definition 1

An operator acting on \(L^2({\mathbb {R}}^n)\) can be computed by an exact splitting if it can be factorized as a product of operators of the form

$$\begin{aligned} e^{ \alpha \partial _{x_j}},\ e^{ i \alpha x_j },\ e^{ i a(\nabla )},\ e^{ i a({\mathbf{x }}) },\ e^{ \alpha x_k \partial _{x_j} },\ e^{ -b({\mathbf{x }})},\ e^{ b(\nabla )},\ e^{\gamma } \end{aligned}$$
(3)

with \(\alpha \in {\mathbb {R}},\gamma \in {\mathbb {C}},a,b : {\mathbb {R}}^n \rightarrow {\mathbb {R}}\) are some real quadratic forms, b is nonnegative and \(j,k\in \llbracket 1,n \rrbracket \) and \(k\ne j\). As usual, \(a(\nabla )\) (resp. \(b(\nabla )\)) denotes the Fourier multiplier associated with \(-a(\xi )\) (resp. \(-b(\xi )\)), i.e. \(a(\nabla ) = (-a(\xi ))^w\).

From the definition 1 of exact splittings, we can see that every subsystem in (3) can be solved exactly in time at least in Fourier variables and as such can be solved efficiently and accurately by pseudo-spectral methods or pointwise multiplications. The resulting fully discretized method will benefit from the spectral accuracy in space so that the error will be negligible in practice.

Below we detail the way we compute the solutions of (1) using pseudo-spectral methods. First, note that, given a factorization of an operator as a product of elementary operators of the form (3), there is a natural and minimal factorization of this operator as product of partial Fourier transforms, inverse partial Fourier transforms and multipliers (i.e. operators associated with a multiplication by a function). So, as usual, we just discretize the partial Fourier transforms, their inverts and the multipliers.

The whole space is truncated and we consider an approximation of the solution on a large box \([-R_1,R_1]\times \dots \times [-R_n,R_n]\). We discretize the box as a product of grids \({\mathbb {G}}_1 \times \dots \times {\mathbb {G}}_n\) where each grid \({\mathbb {G}}_j\) has \(N_j\) points and is of the form

$$\begin{aligned} {\mathbb {G}}_j = h_j \llbracket - \left\lfloor \frac{N_j-1}{2} \right\rfloor ,\left\lfloor \frac{N_j}{2} \right\rfloor \rrbracket \end{aligned}$$
(4)

where \(h_j = 2R_j/N_j\) is its cell-size. Associated with such a grid, its dual, denoted by \(\widehat{{\mathbb {G}}_j}\) is

$$\begin{aligned} \widehat{{\mathbb {G}}_j} = \eta _j \llbracket - \left\lfloor \frac{N_j-1}{2} \right\rfloor ,\left\lfloor \frac{N_j}{2} \right\rfloor \rrbracket \end{aligned}$$

where \(\eta _j = \pi / R_j\). In this paper, the variable implicitly naturally associated with \({\mathbb {G}}_j\) (resp. \(\widehat{{\mathbb {G}}_j}\)) is denoted \(g_j\) (resp. \(\omega _j\)).

If \({\mathcal {L}}\) is a product of \((j-1)\) grids (and duals of grids) and \({\mathcal {R}}\) is a product of \((n-j)\) grids (and duals of grids) then the discrete \(j^{\mathrm {st}}\) partial Fourier transform on \({\mathcal {L}} \times {\mathbb {G}}_j \times {\mathcal {R}}\) is defined by

$$\begin{aligned} {\mathcal {F}}_j : \left\{ \begin{array}{ccc} {\mathcal {L}} \times {\mathbb {G}}_j \times {\mathcal {R}} &{}\rightarrow &{} \!\!\!\!\!\!\!\!\!\!\!\!{\mathbb {C}}^{ {\mathcal {L}} \times \widehat{{\mathbb {G}}_j} \times {\mathcal {R}}} \\ \psi &{} \mapsto &{} \big ( \displaystyle h_j \sum _{g_j \in {\mathbb {G}}_j} \psi _{r,g_j, \ell } e^{-i g_j\omega _j } \big )_{ (r,\omega _j, \ell ) }. \end{array} \right. \end{aligned}$$

The discrete partial inverse Fourier transforms are defined similarly and are the inverses of the discrete inverse Fourier transforms

$$\begin{aligned} {\mathcal {F}}_j^{-1} : \left\{ \begin{array}{ccc} {\mathcal {L}} \times \widehat{{\mathbb {G}}_j} \times {\mathcal {R}} &{}\rightarrow &{}\!\!\!\!\!\!\!\!\!\!\!\! {\mathbb {C}}^{ {\mathcal {L}} \times {\mathbb {G}}_j \times {\mathcal {R}}} \\ \psi &{} \mapsto &{} \Big ( \displaystyle \frac{\eta _j}{2\pi } \sum _{\omega _j \in \widehat{{\mathbb {G}}_j}} \psi _{r,\omega _j, \ell } e^{i g_j\omega _j } \Big )_{ (r,g_j, \ell ) }. \end{array} \right. \end{aligned}$$

Note that these discrete transforms can be computed efficiently using Fast Fourier Transforms. Finally, the multipliers are naturally discretized through pointwise multiplications. An explicit example is provided in Algorithm 2 for Schrödinger equations.

3 Application to Transport Equations

In this section, we introduce the exact splittings for constant coefficients transport equations. The transport equation we consider here is

$$\begin{aligned}&\partial _t f(\mathbf{x}, t) = ({ M} \mathbf{x})\cdot \nabla f(\mathbf{x},t), \quad {\mathbf{x }} \in {{\mathbb {R}}}^n, \ n\ge 1, \ f({\mathbf{x}}, t=0) = f_0({\mathbf{x }}), \end{aligned}$$
(5)

where M is a real square matrix of size \(n\ge 1\) such that

$$\begin{aligned} \left\{ \begin{array}{lll} \forall i, \ &{}M_{i,i} = 0, \\ \exists i,\forall j \ne i , &{} M_{j,i} \ne 0, \end{array} \right. \end{aligned}$$
(6)

and the corresponding symbol of (5) is \(p(X) = -i (M {\mathbf{x }}) \cdot {\varvec{\xi }}\) according to the notation (2).

Even if the solution of (5) can be computed from the initial condition as \(f({\mathbf{x }}, t) = f_0(e^{tM}{\mathbf{x }})\), efficient numerical methods are required when the initial data is only known on a mesh or when (5) is a part of more complex models. Below, we start by giving some details of the time (exact) splittings before illustrating the efficiency with numerical results.

3.1 Presentation of the Exact Splittings

In this part, we construct an exact splitting for (5). Let us start with a simple example for \(n=2\) and \(M = \begin{pmatrix} 0 &{} 1 \\ -1 &{} 0 \end{pmatrix}\), \(e^{{t} M}\) becomes a two dimensional rotation matrix, which can be expressed as the product of three shear matrices (see [13])

$$\begin{aligned} e^{{ t }M} = \begin{pmatrix} 1&{}\tan ( {t}/2) \\ 0 &{} 1 \end{pmatrix} \begin{pmatrix} 1&{}0 \\ -\sin { {t}} &{} 1 \end{pmatrix} \begin{pmatrix} 1&{}\tan ( {t}/2) \\ 0 &{} 1 \end{pmatrix}. \end{aligned}$$
(7)

As a consequence, the computation of f can be done by solving three one dimensional linear equations (in \(x_1\), \(x_2\), and \(x_1\) directions successively), i.e.,

$$\begin{aligned} \begin{aligned}&f_0(\mathbf{x}) {\mathop {\longrightarrow }\limits ^{\tan ({t}/2)}} f_0( x_1 + \tan ({t}/2)x_2, x_2) {\mathop {\longrightarrow }\limits ^{-\sin ({t})}} f_0(x_1+ \tan ({t}/2)(x_2-\sin ({t})x_1), x_2-\sin ({t})x_1)\\&{\mathop {\longrightarrow }\limits ^{\tan ({t}/2)}} f(\mathbf{x}, t). \end{aligned} \end{aligned}$$
(8)

Formula (7) has been used in the computation of Vlasov–Maxwell equations to improve efficiency and accuracy by avoiding high dimensional reconstructions in [2, 13].

For the case \(n=3\) and M is skew symmetric, similar formula of expressing the rotation matrix \(e^{tM}\) as the product of 4 shear matrices is proposed in [18, 34]. To generalize this formula to transport equations in arbitrary dimension, we have the following result proved in [12].

Proposition 1

Let M be a real square matrix of size \(n\ge 1\) satisfying condition (6) and \(i\in \{1, \dots ,n\}\), then there exist \(t_0>0\) and an analytic function \((y^{(\ell )},(y^{(k)})_{k=1, \dots , n ; k\ne i},y^{(r)}):(-t_0,t_0)\rightarrow {\mathbb {R}}^{n\times (n+1)}\) satisfying

$$\begin{aligned} \left\{ \begin{array}{lll} y^{(\ell )}_i = y^{(r)}_i =0 \\ \forall k\ne i, \ y^{(k)}_k = 0 \end{array} \right. \end{aligned}$$
(9)

such that for all \(t\in (-t_0,t_0)\) we have

$$\begin{aligned} e^{t M{\mathbf{x }}\cdot \nabla } = e^{t (y^{(\ell )}(t)\cdot {\mathbf{x}})\partial _{x_i}} \left( \prod _{ k\ne i} e^{t (y^{(k)}(t)\cdot {\mathbf{x }})\partial _{x_k}} \right) e^{t (y^{(r)}(t)\cdot {\mathbf{x}})\partial _{x_i}}. \end{aligned}$$
(10)

Remark 1

Proposition 1 not only enables to recover some results from the literature (in particular when M is skew symmetric) but also it claims that n dimensional linear equations of the form (5) can be split into \((n+1)\) one dimensional linear equations which can be solved very efficiently by means of pseudo-spectral methods or semi-Lagrangian methods. In particular, this turns out to be much more efficient than standard Strang splitting which would require \(2(n-1)+1\) one dimensional linear equations to solve. Let us also recall that Strang splittings are second order accurate whereas the splittings proposed in Proposition 1 are exact in time.

Remark 2

Let us remark that when every non-diagonal element of M is not zero, n! different exact splittings (10) can be constructed, which is the number of permutations of set \(\{1, 2, \cdots , n\}\).

Remark 3

Another alternative to solve (5) would be the direct n-dimensional semi-Lagrangian method. However, this approach brings huge computational cost at the interpolation stage.

3.2 Practical Construction of the Exact Splitting

Following Proposition 2.1 in [12], we write a code from Algorithm 1 to compute the coefficients \(y^{(\ell )}, y^{(r)}, y^{(k)} (k\ne i)\) arising in the exact splitting (10). For the sake of simplicity, we present the pseudo-code to construct the following splitting

$$\begin{aligned} e^{t M{\mathbf{x }}\cdot \nabla } = e^{t (y^{(\ell )}(t)\cdot {\mathbf{x}})\partial _{x_1}} \left( e^{t (y^{(2)}(t)\cdot {\mathbf{x}})\partial _{x_2}}\dots e^{t (y^{(n)}(t)\cdot {\mathbf{x}})\partial _{x_n}} \right) e^{t (y^{(r)}(t)\cdot {\mathbf{x}})\partial _{x_1}}. \end{aligned}$$
figure b

3.3 Numerical Results

Exact splittings are used to solve 3D and 4D transport equations, and compared with the usual Strang splittings and Semi-Lagrangian methods combined with NUFFT in space. We are interested in the numerical approximation of

$$\begin{aligned} \partial _t{ f({\mathbf{x }}, t)}= (M{\mathbf{x }}) \cdot \nabla f({\mathbf{x }}, t), \quad f({\mathbf{x }}, t=0) = f_0({\mathbf{x }}), \quad {\mathbf{x }}\in {\mathbb {R}}^n, \end{aligned}$$
(11)

for \(n=3, 4\). For numerical reasons, the domain will be truncated to \([-R, R]^n\) and we will consider N points per direction so that the mesh size is \(h=2R/N\). The grid, defined as usual through (4), is denoted \({\mathbb {G}}^n\). We shall denote \(f^n_g\) by an approximation of the exact solution of (11) with \(g\in {\mathbb {G}}^n\), and \(\Delta t>0\) is the time step. We also define the \(L^2\) error between the numerical solution and the exact one as

$$\begin{aligned} \sqrt{h^n \sum _{g\in {\mathbb {G}}^n} |f^n_g - f(n\Delta t,g)|^2}. \end{aligned}$$
(12)

3D transport equation

We consider (11) in the case \(n=3\) with

$$\begin{aligned} M = \begin{pmatrix} 0 &{} -0.36 &{} -0.679\\ 0.36 &{} 0 &{} -0.758\\ 0.679 &{} 0.758 &{} 0 \end{pmatrix}. \end{aligned}$$

The domain is defined by \(R=2\) and initial value is chosen as follows

$$\begin{aligned} f_0(\mathbf{x}) = \frac{1}{2(\pi \beta )^2}\Big (e^{-(x_1-0.3)^2/\beta }+ e^{-(x_1+0.3)^2/\beta }\Big )e^{-x_2^2/\beta } e^{-x_3^2/\beta }, \end{aligned}$$

with \(\beta = 0.06\). The following three numerical methods are used to solve the three dimensional transport equation

  • NUFFT: direct 3D Semi-Lagrangian method combined with interpolation by NUFFT; this method is exact in time.

  • Strang: Strang directional splitting method combined with Fourier pseudo-spectral method; this method is second order accurate in time.

  • ESR: Exact splitting (10) combined with Fourier pseudo-spectral method; this method is exact in time.

Let us detail the coefficients used for ESR. From Prop. 1 (with \(i=3\)), we have

$$\begin{aligned} e^{\Delta t{M}{\mathbf{x }}\cdot \nabla } = e^{\Delta t(y^{(\ell )}\cdot {\mathbf{x }})\partial _{x_3}} e^{\Delta t(y^{({1})}\cdot {\mathbf{x}})\partial _{x_1}} e^{\Delta t(y^{({2})}\cdot {\mathbf{x}})\partial _{x_2}} e^{\Delta t(y^{(r)}\cdot {\mathbf{x}})\partial _{x_3}}, \end{aligned}$$

where the coefficients are as follows when \(\Delta t = 0.3\)

$$\begin{aligned} y^{(\ell )} \simeq \begin{pmatrix} 0.467187759219503 \\ 0.257781732992119 \\ 0 \end{pmatrix}, \;\; \;\; y^{({1})} \simeq \begin{pmatrix} 0 \\ -0.381811510002637 \\ -0.626618917055694 \end{pmatrix}, \end{aligned}$$

and

$$\begin{aligned} y^{({2})} \simeq \begin{pmatrix} 0.386696405646122 \\ 0 \\ -0.708474220370764 \end{pmatrix}, \;\; \;\; y^{(r)} \simeq \begin{pmatrix} 0.205015116583865 \\ 0.492630313928284 \\ 0 \end{pmatrix}. \end{aligned}$$

First, the time evolution of the \(L^2\) error (defined by (12)) is plotted in Fig. 1 for Strang and ESR for \(N=64\) and \(\Delta t=0.3\). As expected, we observe that the error from ESR is close to the level of \(10^{-11}\) whereas the error from Strang is much larger. We can also see that the error from Strang has an almost periodic behavior (similar to what has been observed in 2D case in [13]). As in [13], this phenomena is well explained by its backward error analysis. In the Sect. 1 of the Appendix, we prove that it is associated with the transport equation of a rotation (up to a near identity map) whose pulsation coincides with that of \(e^{tM}\) up to a correction of order \(\Delta t^2\). We also compare in Fig. 1 the CPU time of the two methods and the NUFFT method (which also gives error close to machine precision) by running them for 100 steps. We can observe that ESR is the most efficient. Indeed, for each time step, 5 one dimensional transport equations are needed for Strang splitting, whereas ESR only has 4 one dimensional transport equations to solve. Moreover, the NUFFT method is the most expensive, even if NUFFT and ESR have the same complexity \({{{\mathcal {O}}}}(N^3 \log (N))\). Let us mention that parallelization can be developed to improve the efficiency of splitting methods like ESR (see [13, 19]).

Fig. 1
figure 1

a Time evolution of \(L^2\) error (semi-\(\log _{10}\) scale) for NUFFT, ESR, and Strang for 3D transport problem with grids \(64 \times 64 \times 64\) and step size \(\Delta t = 0.3\); b CPU time for NUFFT, ESR and Strang of running 100 steps

4D transport equation

We consider now the case \(n=4\) where the matrix M in (5) is given by

$$\begin{aligned} M = \begin{pmatrix} 0 &{} 1 &{}-1.5 &{} -3\\ -1 &{} 0 &{} 2 &{} 1\\ 1.5 &{} -2 &{} 0 &{} 0 \\ 3 &{} -1 &{} 0 &{} 0 \end{pmatrix}. \end{aligned}$$

The domain is defined by \(R = 5\) and the initial value is

$$\begin{aligned} f_0({\mathbf{x }}) = \left( \frac{2}{\pi }\right) ^4 e^{-{|\mathbf{x}|}^2}. \end{aligned}$$
(13)

Since the direct 4D semi-Lagrangian method would be too costly, we compare here the Strang directional splitting and the new method ESR. From Proposition  1, we define the ESR method by (here we have chosen \(i=2\))

$$\begin{aligned} e^{\Delta t M{\mathbf{x }}\cdot \nabla } = e^{\Delta t(y^{(\ell )}\cdot {\mathbf{x }})\partial _{x_2}} \left( e^{\Delta t(y^{(1)}\cdot {\mathbf{x }})\partial _{x_1}} e^{\Delta t(y^{(3)}\cdot {\mathbf{x}})\partial _{x_3}} e^{\Delta t(y^{(4)}\cdot {\mathbf{x}})\partial _{x_4}} \right) e^{\Delta t(y^{(r)}\cdot {\mathbf{x}})\partial _{x_2}}, \end{aligned}$$

whose coefficients are (when \(\Delta t=0.05\))

The space grid has \(N=47\) points per direction and the final computation time is \(t = 100\) for the two methods (Strang and ESR). Contour plots of \(f(t, x_1, x_2, x_3=-0.9574, x_4=-0.9574)\) at \(t=100\) by ESR, Strang method are presented in Fig. 2a, b. Compared with the exact solution in Fig. 2c, we can observe that the Strang method has larger error which is partly due to the wrong angular velocity. Moreover, in Fig. 2d, the time evolutions of the \(L^2\) error defined in (12) are plotted for the Strang method (\(10^{-2}\)) and ESR method (\(10^{-11}\)). Let us remark that other than pseudo-spectral method, alternative reconstruction methods can also be chosen such as high order interpolation methods (see [16]). Regarding the complexity, only \(n+1=5\) shears are required in the exact splitting for each time step whereas \(2n-1=7\) shears are needed for the Strang splitting.

Fig. 2
figure 2

a Contour plots of \(f(t=30, x_1, x_2,-0.9574,-0.9574 )\) computed by a ESR and b Strang method; c Contour plots of exact \(f(t=30, x_1, x_2,-0.9574,-0.9574 )\); d Time evolution of \(L^2\) solution error

4 Application to Fokker–Planck Equations

In this section, we are interested in Fokker–Planck type equations which can be used to describe particle systems (in plasma physics or astrophysics). The unknown is a distribution function of particles \(f(t, x, v)\in {\mathbb {R}}^+\) with time \(t\ge 0\), space \(x\in {\mathbb {R}}\), and velocity \(v\in {\mathbb {R}}\). We will focus on two examples which both contain a free transport part in x and an operator (related to collisional terms) which only acts on the v direction. The first example is the Kramer–Fokker–Planck equation (see [20, 22, 23] for some mathematical and numerical aspects)

$$\begin{aligned} \partial _t f + v^2 f-\partial _v^2f+v\partial _x f= 0, \;\; f(t=0, x, v)=f_0(x, v). \end{aligned}$$
(KFP)

The second example is the Fokker–Planck equation (see [20, 22, 24] for some mathematical and numerical aspects)

$$\begin{aligned} \partial _t f + v\partial _x f - \partial _v^2 f - \partial _v (v f )= 0, \;\; f(t=0, x, v) = f_0(x,v). \end{aligned}$$
(FP)

For these two examples which enter in the class of inhomogeneous quadratic equations, exact splittings will be recalled from [12] and numerical results will be given.

4.1 Presentation of the Exact Splittings

For the Kramer–Fokker–Planck (KFP) equation, the symbol is \(p(x, v, \xi , \eta ) = v^2 + \eta ^2 + iv\xi \), and the symbol is \(p(x, v, \xi , \eta ) = iv \xi + \eta ^2 - iv \eta - \frac{1}{2}\) for the Fokker–Planck (FP) equation, where \(\xi \) (resp. \(\eta \)) denotes the Fourier variable of x (resp. v). We can see that for both cases, the symbols are polynomial functions of degree 2 and according to [12], the solutions can be split exactly into simple flows. More precisely, for KFP, we have the following exact splitting formula

$$\begin{aligned} \forall t\ge 0, \ e^{-t(v^2-\partial _v^2+v\partial _x)} = e^{-\frac{1}{2} \tanh (t) \, v^2} e^{ \nabla \cdot (A^\mathrm{KFP}_t \nabla )} e^{- \tanh (t) \, v\partial _x} e^{-\frac{1}{2} \tanh (t) \, v^2}, \end{aligned}$$
(14)

with \(\nabla =(\partial _x, \partial _v)\) and where \(A_t\) is the following nonnegative matrix defined by

$$\begin{aligned} A^\mathrm{KFP}_t = \frac{1}{2} \begin{pmatrix} \frac{1}{2}\left( t - \tanh (t)(1-\sinh ^2(t))\right) &{} \;\; \sinh ^2(t)\\ \sinh ^2(t) &{} \;\; \sinh (2t) \end{pmatrix} . \end{aligned}$$
(15)

For FP, we have the exact splitting formula

$$\begin{aligned} e^{- t ( v\partial _x - \partial _v^2 - \partial _v v )} = e^{t/2} e^{- (e^t-1) v\partial _x } e^{ \nabla \cdot (A^\mathrm{FP}_t \nabla )} e^{ i\alpha _t \partial _v^2} e^{-i \beta _t v^2} e^{-i \beta _t \partial _v^2} e^{i \alpha _t v^2}, \end{aligned}$$
(16)

where \(\alpha _{t} = \frac{1}{2} \sqrt{(1 - e^{-t})e^{-t}}\), \(\beta _t = \frac{1}{2} \sqrt{e^t-1}\), and \(A^\mathrm{FP}_t\) is the following positive matrix (see [1]) defined by

$$\begin{aligned} A^\mathrm{FP}_t =\frac{1}{2} \begin{pmatrix} e^{2t} + 2t + 3 -4 e^t &{} \;\; -4 \sinh ^2(t/2) \\ -4 \sinh ^2(t/2) &{} \;\; 1-e^{-2t} \end{pmatrix}. \end{aligned}$$

Below, we detail a bit the link between exact splittings for PDEs and corresponding finite dimensional Hamiltonian systems on the example of KFP. Following [12], the exact splitting (14) is equivalent to the following equality between matrices

$$\begin{aligned} e^{-2itJQ} = e^{-2itJQ_1}e^{-2itJQ_2}e^{-2itJQ_3}e^{-2itJQ_1}, \end{aligned}$$
(17)

where J is the symplectic \(4 \times 4\) matrix, \(Q, Q_i \in \mathrm {S}_4({\mathbb {C}})\) (\(i=1, 2, 3\)) are the matrices corresponding to the quadratic forms \(q, q_i\) (\(i=1, 2, 3\)) defining the operators involved in the exact splitting (14). Indeed, the quadratic form q associated to the quadratic operator \(q^w:=v^2-\partial _v^2 +v\partial _x\) is with \(X=(x, v, \xi , \eta )\) and Q is

$$\begin{aligned} Q=\begin{pmatrix} 0 &{} 0 &{} 0 &{} 0 \\ 0 &{} 1 &{} i/2 &{} 0 \\ 0 &{} i/2 &{} 0 &{} 0 \\ 0 &{} 0 &{} 0 &{} 1 \end{pmatrix}. \end{aligned}$$

Let us define the other quadratic forms involved in (14): where

$$\begin{aligned} Q_1=\frac{\tanh (t)}{t} \begin{pmatrix} 0 &{} 0 &{} 0 &{} 0 \\ 0 &{} 1 &{} 0 &{} 0 \\ 0 &{} 0 &{} 0 &{} 0 \\ 0 &{} 0 &{} 0 &{} 0 \end{pmatrix}, \; Q_2=\frac{1}{t} \begin{pmatrix} \mathbf{0}_2 &{} \mathbf{0}_2 \\ \mathbf{0}_2 &{} A_t^{KFP} \end{pmatrix}, \; Q_3=\frac{\tanh (t)}{t} \begin{pmatrix} 0 &{} 0 &{} 0 &{} 0 \\ 0 &{} 0 &{} i/2 &{} 0 \\ 0 &{} i/2 &{} 0 &{} 0 \\ 0 &{} 0 &{} 0 &{} 0 \end{pmatrix}, \end{aligned}$$

\(\mathbf{0}_2\) is the zero 2x2 matrix and \(A_t^\mathrm{KFP}\) is given by (15).

4.2 Numerical Results

In this section, numerical simulations are performed using the above exact splittings to illustrate the exponential decay to equilibrium property and regularizing effects. Let us remark that since the Fokker–Planck and Krammer–Fokker–Planck operators are homogeneous with respect to the space variable x, we do not have to consider localized functions and thus consider periodic functions in this direction. The domain is truncated to \([-R_1, R_1]\times [-R_2, R_2]\) and the number of uniform grids is \(N_1\) (resp. \(N_2\)) in x-direction (resp. the v-direction).

Fokker–Planck equation

For the FP equation, we aim at checking an important property that the solution converges to the equilibrium state exponentially with time (see [20]). The domain is taken as \(R_1=\pi \) and \(R_2=7\) (so that \((x, v)\in [-\pi , \pi ] \times [-7,7]\)). The initial function is

$$\begin{aligned} f_0(x,v) = \frac{1}{\sqrt{2\pi }}\exp (-v^2/2) \left( 1+0.5\sin (x)\cos (\frac{\pi }{7}v)\right) . \end{aligned}$$

We are interested in the time evolution of the entropy which is defined by

$$\begin{aligned} {\mathcal {F}}(t) = \int _0^L \int _{-\infty }^{\infty } \frac{(f(t, x, v)-\mu (v))^2}{\mu (v)} \mathrm {d}v\mathrm {d}x, \end{aligned}$$
(18)

with \(\mu (v) = \frac{1}{\sqrt{2 \pi }} e^{-\frac{v^2}{2}}\).

The numerical parameters are \(N_1=27\), \(N_2=181\), the time step is \(\Delta t = 0.1\) and the simulation is ended at \(t =20\). In Fig. 3, the contour plots of distribution function are plotted at the initial and the ending time and we can observe the relaxation towards the Maxwellian profile. This is more quantitatively shown in Fig. 3c where the time history of entropy (18) is plotted. Indeed, the exponential decay is clearly observed, the rate is equal to \(-1.99\) (red straight line), which is in good agreement with [20].

Fig. 3
figure 3

a Initial distribution function \(f(t=0, x, v)\); b distribution function at \(t=20\): \(f(t=20, x, v)\); (c) time evolution of the entropy given by (18)

Kramer–Fokker–Planck equation

Now we apply the exact splitting for the numerical simulation of the KFP equation. The domain is chosen with \(R_1=4\) and \(R_2=15\) (so that \((x, v)\in [-4, 4] \times [-15, 15]\)). In the following experiments, we consider \(N_1=N_2=199\). The initial function is

$$\begin{aligned} f_0(x, v)=\frac{1}{8\sqrt{2\pi }} e^{-\frac{v^2}{2}}. \end{aligned}$$

First, in Fig. 4a, we plot the \(L^2\) norm (in \(\log _{10}-\log _{10}\) scale) of the following formula

$$\begin{aligned} e^{- \Delta t(v^2-\partial _v^2+v\partial _x)}f_0(x, v)-e^{- \Delta t/2(v^2-\partial _v^2+v\partial _x) }e^{- \Delta t/2(v^2-\partial _v^2+v\partial _x) }f_0(x, v) \end{aligned}$$
(19)

using different time steps. Two different methods are used to compute

\(e^{- t(v^2-\partial _v^2+v\partial _x) }f_0(x, v)\): the exact splitting (14) and a Strang operator splitting. First, we observe that the exact splitting gives an error at the machine precision level whereas we obtain an error of \({{{\mathcal {O}}}}(\Delta t^3)\) which corresponds the local error of the Strang method and confirms the correct implementation of the algorithms.

Then, we illustrate the regularizing effects property of the evolution operator in KFP [1]. To do so, the initial condition is chosen as random values (discrete \(L^1\) norm is 1) and the step size is \(\Delta t = 0.1\). In Fig. 5, the contour plots of distribution function are displayed for different times: \(t=0, 0.2, 1, 100\). We observe that starting from a random initial value, the numerical solution becomes smoother as time increases. Moreover, it can be proved that the solution is exponentially decreasing towards zero with time. This is illustrated in Fig. 4b where we plot the time history of \(L^2\) norm of f (semi-\(\log _{10}\) scale).

Fig. 4
figure 4

a \(L^2\) error (\(\log _{10}-\log _{10}\) scale) of the formula (19) with different time step size \(\Delta t\); b Time evolution of the \(L^2\) norm (in x and v) of f in semi-\(\log _{10}\) scale

Fig. 5
figure 5

Time evolution of the distribution function f a \(t = 0\); b \(t = 0.2\); c \(t = 1\); d \(t = 100\)

5 Application to Schrödinger Equations

In this section, we recall and apply exact splitting methods for Schrödinger type equations in [12]: magnetic Schrödinger equations, and rotating Gross-Pitaevskii equations (see [5, 9, 11, 17, 32] for more details on these models).

We consider the following linear Schrödinger equation (with a rotation term and a quadratic external potential) of unknown \(\psi (\mathbf{x}, t)\in {\mathbb {C}}\) with \({\mathbf{x }}\in {\mathbb {R}}^n, \ t \in {\mathbb {R}}_{+}\)

$$\begin{aligned} \begin{aligned}&i \frac{\partial \psi (\mathbf{x}, t)}{\partial t} = -\frac{1}{2}\Delta \psi (\mathbf{x},t) - i ({ B} \mathbf{x})\cdot \nabla \psi (\mathbf{x},t) + V(\mathbf{x})\psi (\mathbf{x},t), \;\; \psi ({\mathbf{x }}, t=0) = \psi _0({\mathbf{x }}), \end{aligned} \end{aligned}$$
(QM)

where \(n\in {\mathbb {N}}^*\), \(B \in A_n({\mathbb {R}})\) is a skew symmetric matrix of size n and \(V : {\mathbb {R}}^n \rightarrow {\mathbb {R}}\) is a quadratic potential. According to the previous framework, this model is an inhomogeneous quadratic PDE, since it can be represented by the following symbol

$$\begin{aligned} p(X) = i\frac{|\varvec{\xi }|^2}{2} + iB \mathbf{x } \cdot {\varvec{\xi }} + iV(\mathbf{x }), \;\; X=(\mathbf{x },\varvec{\xi })\in {\mathbb {R}}^{2n}. \end{aligned}$$
(20)

In the sequel, an exact splitting is presented. Then, extensions to nonlinear and non-quadratic Schrödinger equations are discussed. This section will be ended by several numerical results that will be compared to different numerical methods from the literature to illustrate the efficiency of our approach.

5.1 Presentation of the Exact Splitting

We present an exact splitting method for (QM) which has been introduced in [12].

Theorem 1

There exists some quadratic forms \(v_t^{(r)}, a_t\) on \({\mathbb {R}}^{n}\), a strictly upper triangular matrix \(U_t \in M_n({\mathbb {R}})\), a strictly lower triangular matrix \(L_t \in M_n({\mathbb {R}})\) and a diagonal quadratic form \(v_t^{(\ell )}\) on \({\mathbb {R}}^{n}\), all depending analytically on \(t\in (-t_0,t_0)\) for some \(t_0>0\), such that for all \(t\in (-t_0,t_0)\) we have

$$\begin{aligned} e^{ i t ( \Delta /2 - V({\mathbf{x }})) - t B {\mathbf{x }}\cdot \nabla } =e^{-i t v^{(\ell )}_t({\mathbf{x }})} \left( \prod _{j=1}^{n-1} e^{- t (U_t {\mathbf{x }})_j \partial _{x_j}} \right) e^{i t a_t(\nabla )} \left( \prod _{j=2}^{n} e^{- t (L_t {\mathbf{x }})_j \partial _{x_j}} \right) e^{-i t v^{(r)}_t({\mathbf{x }})}\nonumber \\ \end{aligned}$$
(21)

where \(a_t(\nabla )\) denotes the Fourier multiplier of symbol \(-a_t({\varvec{\xi }})\) and \((U_t {\mathbf{x }})_j\) (resp. \((L_t {\mathbf{x }})_j\)) the \(j^{\mathrm {st}}\) coordinate of \(U_t {\mathbf{x}}\) (resp. \(L_t {\mathbf{x }}\)).

Let us detail this splitting to emphasize the fact that due to the triangular structure of the matrices \(L_t\) and \(U_t\), only 2n FFT calls are required in every step:

  • From \(e^{-i t v^{(r)}_t({\mathbf{x }})} \) to \(e^{- t (L_t {\mathbf{x }})_n \partial _{x_n}}\), we need a FFT in \(x_n\) direction;

  • From \(e^{- t (L_t {\mathbf{x }})_j \partial _{x_j}}\) to \(e^{- t (L_t {\mathbf{x }})_{j-1} \partial _{x_{j-1}}}, \ j \in \llbracket 3, n\rrbracket \), as \(L_t\) is a strictly lower triangular matrix, \((L_t {\mathbf{x }})_j\) only depends on \(x_i, \, i \in \llbracket 1, j-1 \rrbracket \), then we only need a FFT in \(x_{j-1}\) direction.

  • From \(e^{- t (L_t {\mathbf{x }})_2 \partial _{x_2}}\) to \(e^{i t a_t(\nabla )}\), we need a FFT in \(x_{1}\) direction.

  • From \(e^{i t a_t(\nabla )}\) to \(e^{- t (U_t {\mathbf{x }})_{n-1} \partial _{x_{n-1}}}\), we need an inverse FFT in \(x_{n}\) direction;

  • From \(e^{- t (U_t {\mathbf{x }})_j \partial _{x_j}}\) to \(e^{- t (U_t {\mathbf{x }})_{j-1} \partial _{x_{j-1}}}, \ j \in \llbracket 2, n-1\rrbracket \), because \(U_t\) is a strictly upper triangular matrix, \((U_t {\mathbf{x }})_{j-1}\) only depends on \(x_i, \, i \in \llbracket j, n \rrbracket \), we only need an inverse FFT in \(x_{j}\) direction.

  • From \(e^{- t (U_t {\mathbf{x }})_{1} \partial _{x_{1}}}\) to \(e^{-i t v^{(\ell )}_t({\mathbf{x }})} \), we need an inverse FFT in \(x_{1}\) direction.

To sum up, this new method only needs 2n FFT (or inverse FFT) calls in every time step.

Below, we detail a bit the link of exact splittings between the Schrödinger equations and corresponding finite dimensional Hamiltonian systems. Following [12], the exact splitting (21) is equivalent to prove an equality at the level of matrices. Indeed, from Hörmander [26], there exists a morphism between the Hamiltonian flow of the following linear ODE \(\dot{X} = -iJ \nabla p(X)\) and \(e^{-p^w}\) (up to one sign), where J is the symplectic matrix of size 2n. So we can check the following exact splitting at the linear ODE level for (21):

$$\begin{aligned} e^{-2itJ Q} = e^{-2itJ V^{(\ell )}} \left( { \prod _{j=1}^{n-1}} e^{-2itJ U^{(j)}} \right) e^{-2itJ A} \left( {\prod _{j=2}^n} e^{-2itJ L^{(j)}} \right) e^{-2itJ V^{(r)}}, \end{aligned}$$
(22)

where \(Q, V^{(\ell )}, U^{(j)}, A, L^{(j)}, V^{(r)}\) are symmetric matrices of the quadratic forms (symbols) of the following operators \(iv^{(\ell )}_t({\mathbf{x }}), i(U_t{\mathbf{x }})_j \partial _{x_j}, -iA_t(\nabla ), i(L_t{\mathbf{x }})_j \partial _{x_j}\), \(iv^{(r)}_t({\mathbf{x }})\) respectively.

5.2 Practical Construction of the Splittings

In this subsection, the iteration method giving the coefficients in the above exact splitting is presented. The proof for Theorem 1 is based on the implicit function theorem which gives a practical way to construct the exact splitting. Indeed, it furnishes an iteration method which is presented below. We refer to [12] for more details.

In this context, the iterative method giving the coefficients of the exact splitting can be made much more explicit. Indeed, identifying a quadratic form with its symmetric matrix, if the time step size t is small enough, we define, by induction, the following sequences

$$\begin{aligned} \left\{ \begin{array}{lll} A_{t,k+1} &{}=&{} A_{t,k} + I_n/2 - \widetilde{A}_{t,k} \\ L_{t,k+1} &{}=&{} L_{t,k} + L - \widetilde{L}_{t,k}\\ U_{t,k+1} &{}=&{} U_{t,k} + U - \widetilde{U}_{t,k} \\ V_{t,k+1}^{(m)} &{}=&{} V_{t,k}^{(m)} + V - \widetilde{V}_{t,k}^{(m)} + \frac{t}{2} [D_{t,k},B ] + \frac{t^2}{2} D_{t,k}^2 \end{array} \right. \end{aligned}$$

where \((A_{t,0},L_{t,0}+U_{t,0},V_{t,0}^{(m)}) = (I_n/2,B,V)\), \(L+U=B\) and

and

with \(L_{t,k}^{(j)} = (e_j \otimes e_j)L_{t,k}\), \(U_{t,k}^{(j)} = (e_j \otimes e_j)U_{t,k}\) and \((e_1,\dots ,e_n)\) the canonical basis of \({\mathbb {R}}^n\).

One can prove that the sequence \((\widetilde{A}_{t,k}, \widetilde{L}_{t,k}, \widetilde{U}_{t,k}, -\frac{t}{2} D_{t, k}, V_{t,k}^{(m)} + \frac{1}{2}D_{t,k})\) generated by this induction converges towards the elements in the exact splitting 1, i.e.

$$\begin{aligned} |A_t - \widetilde{A}_{t,k} | + |L_t - \widetilde{L}_{t,k} | + |U_t - \widetilde{U}_{t,k} | + |V_t^{(\ell )} + \frac{1}{2} D_{t,k} | + |V_t^{(r)} - V_{t,k}^{(m)} - \frac{1}{2}D_{t,k} | \le \left( \frac{t}{\tau _0} \right) ^k. \end{aligned}$$

as soon as t is small enough (\(0<|t|<\tau _0\) for a given \(\tau _0>0\)).

5.3 Extension to More General Schrödinger Equations

Before presenting some numerical results, some time discretizations based on the previous exact splittings are proposed here in order to deal with more general Schrödinger equations. Keeping the same notations \(\psi (\mathbf{x}, t)\in {\mathbb {C}}\) for the unknown (\(\mathbf{x} \in {\mathbb {R}}^n\) and \(t\ge 0\)), we then consider the following Schrödinger equation to illustrate our strategy

$$\begin{aligned} \begin{aligned}&i \frac{\partial \psi (\mathbf{x}, t)}{\partial t} = -\frac{1}{2}\Delta \psi (\mathbf{x},t) - i ({ B} \mathbf{x})\cdot \nabla \psi (\mathbf{x},t) + V(\mathbf{x})\psi (\mathbf{x},t) + f(\mathbf{x}, |\psi |^2) \psi (\mathbf{x},t), \end{aligned} \end{aligned}$$
(23)

where f is a real valued function, \({B} \in A_n({\mathbb {R}})\) is a skew symmetric matrix of size n, and \(V(\mathbf{x}) :{\mathbb {R}}^n\rightarrow {\mathbb {R}}\) is a real valued quadratic potential. Some well known examples can be given in the case \(n=2, 3\)

  • \(f(\mathbf{x}, |\psi |^2) = \beta |\psi |^2\) (\(\beta \in {\mathbb {R}}\)), \(({ B{\mathbf{x }}}) \cdot \nabla \psi = \Omega (x_2 \partial _{x_1} - x_1\partial _{x_2})\psi , \ \Omega \in {\mathbb {R}}\). In this case, (23) is the so-called Gross–Pitaevskii equation (GPE) with an angular momentum rotation term (see [9, 11]).

  • \(f(\mathbf{x}, |\psi |^2)=V_{nq}(\mathbf{x})\) where \(V_{nq}(\mathbf{x})\) denotes a non-quadratic potential. Moreover, if \(V(\mathbf{x}) = \frac{1}{2}| { B{\mathbf{x }}}|^2\), (23) is the so-called magnetic Schrödinger equation (see [17, 28]).

On can show that (23) has the following two conserved quantities,

$$\begin{aligned} \begin{aligned}&\text {(mass)} \quad M(t) = \int _{{\mathbb {R}}^n}|\psi (\mathbf{x}, t)|^2 \mathrm {d}{} \mathbf{x}, \\&\text {(energy)} { \quad E(t) = \int _{{\mathbb {R}}^n} \Big [ \frac{1}{2}|\nabla \psi |^2 + V|\psi |^2 + F(\mathbf{x}, |\psi |^2) - \text {Re}(i({B} \mathbf{x})\cdot \nabla \psi \, \psi ^{*}) \Big ]\mathrm {d}{} \mathbf{x}}, \end{aligned} \end{aligned}$$
(24)

where \(F(\mathbf{x},\cdot )\) denotes the primitive of \(f(\mathbf{x},\cdot )\) vanishing at the origin and \(f^{*}\) and \(\text {Re}(f)\) denote the conjugate and real part of the function f respectively.

From the exact splitting presented above, we deduce a new splitting for (23). This splitting is based on Strang composition of the quadratic and the non-quadratic parts. Indeed, we first rewrite (23) as

$$\begin{aligned} i\partial _t \psi = -p^w \psi + f(\mathbf{x}, |\psi |^2) \psi , \end{aligned}$$

where \(-p^w\psi := -\frac{1}{2}\Delta \psi - i ({ B} \mathbf{x})\cdot \nabla \psi + V(\mathbf{x})\psi \) denotes the quadratic part (in the sense of Sect. 2) and \(f(\mathbf{x}, |\psi |^2) \psi \) denotes the non quadratic part (which can be nonlinear). Based on this formulation and on the fact that exact splittings have been derived for the quadratic part, we then propose the following splitting (ESQM method) for \(k\ge 0\)

$$\begin{aligned} \!\! ( \psi (\mathbf{x}, t_k)\approx ) \psi ^{ {k}}(\mathbf{x }) \! = \left( { e^{-i\frac{\Delta t}{2}f({\mathbf{x }}, |\cdot |^2)}} e^{-i\Delta t p^w} { e^{-i\frac{\Delta t}{2}f({\mathbf{x }}, |\cdot |^2)}} \right) ^{ {k}}\psi _0(\mathbf{x }), \end{aligned}$$
(25)

where the computation of \(e^{-i\Delta t p^w}\) is done using (21) and \(e^{-i\frac{\Delta t}{2}f({\mathbf{x }}, |\cdot |^2)}\) denotes the nonlinear operator defined by \(e^{-i\frac{\Delta t}{2}f({\mathbf{x }}, |\cdot |^2)}\psi = e^{-i\frac{\Delta t}{2}f({\mathbf{x }}, |\psi |^2)}\psi \). Let us remark that for this Strang based splitting, each part can be solved exactly in time and arbitrary high order time integrators can be constructed by composition methods (see [21]). It can also be shown that the \(L^2\) norm of \(\psi ^k\) is preserved by the numerical schemes proposed here. In Algorithm 2, we detail the different substeps of the splitting (25) involving the pseudo-spectral discretization in dimension 3.

figure c

Remark 4

Note that some optimizations can be performed in Algorithm 2 by noticing the following rearrangement (with \(K\Delta t= T_\mathrm{final}\))

$$\begin{aligned} \begin{aligned} \psi ^{K}&= \left( e^{-i\frac{\Delta t}{2}f({\mathbf{x }}, |\cdot |^2)} e^{i\Delta t (-V(\mathbf{x } )+ \frac{\Delta }{2} - B\mathbf{x }\cdot \nabla )}e^{-i\frac{\Delta t}{2}f({\mathbf{x }}, |\cdot |^2)} \right) ^{K}\psi ^0\\&=e^{-i\frac{\Delta t}{2}f({\mathbf{x }}, |\cdot |^2)-i \Delta t V^{(\ell )}_{\Delta t}({\mathbf{x }})} e^{ -t (U_{\Delta t} {\mathbf{x }})_1 \partial _{x_1} } e^{ -t (U_{\Delta t} {\mathbf{x }})_2 \partial _{x_2} } e^{i t A_{\Delta t}(\nabla )} e^{ -\Delta t (L_{\Delta t} {\mathbf{x }})_2 \partial _{x_2} } e^{ -\Delta t (L_t {\mathbf{x }})_3 \partial _{x_3} } \\&\left( e^{-i{\Delta t}f({\mathbf{x }}, |\cdot |^2)-i \Delta t V^{(\ell )}_{\Delta t}({\mathbf{x }})-i \Delta t V^{(r)}_{\Delta t}({\mathbf{x }})} e^{ -\Delta t (U_{\Delta t} {\mathbf{x }})_1 \partial _{x_1} } e^{ -\Delta t (U_{\Delta t} {\mathbf{x }})_2 \partial _{x_2} } e^{i \Delta t A_{\Delta t}(\nabla )} \right. \\&\left. e^{ -\Delta t (L_{\Delta t} {\mathbf{x }})_2 \partial _{x_2} } e^{ -\Delta t (L_{\Delta t} {\mathbf{x }})_3 \partial _{x_3} } \right) ^{K-1} e^{-i \Delta t V^{(r)}_{\Delta t}(\mathbf {x})-i\frac{\Delta t}{2}f({\mathbf{x }}, |\psi ^0|^2)} \psi ^0. \end{aligned} \end{aligned}$$
(26)

5.4 Numerical Results

This section is devoted to applications of exact splittings to the Schrödinger type equations (23) both in the two and three dimensional cases. We show higher accuracy and efficiency of the exact splittings by comparing with other usual numerical methods proposed in the literature [10, 11].

As previously, the space discretization requires a truncated domain denoted by \([-R_1, R_1] \times \dots \times [-R_n, R_n]\). We will consider a uniform grid with \(N_j\) points per direction so that the mesh size are \(2R_j/N_j\).

5.4.1 2D Schrödinger Equations

Firstly, we consider the application of the exact splittings in the two-dimensional case on the magnetic Schrödinger equation and on the rotating Gross–Pitaevskii equation.

2D magnetic Schrödinger equation

In this numerical experiment, following 2D magnetic Schrödinger equation is considered [28],

$$\begin{aligned} i\epsilon \partial _t \psi (\mathbf{x},t) = -\frac{\epsilon ^2}{2} \Delta \psi (\mathbf{x},t) + i\epsilon \mathbf{A} \cdot \nabla \psi (\mathbf{x},t) + \frac{1}{2}{|\mathbf{A}|}^2\psi (\mathbf{x},t), \end{aligned}$$
(27)

with \(\epsilon = 1/32\), \(\mathbf{x} = (x_1,x_2) \in {\mathbb {R}}^2\), and . The initial condition is given by

$$\begin{aligned} \psi _0(\mathbf{x}) = e^{-20(x_1-0.05)^2-20(x_2-0.1)^2} e^{i \sin (x_1) \sin (x_2)/\epsilon }. \end{aligned}$$

The numerical parameters are chosen as follows: \(N_1=N_2=256\), \(R_1=R_2=3\pi \) and \(\Delta t=0.3\). We shall compare three different splittings:

  • ESQM (see (25) with \(f=0\) and (21)); this method is exact in time.

  • ESR (see “Appendix 2”); this method is second order accurate in time.

  • Strang (see “Appendix 2”); this method is second order accurate in time.

Let us remark that ESR and Strang are two operator splittings which differ from the treatment of the rotation part \(\partial _t \psi = \mathbf{A} \cdot \nabla \psi \). Indeed, this part is solved exactly in the ESR method (this is the reason why we used the same name as in Sect. 3) whereas a second order directional splitting is used in the Strang method. We refer to “Appendix 2” for details. From (21), the ESQM is

$$\begin{aligned} e^{i\epsilon \Delta t(\frac{\Delta }{2} - \frac{1}{2\epsilon ^2} |{\mathbf{A }}|^2) + \Delta t{{\mathbf{A }}}\cdot \nabla } = e^{-\epsilon \Delta tv^{(\ell )}({\mathbf{x }})} e^{-\epsilon \Delta t(U_{\Delta t}{\mathbf{x }})_1\partial x_1} e^{i\epsilon \Delta ta(\nabla )} e^{-\epsilon \Delta t(L_{\Delta t}{\mathbf{x}})_2\partial _{x_2}} e^{-\epsilon \Delta tv^{(r)}({\mathbf{x }})}, \end{aligned}$$

where , and \(a(\nabla ) = \nabla \cdot (A_{\Delta t} \nabla )\), \(V_{\Delta t}^{(\ell )}, L_{\Delta t}, U_{\Delta t}, V_{\Delta t}^{(r)}, A_{\Delta t}\) are the following \(2 \times 2\) matrices (\(\Delta t=0.3\))

$$\begin{aligned}&A_{\Delta t} \simeq \begin{pmatrix} 0.503532819405421 &{} -0.074439184790650 \\ -0.074439184790650 &{} 0.503784060194312 \end{pmatrix},\\&L_{\Delta t} \simeq \begin{pmatrix} 0 &{} 0 \\ -16.121089926218119 &{} 0 \end{pmatrix}, \quad U_{\Delta t} \simeq \begin{pmatrix} 0 &{} 15.761077688604765 \\ 0&{} 0 \end{pmatrix}, \\&V^{(\ell )}_{\Delta t} \simeq \begin{pmatrix} 128.9687194097432&{}0\\ 0 &{} -0.0000000000018 \end{pmatrix},\\&V^{(r)}_{\Delta t} \simeq \begin{pmatrix} 2.8800979009085&{}-19.0564313064080 \\ -19.0564313064080 &{} 126.0886215088400 \end{pmatrix}. \end{aligned}$$

First of all, we show the contour plots of \(|\psi (\mathbf{x}, t)|^2\) at time \(t=300\) in Fig. 6 obtained by these three methods. Second, the time history of energy error (defined by (24)) given by these three methods is presented in Fig. 7. As (27) is a quadratic equation, by Theorem 1, the ESQM method gives the exact solution (if neglecting space error). From Fig. 7, we can see that its energy error is at machine precision level, which is much smaller than the energy errors of Strang and ESR. Specifically, as the rotation velocity of Strang is not correct (see [13]), we can see in Fig. 6 that the contour plot obtained by Strang is not good. For ESR, even if the rotation velocity is right and the shape of the solution has the correct orientation, error is clearly observed.

Fig. 6
figure 6

Contour plots of density \(|\psi ({\mathbf{x }})|^2\) a at \(t = 0\); computed by b ESQM; c ESR and d Strang method at \(t = 300\) with \(\Delta t = 0.3\), \(N_1=N_2=256\), \(\epsilon = \frac{1}{32}\) for 2D magnetic Schrödinger problem

Fig. 7
figure 7

Time evolution of energy error of ESR, ESQM and Strang splitting method with \(\Delta t = 0.3\), \(N_1=N_2=256\) and \(\epsilon = \frac{1}{32}\) for 2D magnetic Schrödinger equation

2D rotating Gross–Pitaevskii equation

We now consider the dynamics of rotating Bose–Einstein condensates, which is described by the following rotating Gross–Pitaevskii equation (GPE) (see [9, 11])

$$\begin{aligned} \begin{aligned}&{i}\partial _t \psi (\mathbf{x}, t) = -\frac{1}{2}\Delta \psi (\mathbf{x},t) + V(\mathbf{x}) \psi (\mathbf{x},t) + \beta | \psi |^2 \psi (\mathbf{x},t) - \Omega L_{x_3} \psi (\mathbf{x},t), \;\;\; \psi (\mathbf{x},0) = \psi _0(\mathbf{x})\\ \end{aligned}\nonumber \\ \end{aligned}$$
(28)

where \(\psi (\mathbf{x}, t)\) (\(\mathbf{x} = (x_1, x_2)\in {\mathbb {R}}^2, t\ge 0\)) is wave function , \(L_{x_3} = - i (x_1\partial _{x_2} - x_2 \partial _{x_1})\) is the \(x_3\)-component of the angular momentum, \(\Omega \) is the angular speed of the laser beam, \(\beta \) is a constant characterizing the particle interactions, and \(V(\mathbf{x})\) denotes the external harmonic oscillator potential

$$\begin{aligned} V(\mathbf{x}) = \frac{1}{2}(\gamma _{x_1}^2 x_1^2 + \gamma _{x_2}^2 x_2^2), \quad \gamma _{x_1}> 0, \ \gamma _{x_2} > 0. \end{aligned}$$
(29)

In addition to the mass and energy conservations (24), the expectation of angular momentum is also conserved when \(\gamma _{x_1} = \gamma _{x_2}\)

$$\begin{aligned} Lz(t) := \int _{{\mathbb {R}}^2} \psi ^*(\mathbf{x}, t) L_{x_3}\psi (\mathbf{x}, t) d\mathbf{x} = Lz(0). \end{aligned}$$
(30)

We are also interested in the time evolution of condensate widths and mass center defined as follows,

$$\begin{aligned} \begin{aligned}&\text {condensate widths}: \, S_{\alpha }(t) = \sqrt{\int _{{\mathbb {R}}^2} \alpha ^2 |\psi (\mathbf{x}, t)|^2 d\mathbf{x}}, \quad \alpha = x_1, x_2,\\&\text {mass center}: \mathbf{x}_{c} (t)= \int _{{\mathbb {R}}^2} \mathbf{x} |\psi (\mathbf{x}, t)|^2d\mathbf{x}. \end{aligned} \end{aligned}$$
(31)

For the two dimensional rotating GPE (28), our first numerical test is the so-called dynamics of a stationary state with a shifted center [9]. We take \( \gamma _{x_1} = \gamma _{x_2} = 1, \beta = 100\) in (28) and the initial condition is taken as

$$\begin{aligned} \psi _0(\mathbf{x}) = \phi _e(\mathbf{x} - \mathbf{x}_0), \end{aligned}$$

where \(\phi _e(\mathbf{x}) \) is a ground state computed numerically by using the method proposed in [35] and . The numerical parameters are chosen as follows: \(\Delta t = 0.001\) and the spatial domain \([-8,8]^2\) is discretized using \(N_1=N_2=256\) points.

There are many accurate and efficient numerical methods in the literature for the rotating Gross–Pitaevskii equation, such as [6,7,8,9,10,11, 14, 15]. Similar to the magnetic Schrödinger case, we will consider different methods to solve (28) and compare with our approach

  • ESQM (see (25) with \(f(\mathbf{x}, |\psi |^2) = \beta |\psi |^2\) and (21)); this method is second order accurate in time.

  • Lagrangian from [10] (see “Appendix 2”); this method is second order accurate in time.

  • BW from [11] (see “Appendix 1”); this method is second order accurate in time.

Concerning ESQM, we show how the quadratic part \(p^w:=(i/2) \Delta - \Omega L_{x_3} - iV(\mathbf{x })\) of the nonlinear equation (28) is split. This is done as follows (two cases \(\Omega = -0.5\) and \(\Omega = 0\) are considered)

$$\begin{aligned} e^{i\Delta t p^w} = e^{- \Delta t v^{(\ell )}({\mathbf{x }})} e^{- \Delta t(U_{\Delta t}{\mathbf{x }})_1\partial _{x_1}} e^{i \Delta ta(\nabla )} e^{- \Delta t(L_{\Delta t}{\mathbf{x }})_2\partial _{x_2}} e^{- \Delta tv^{(r)}({\mathbf{x }})}, \end{aligned}$$

where , and \(a(\nabla ) = \nabla \cdot (A_{\Delta t} \nabla )\), \(V_{\Delta t}^{(\ell )}, L_{\Delta t}, U_{\Delta t}, V_{\Delta t}^{(r)}, A_{\Delta t}\) being \(2\times 2\) matrices. In the case \(\Omega = -0.5\), we have

$$\begin{aligned}&A_{\Delta t} \simeq \begin{pmatrix} 0.499999979166548 &{} 0.000249999947774 \\ 0.000249999947774 &{} 0.499999979166793 \end{pmatrix},\\&L_{\Delta t} \simeq \begin{pmatrix} 0 &{} 0 \\ 0.500000041666437 &{} 0 \end{pmatrix},\quad U_{\Delta t} \simeq \begin{pmatrix} 0 &{} -0.499999916666871 \\ 0 &{} 0 \end{pmatrix},\\&V^{(\ell )}_{\Delta t} \simeq \begin{pmatrix} 0.312500037655718 &{}0 \\ 0&{} 0.187500011768640 \end{pmatrix},\\&V^{(r)}_{\Delta t} \simeq \begin{pmatrix} 0.187500043073584 &{} 0.000062500002635 \\ 0.000062500002635 &{} 0.312500006460442 \end{pmatrix}, \end{aligned}$$

and in the case \(\Omega = 0\), we have

$$\begin{aligned}&A_{\Delta t} \simeq \begin{pmatrix} 0.499999916666670 &{} 0 \\ 0 &{} 0.499999916666676 \end{pmatrix},\\&L_{\Delta t} = \begin{pmatrix} 0 &{} 0 \\ 0 &{} 0 \end{pmatrix},\quad U_{\Delta t} = \begin{pmatrix} 0 &{} 0 \\ 0 &{} 0 \end{pmatrix},\\&V^{(\ell )}_{\Delta t} \simeq \begin{pmatrix} 0.250000020830159 &{} 0 \\ 0 &{} 0.250000020843983 \end{pmatrix},\\&V^{(r)}_{\Delta t} \simeq \begin{pmatrix} 0.250000020836518 &{}0 \\ 0 &{} 0.250000020822696 \end{pmatrix}. \end{aligned}$$

We first validate our ESQM approach by plotting the time evolutions of mass center, condensate widths (31), and angular momentum expectation error (30) in Fig. 8. We can see that time evolution of mass center is periodic, and the period is equal to \(2\pi \) (resp. \(4\pi \)) when \(\Omega = 0\) (resp. \(\Omega = -0.5\)), which is in good agreement to the results in [9].

Fig. 8
figure 8

Time evolution of mass center, coordinates of mass center, error on angular momentum expectation, and condensate widths by ESQM when \(\Omega = 0\) (top four figures) and \(\Omega = -0.5\) (bottom four figures)

Fig. 9
figure 9

Energy error and angular momentum expectation error (semi-\(\log _{10}\) scale) as a function of the step size for the three methods ESQM, Lagrangian and BW at \(t=1\) for \(\Omega = -0.5\), when \(\beta = 5\), (a,c), \(\beta = 100\), (b,d)

Fig. 10
figure 10

\(\beta = 1000, \Omega = 0.9\). Time evolution of the solution of (28) by changing the potential initially

Fig. 11
figure 11

\(\beta = 1000, \Omega = 0.9\). Time evolution of the energy of (28) by changing the potential initially

In the sequel, we compare ESQM with Lagrangian and BW. Both ESQM and Lagrangian method need 4 FFT for each time step whereas BW needs 6. As the FFT calls are the most consuming part of the three methods, ESQM and Lagrangian are the most efficient methods. The energy error (24) and angular momentum expectation error (30) with different time step sizes of the three methods (Lagrangian, ESQM and BW) are presented in Fig. 9 for \(\Omega = -0.5\) and with different values of the nonlinearity factor (\(\beta =5\) and \(\beta =100\)). First, we notice that these three methods are second order accurate regarding the energy as expected. However, the error of ESQM is much smaller (two orders of magnitude smaller), which is due to the fact that the linear part is solved exactly. Moreover, the advantage of ESQM is more obvious when the nonlinearity factor \(\beta \) is smaller. For the angular moment expectation conservation, we can see that BW is still second order in time, whereas the error of Lagrangian and ESQM is close to the machine precision. The reason is that angular moment expectation is conserved by the solution of each subsystem in ESQM and Lagrangian (see [9] for more details).

To end this part, we focus on the second numerical experiment, in which the time evolution of a ground state is studied by changing the corresponding potential initially as [3, 15]. The parameters are \(\beta = 1000\), \(\Omega = 0.9\), the potential is given by (29) with \(\gamma _{x_1} = 1.05, \gamma _{x_2} = 0.95\). The initial condition is the ground state corresponding to the isotropic potential \(V({\mathbf{x }}) = |{\mathbf{x }}|^2/2\), \(\beta = 1000\), and \(\Omega = 0.9\), generated using the Matlab toolbox GPELabFootnote 1. [4, 5]. In this numerical test, we only use ESQM and consider the numerical parameters as follows: the spatial grid is defined by \([-8,8]^2\), \(N_1=N_2=128\), and the time step size is \(\Delta t=10^{-3}\). The coefficients for ESQM in (21) are given by

$$\begin{aligned}&A_{\Delta t} \simeq \begin{pmatrix} 0.500000110624718 &{}-0.000449999864087 \\ -0.000449999864087 &{} 0.500000127291716 \end{pmatrix}, \\&L_{\Delta t}\simeq \begin{pmatrix} 0 &{} 0 \\ -0.900000273000100 &{} 0 \end{pmatrix}, \quad U_{\Delta t}\simeq \begin{pmatrix} 0 &{} 0.899999484000032 \\ 0 &{} 0 \end{pmatrix}, \\&V^{(\ell )}_{\Delta t}\simeq \begin{pmatrix} 0.478125137872035 &{} 0 \\ 0 &{} 0.023124993175043 \end{pmatrix}, \\&V^{(r)}_{\Delta t}\simeq \begin{pmatrix} 0.073125336336629 &{} -0.000364499913716\\ -0.000364499913716 &{} 0.428124781225271 \end{pmatrix}. \end{aligned}$$

The contour plots of \(|\psi (\mathbf{x}, t)|^2\) are plotted for different times (\(t=0, 1.5, 3, 4\)) in Fig. 10. These results are in very good agreement with those obtained in the literature [3, 15]. We also present in Fig. 11 the time evolution of the energy error, from which we can see that energy conservation is very good (about \(10^{-7}\)).

5.4.2 3D Schrödinger Equations

In this section, 3D Schrödinger equations are considered in two cases: (i) a quadratic Schrödinger equation is constructed specifically such that the solution is periodic in time; (ii) a magnetic Schrödinger equation with a non-quadratic potential (see [17]).

3D time-periodic quadratic linear Schrödinger equation

For (23), we consider \(f=0\) and

(32)

where \(\mathbf{x}=(x_1, x_2, x_3)\) and \((\lambda _1, \lambda _2, \lambda _3)\) are the roots of the polynomial \(Q(X)= 7200 X^3 - 72196 X^2 + 222088 X - 216341\), i.e.

$$\begin{aligned} \begin{pmatrix} \lambda _1 \\ \lambda _2 \\ \lambda _3 \end{pmatrix} \simeq \begin{pmatrix} 2.27017996551810\\ 2.53418020791380 \\ 5.22286204879033\end{pmatrix}. \end{aligned}$$
(33)

In this case, the period of this system is \(T=360\) (see in “Appendix 6” for the proof) and the initial condition is

$$\begin{aligned} \psi _0(x_1,x_2,x_3) = \left( \frac{2}{\pi } \right) ^3 e^{-x_1^2} e^{-2x_2^2}e^{-2(x_3-1)^2} + i \left( \frac{2}{\pi } \right) ^3 e^{-x_1^2} e^{-2(x_2+1)^2}e^{-2(x_3-1)^2}. \end{aligned}$$
(34)

The numerical parameters are chosen as: spatial domain \([-8,8]^3\) is discretized by \(N_1=N_2=N_3=96\) points, time step is \(\Delta t = 0.2\), and final time is \(t = 720\) which corresponds to two periods 2T. We consider following two numerical methods:

  • ESQM from (21) whose coefficients are listed in “Appendix 1”; the method is exact in time.

  • Strang (see in “Appendix 2”); the method is second order accurate in time.

In Figs. 12 and 13, the time evolutions of \(|\psi (t, 0,0,0)|^2\) are presented by using ESQM and Strang respectively. We also plot the difference \(|\psi (t\in [T, 2T], 0,0,0)|^2-|\psi (t\in [0, T], 0,0,0)|^2\) which should be zero since the solution is time periodic of period \(T=360\). We can see that for ESQM, the period is nicely preserved (up to \(10^{-11}\)) in spite of the fact that the time history of the solution is quite complicated. However, one can observe in Fig. 13 that the error of Strang method is too large to identify the period. In Fig. 14, the time history of energy error is plotted for both ESQM and Strang methods. Clearly, Strang method produces larger error. Some contour plots of the solution (at time \(t=360\) and the third spatial direction \(x_3\) is fixed to be 0) obtained by ESQM and Strang are presented at Fig. 15. Note that \(\psi (t=360, x_1, x_2, 0)\) is the same as the initial condition since the solution is 360 periodic in time. In Fig. 15, we can see that ESQM gives very accurate results, but the result obtained by Strang method is rather different. Concerning the computational cost, 6 FFT (or inverse) are required for each time step for ESQM whereas Strang needs 15 FFT (or inverse).

Fig. 12
figure 12

ESQM: a Time evolution of \(|\psi (t, 0,0,0)|^2\). b The difference \(|\psi ([T, 2T], 0,0,0)|^2-|\psi ([0, T], 0,0,0)|^2\), \(T=360\)

Fig. 13
figure 13

Strang: a Time evolution of \(|\psi (t, 0,0,0)|^2\). b The difference \(|\psi ([T, 2T], 0,0,0)|^2-|\psi ([0, T], 0,0,0)|^2\), \(T=360\)

Fig. 14
figure 14

a Time evolution of the energy error by ESQM. b Time evolution of the energy error by Strang splitting

Fig. 15
figure 15

a Initial contour plot of the real part of \(\psi (t=0, x_1,x_2,0)\); b contour plot of real part of \(\psi (t=360,x_1,x_2,0)\) by ESQM; c contour plot of real part of \(\psi (t=360, x_1,x_2,0)\) by Strang

3D magnetic Schrödinger equation

To end this part, the following 3D magnetic Schrödinger equation is considered (see [17]),

$$\begin{aligned} i \partial _t \psi (\mathbf{x},t) = -\frac{1}{2}\Delta \psi (\mathbf{x},t) + i \mathbf{A}(\mathbf{x}) \cdot \nabla \psi (\mathbf{x},t) + \frac{1}{2}|\mathbf{A}(\mathbf{x})|^2\psi (\mathbf{x},t) + V_{nq}(\mathbf{x})\psi (\mathbf{x},t),\nonumber \\ \end{aligned}$$
(35)

where \(\mathbf{A}(\mathbf{x}) = \mathbf{x} \times \mathbf{B}\), , \(\mathbf{x}=(x_1,x_2,x_3)\) and

$$\begin{aligned} V_{nq}(\mathbf{x}) =\alpha \left( 20\cos (\frac{2\pi (x_1+5)}{10}) + 20\cos (\frac{2\pi (x_2+5)}{10}) + 20\cos (\frac{2\pi (x_3+5)}{10}) + 60\right) , \alpha \in {\mathbb {R}}. \end{aligned}$$
(36)

The initial condition is

$$\begin{aligned} \psi _0(\mathbf{x}) = \frac{2^{3/8}}{\pi ^{3/2}} \exp \left( -\frac{\sqrt{2}}{2}((x_1-1)^2 + x_2^2 +x_3^2)\right) , \end{aligned}$$

and the numerical parameters are: the spatial domain \([-5,5]^3\), \(N_1=N_2=N_3=64\), and the final time \(t = 1\). Here we consider three methods

  • ESQM (see (25) with \(f(\mathbf{x}, |\psi |^2) = V_{nq}(\mathbf{x})\) given by (36) and with (21)); this method is second order accurate in time.

  • ESR (see “Appendix 5”); this method is second order accurate in time.

  • Strang (see “Appendix 5”); this method is second order accurate in time.

The three methods are compared with different step sizes \(\Delta t\) to solve the system (35). The time evolutions of energy error of these three methods are presented in Fig. 16, with different parameter \(\alpha \) which measures the amplitude of the non-quadratic part in (35). By comparing the energy error, we can see that the ESQM is the most accurate one, as it solves the linear quadratic part exactly. Moreover, when \(\alpha \) is smaller, i.e., the non-quadratic term in system (35) becomes smaller, the advantage of ESQM is more obvious.

Fig. 16
figure 16

Plots of energy error with step size at \(t=1\) with grids \(N_1=N_2=N_3=64\). (a) \(\alpha = 0.1\), (b) \(\alpha = 0.01\)