betaFeedback

WorksPhysics and Astronomy

NonlinearSchrodinger: Higher-Order Algorithms and Darboux Transformations for Nonlinear Schrödinger Equations

Abstract

NonlinearSchrodinger.jl is a Julia package with a simple interface for studying solutions of nonlinear Schrödinger equations (NLSEs). In approximately ten lines of code, one can perform a simulation of the cubic NLSE using one of 32 algorithms, including symplectic and Runge-Kutta-Nyström integrators up to eighth order. Furthermore, it is possible to compute analytical solutions via a numerical implementation of the Darboux transformation for extended NLSEs up to fifth order, with an equally simple interface. In what follows, we review the fundamentals of solving this class of equations numerically and analytically, discuss the implementation, and provide several examples.

Introduction

Nonlinear Schrödinger equations (NLSEs) are of utmost importance in many fields of physics, including light propagation in nonlinear media [1, 2, 3], Bose-Einstein condensates [4], Heisenberg spin chains [5, 6], ocean surface waves [7, 8], and many others. There is a rich body of theoretical studies, guided by computational tools, exploring these equations [9, 10, 11, 12, 13, 14, 15, 16].

One central issue with studies in this field is the closed-source nature of the codes used in most works, if not all. While one can find a few packages for solving the cubic nonlinear Schrödinger equation on, e.g., GitHub and MATLAB Central, these packages generally have a complicated interface and only implement first or second-order integrators. These integrators are insufficiently accurate for all but the simplest simulations and should not be used in research applications. Moreover, to the best of our knowledge, there are no open-source packages that implement the Darboux transformation for the cubic NLSE, let alone extended NLSEs, as this work does.

We believe that a modern open-source package, such as the one presented in this work, is necessary for this community. The simple interface streamlines simulations and Darboux transformation calculations, alleviating the need to “reinvent the wheel” by every research group. We also expect that it will lower the barrier to entry for new researchers and aid in reproducing results. While we do not introduce any new algorithms or methods in this package, it is designed to perform any simulation or calculation in approximately ten lines of code, no matter how complicated the solution. The uniqueness of NonlinearSchrodinger.jl, coupled with its simple interface and algorithms specialized for the problem at hand, make this work original.

This work is divided as follows: in § 2, we introduce the cubic NLSE and its most notable analytical solutions: the soliton and the breather. We additionally examine its first three integrals of motion. Following this introduction, we provide a brief discussion of solving the NLSE numerically in § 3. We review splitting methods and higher-order integrators. Furthermore, we examine the numerical implementation, benchmark the algorithms, and provide three examples of using the package for simulations.

In § 4, we introduce the extended NLSE that our package is equipped to solve via the Darboux transformation. We present the Lax system of the cubic NLSE, the Darboux transformation scheme, and the seed solutions. Furthermore, we provide six examples of using the package for Darboux transformation calculations. Finally, we offer future directions and concluding remarks in § 5.

The Nonlinear Schrödinger Equation

The cubic (1+1)(1+1) Nonlinear Schrödinger equation (NLSE) with anomalous dispersion is given in dimensionless form as

i∂ψ∂x+12∂2ψ∂t2+∣ψ∣2ψ=0,(1)i\frac{\partial\psi}{\partial x}+\frac{1}{2}\frac{\partial^2\psi}{\partial t^2}+\lvert\psi\rvert^2\psi=0, \tag*{(1)}

where ψ(x,t)\psi(x,t) is a complex field. The constants in front of each term can be changed by appropriate scaling of ψ\psi, xx, and tt.

The physical meaning of xx, tt, and ψ\psi depend on the problem being studied. For example, in optical fibers, the longitudinal (evolution) variable xx represents the distance along the fiber, tt is the retarded time (i.e., in the frame moving at the group velocity of the pulse), while ψ\psi is proportional to the slowly varying envelope of the pulse. We chose this convention for the package since it is the norm in many works in this field.

Notable Analytical Solutions

The NLSE and its extensions can be solved by multiple methods, including the inverse scattering transform [17], the Hirota bilinear method [18], and the Darboux Transformation [9, 12, 13, 16, 19, 20], discussed later in this work. The NLSE has multiple notable solutions, but we highlight only two of them: the soliton and the breather.

Solitons

Solitons are self-focusing wave-packets that maintain their shape due to a balance between nonlinearity and dispersion during propagation. The first-order (fundamental) soliton solution of the NLSE is given by

ψ(x,t)=2νe2iν2xcosh⁡(2νt),(2)\psi(x,t)=\frac{2\nu e^{2i\nu^2x}}{\cosh(2\nu t)}, \tag*{(2)}

where ν\nu is a parameter that gives the peak-height of the solution. The numerical evolution of this solution will be discussed in § 3.5.2 (Example 2).

Breathers

Breathers are periodic solutions along either the tt-direction, known as Akhmediev Breathers (ABs) [21], or the xx-direction, known as Kuznetsov-Ma Breathers (KMBs) or Kuznetsov-Ma Solitons [22, 23]. This solution can be written as

ψ(x,t)=[(1−4a)cosh⁡(δx)+2acos⁡(Ωt)+iδsin⁡(δx)2acos⁡(Ωt)−cosh⁡(δx)]eix,(3)\psi(x,t)=\left[\frac{(1-4a)\cosh(\delta x)+\sqrt{2a}\cos(\Omega t)+i\delta\sin(\delta x)}{\sqrt{2a}\cos(\Omega t)-\cosh(\delta x)}\right]e^{ix}, \tag*{(3)}

where a>0a>0 is a parameter, Ω=21−2a\Omega=2\sqrt{1-2a} is the transverse period for a<0.5a<0.5 and δ=2aΩ\delta=\sqrt{2a}\Omega. The values of 0<a<0.50<a<0.5 give Akhmediev breathers, while a>0.5a>0.5 results in Kuznetsov-Ma breathers. a→0.5a\to0.5 gives the spatiotemporally localized Peregrine soliton [24]. The period of the AB is given by T=2π/Ω=π/1−2aT=2\pi/\Omega=\pi/\sqrt{1-2a}.

This solution will be discussed in more detail in § 3.5.1, where it is numerically generated from a cosine wave initial condition (Example 1). Higher-order breathers are discussed in § 4.6.2 (Example 5).

Integrals of Motion

Being a completely integrable system with infinitely many degrees of freedom, the NLSE has an infinite number of conserved quantities [25, 26]. Here we only list the few lowest-order integrals of motion and refer readers to Miura’s original work on the Korteweg-De Vries equation [27] and Ref. [25, 28] for an iterative scheme to generate these first integrals.

N=∫−∞∞∣ψ∣2 dt,P=i∫−∞∞(ψtψ∗−ψt∗ψ) dt,H=12∫−∞∞(∣ψt∣2−∣ψ∣4) dt=K+V.(4)\begin{aligned} N &= \int_{-\infty}^{\infty} |\psi|^2\,\mathrm{d}t,\\ P &= i\int_{-\infty}^{\infty}(\psi_t\psi^*-\psi_t^*\psi)\,\mathrm{d}t,\\ H &= \frac{1}{2}\int_{-\infty}^{\infty}(|\psi_t|^2-|\psi|^4)\,\mathrm{d}t=K+V. \tag*{(4)} \end{aligned}

They are the norm, the center of mass momentum, and the Hamiltonian (total energy, which can be split into kinetic and potential terms). We use KK to denote the kinetic energy to avoid confusion with the period TT. For periodic solutions such as Akhmediev breathers, these quantities can be written as

N=1T∫0T∣ψ∣2 dt,P=iT∫0T(ψtψ∗−ψt∗ψ) dt,H=12T∫0T(∣ψt∣2−∣ψ∣4) dt=K+V.(5)\begin{aligned} N &= \frac{1}{T}\int_0^T|\psi|^2\,\mathrm{d}t,\\ P &= \frac{i}{T}\int_0^T(\psi_t\psi^*-\psi_t^*\psi)\,\mathrm{d}t,\\ H &= \frac{1}{2T}\int_0^T(|\psi_t|^2-|\psi|^4)\,\mathrm{d}t=K+V. \tag*{(5)} \end{aligned}

These integrals of motion are important because they allow us to check the accuracy of our simulations. We will discuss them in more detail in § 3.2.2, 3.3 and 3.5.1 (Example 1).

Solving the NLSE Numerically

Splitting Methods

Equation (1) can be written as

−i∂ψ∂x=(D^+N^)ψ.(6)-i\frac{\partial\psi}{\partial x}=(\hat{D}+\hat{N})\psi. \tag*{(6)}

Here, D^=12∂2∂t2\hat{D}=\frac{1}{2}\frac{\partial^2}{\partial t^2} is the dispersion operator and N^=∣ψ∣2\hat{N}=|\psi|^2 is the nonlinear operator. To evolve ψ\psi one step Δx\Delta x forward in xx, we write this formally as

ψ(x+Δx,t)=eϵ(D^+N^)ψ(x,t)≡T(ϵ)ψ(x,t),(7)\psi(x+\Delta x,t)=e^{\epsilon(\hat{D}+\hat{N})}\psi(x,t)\equiv\mathcal{T}(\epsilon)\psi(x,t), \tag*{(7)}

where ϵ=iΔx\epsilon=i\Delta x. The operator T(ϵ)\mathcal{T}(\epsilon) is the evolution operator by an xx-step ϵ\epsilon. The Baker-Campbell-Hausdorff (BCH) formula tells us that

eXeY=exp⁡(X+Y+12[X,Y]+112[X,[X,Y]]+112[Y,[Y,X]]+⋯ ).(8)e^Xe^Y=\exp\left(X+Y+\frac{1}{2}[X,Y]+\frac{1}{12}[X,[X,Y]]+\frac{1}{12}[Y,[Y,X]]+\cdots\right). \tag*{(8)}

Thus, since [D^,N^]≠0[\hat{D},\hat{N}]\ne0

ψ(x+Δx,t)≠eϵD^eϵN^ψ(x,t).(9)\psi(x+\Delta x,t)\ne e^{\epsilon\hat{D}}e^{\epsilon\hat{N}}\psi(x,t). \tag*{(9)}

However, one can approximate any such operator eϵ(D^+N^)e^{\epsilon(\hat{D}+\hat{N})} to whichever order in ϵ\epsilon one wishes as follows

eϵ(D^+N^)≈∏i=1neciϵD^ediϵN^,(10)e^{\epsilon(\hat{D}+\hat{N})}\approx\prod_{i=1}^{n}e^{c_i\epsilon\hat{D}}e^{d_i\epsilon\hat{N}}, \tag*{(10)}

where ci,di∈Rc_i,d_i\in\mathbb{R}, and for some positive integer nn. These integrators are symplectic, i.e. they are canonical transformations that preserve the symplectic structure of Hamilton’s equations. For a review, see Ref. [29, 30]. One can form two such first order operators by taking n=1n=1 and c1=d1=1c_1=d_1=1

T1A(ϵ)≡eϵN^eϵD^,T1B(ϵ)≡eϵD^eϵN^.(11)\begin{aligned} \mathcal{T}_{1A}(\epsilon)&\equiv e^{\epsilon\hat{N}}e^{\epsilon\hat{D}},\\ \mathcal{T}_{1B}(\epsilon)&\equiv e^{\epsilon\hat{D}}e^{\epsilon\hat{N}}. \tag*{(11)} \end{aligned}

However, note that these integrators are not “time”-reversible (or more accurately with our notation, xx-reversible). For “time”-reversible second-order integrators, we can combine T1A\mathcal{T}_{1A} and T1B\mathcal{T}_{1B}

T2A(ϵ)≡T1A(ϵ/2)T1B(ϵ/2)=eϵ2N^eϵD^eϵ2N^,T2B(ϵ)≡T1B(ϵ/2)T1A(ϵ/2)=eϵ2D^eϵN^eϵ2D^.(12)\begin{aligned} \mathcal{T}_{2A}(\epsilon)&\equiv\mathcal{T}_{1A}(\epsilon/2)\mathcal{T}_{1B}(\epsilon/2)=e^{\frac{\epsilon}{2}\hat{N}}e^{\epsilon\hat{D}}e^{\frac{\epsilon}{2}\hat{N}},\\ \mathcal{T}_{2B}(\epsilon)&\equiv\mathcal{T}_{1B}(\epsilon/2)\mathcal{T}_{1A}(\epsilon/2)=e^{\frac{\epsilon}{2}\hat{D}}e^{\epsilon\hat{N}}e^{\frac{\epsilon}{2}\hat{D}}. \tag*{(12)} \end{aligned}

Further, one can show that higher even-order integrators can be formed by combining ones of the preceding order

TM,A(ϵ)≡TM−2,A(γ1ϵ)TM−2,A(γ2ϵ)TM−2,A(γ3ϵ),(13)\mathcal{T}_{M,A}(\epsilon)\equiv\mathcal{T}_{M-2,A}(\gamma_1\epsilon)\mathcal{T}_{M-2,A}(\gamma_2\epsilon)\mathcal{T}_{M-2,A}(\gamma_3\epsilon), \tag*{(13)}

and similarly for the BB variant. Here, M=4,6,8,…M = 4, 6, 8, \ldots, and γ{1,2,3}\gamma_{\{1,2,3\}} are some real numbers, for which there are several possible options. One possibility is enforcing “time”-reversibility (γ1=γ3\gamma_1 = \gamma_3), and we get [31, 32]

γ1=γ3=12−21/(M−1),γ2=−21/(M−1)2−21/(M−1).(14)\gamma_1 = \gamma_3 = \frac{1}{2 - 2^{1/(M-1)}}, \qquad\gamma_2 = -\frac{2^{1/(M-1)}}{2 - 2^{1/(M-1)}}. \tag*{(14)}

These are sometimes called the Triple Jump integrators since they involve three applications of the preceding order integrator to get to the desired xx-step. Another possibility is reducing the size of the steps even further, but this requires a composition of the form

TM,A(ϵ)≡TM−2,A(γ1ϵ)TM−2,A(γ2ϵ)TM−2,A(γ3ϵ)TM−2,A(γ4ϵ)TM−2,A(γ5ϵ).(15)T_{M,A}(\epsilon) \equiv T_{M-2,A}(\gamma_1\epsilon)T_{M-2,A}(\gamma_2\epsilon)T_{M-2,A}(\gamma_3\epsilon)T_{M-2,A}(\gamma_4\epsilon)T_{M-2,A}(\gamma_5\epsilon). \tag*{(15)}

One possible “time”-reversible solution is

γ1=γ2=γ4=γ5=14−41/(M−1),γ3=−41/(M−1)4−41/(M−1).(16)\gamma_1 = \gamma_2 = \gamma_4 = \gamma_5 = \frac{1}{4 - 4^{1/(M-1)}}, \qquad\gamma_3 = -\frac{4^{1/(M-1)}}{4 - 4^{1/(M-1)}}. \tag*{(16)}

This family is known as Suzuki’s Fractal integrators [33]. However, one does not have to form compositions of the form (13) or (15), but most generally, they can be written as

TM,A(ϵ)=∏iNT2,A(γiϵ).(17)T_{M,A}(\epsilon) = \prod_{i}^{N} T_{2,A}(\gamma_i\epsilon). \tag*{(17)}

Using a numerical approach, many authors managed to solve for the necessary γi\gamma_i and find such “optimal” algorithms to very high-order (i.e., they require far fewer compositions of T2T_2 than the previous two schemes). For example, one such eighth order algorithm requires only 15 [34, 35, 36] applications of T2T_2, in contrast to 27 applications of T2T_2 in the Triple Jump scheme and 125 in Suzuki’s Fractal scheme. These optimal algorithms are discussed in [31, 34, 35, 36, 37].

Another approach by Chin [38] is through a multi-product decomposition, yielding non-symplectic Runge-Kutta-Nyström (RKN) integrators that require far fewer applications of T2T_2.

We have barely scratched the surface of this topic; we direct interested readers to the original papers cited above, the text by Hairer et al. [39] and Chin’s pedagogical review [30].

Numerical Implementation

This section examines the numerical implementation of the topics discussed above in NonlinearSchrodinger.

Implementing the Integrators

We will take the algorithm T1AT_{1A} as an example in this section. To calculate the first part of this integrator, we need to compute

ψI≡eϵN^ψ(x,t)=eiΔx∣ψ(x,t)∣2ψ(x,t),(18)\psi_I \equiv e^{\epsilon\hat{N}}\psi(x,t) = e^{i\Delta x|\psi(x,t)|^2}\psi(x,t), \tag*{(18)}

where ψI\psi_I denotes an intermediate step. This is straightforward to compute in real space. For the second half of this integrator, we need to act on ψI\psi_I with the exponential of the dispersion operator D^\hat{D}

ψ(x+Δx,t)=eϵD^ψI=eiΔx12∂t2ψI.(19)\psi(x+\Delta x,t) = e^{\epsilon\hat{D}}\psi_I = e^{i\Delta x\frac{1}{2}\partial_t^2}\psi_I. \tag*{(19)}

This operation is much easier to perform in momentum space

ψ(x+Δx,t)=F−1{e−iΔx2ω2F{ψI}},(20)\psi(x+\Delta x,t)=\mathcal{F}^{-1}\left\{e^{-i\frac{\Delta x}{2}\omega^2}\mathcal{F}\{\psi_I\}\right\}, \tag*{(20)}

where F\mathcal{F} and F−1\mathcal{F}^{-1} denote the Fourier and inverse Fourier transforms, respectively. Thus, in total, we get

ψ(x+Δx,t)=F−1{e−iΔx2ω2F{eiΔx∣ψ(x,t)∣2ψ(x,t)}}.(21)\psi(x+\Delta x,t)=\mathcal{F}^{-1}\left\{e^{-i\frac{\Delta x}{2}\omega^2}\mathcal{F}\left\{e^{i\Delta x|\psi(x,t)|^2}\psi(x,t)\right\}\right\}. \tag*{(21)}

Higher-order algorithms can be implemented similarly. The Fourier transforms are performed using the FFT algorithm as implemented in the FFTW library [40]. For the exact computational implementation, see the file CubicSolvers.jl in the package. Table 1 provides a listing of the algorithms implemented in this package. A visualization of the time-stepping of a selection of these algorithms is shown in Figure 1.

Figure 1. Visualization of the xx-stepping of some of the algorithms listed in Table 1. Since the AA and BB variants have identical stepping, that label is omitted.

Computing the Integrals of Motion and Errors

NonlinearSchrodinger.jl allows the computation of the first 3 integrals of motion of the NLSE, shown in Eq. (5). The norm and potential energy are straightforward to calculate numerically in real space. However, we perform tt derivatives in ω\omega-space when computing the momentum and kinetic energy integrals

K=12T∫0T∣ψt∣2 dt=1T∫0Tψ∗(x,t)(−12∂x2)ψ(x,t) dt=−12T∑ω∑ω′∫0Tψ~ω∗(x)e+iωt(−iω′2)e−iω′tψ~ω′(x) dt=12∑ωω2∣ψ~ω(x)∣2,\begin{aligned} K &= \frac{1}{2T}\int_0^T |\psi_t|^2\,\mathrm{d}t=\frac{1}{T}\int_0^T\psi^*(x,t)\left(-\frac{1}{2}\partial_x^2\right)\psi(x,t)\,\mathrm{d}t \\ &=-\frac{1}{2T}\sum_\omega\sum_{\omega'}\int_0^T\widetilde{\psi}_\omega^*(x)e^{+i\omega t}(-i\omega'^2)e^{-i\omega' t}\widetilde{\psi}_{\omega'}(x)\,\mathrm{d}t \\ &=\frac{1}{2}\sum_\omega\omega^2|\widetilde{\psi}_\omega(x)|^2, \end{aligned}
P=iT∫0T(ψ∗ψt−ψt∗ψ) dt=−2T∫0TIm⁡{ψ∗ψt}=−2T∫0TIm⁡{∑ω∑ω′ei(ω−ω′)t(−iω′)ψ~ω∗(x)ψ~ω′(x)}=2∑ωIm⁡{iω∣ψ~ω(x)∣2}=2∑ωω∣ψ~ω(x)∣2.\begin{aligned} P &= \frac{i}{T}\int_0^T(\psi^*\psi_t-\psi_t^*\psi)\,\mathrm{d}t=-\frac{2}{T}\int_0^T\operatorname{Im}\{\psi^*\psi_t\} \\ &=-\frac{2}{T}\int_0^T\operatorname{Im}\left\{\sum_\omega\sum_{\omega'}e^{i(\omega-\omega')t}(-i\omega')\widetilde{\psi}_\omega^*(x)\widetilde{\psi}_{\omega'}(x)\right\} \\ &=2\sum_\omega\operatorname{Im}\left\{i\omega|\widetilde{\psi}_\omega(x)|^2\right\}=2\sum_\omega\omega|\widetilde{\psi}_\omega(x)|^2. \end{aligned}

Here, we use ∗^* to denote complex conjugation and ψ~ω(x)\tilde{\psi}_{\omega}(x) is the Fourier component of ψ(x,t)\psi(x,t) with frequency ω\omega. In conclusion, the integrals of motion are computed as follows

N(x)=1T∫0T∣ψ∣2 dt,P(x)=2∑ωω∣ψ~ω(x)∣2,K(x)=12∑ωω2∣ψ~ω(x)∣2,V(x)=−12T∫0T∣ψ∣4 dt,E(x)≡H(x)=K(x)+V(x).(22)\begin{aligned} N(x) &= \frac{1}{T}\int_{0}^{T}|\psi|^{2}\,\mathrm{d}t,\\ P(x) &= 2\sum_{\omega}\omega|\tilde{\psi}_{\omega}(x)|^{2},\\ K(x) &= \frac{1}{2}\sum_{\omega}\omega^{2}|\tilde{\psi}_{\omega}(x)|^{2},\\ V(x) &= -\frac{1}{2T}\int_{0}^{T}|\psi|^{4}\,\mathrm{d}t,\\ E(x) &\equiv H(x)=K(x)+V(x). \tag*{(22)} \end{aligned}

Their errors are simply defined as

δF(x)≡F(x)−F(x=0)(23)\delta F(x)\equiv F(x)-F(x=0) \tag*{(23)}

where F=NF=N, PP, EE. These are computed via the function compute_IoM!, which will be demonstrated in § 3.5.1 (Example 1).

Benchmarking the Algorithms

To benchmark the algorithms presented in § 3.2 (Table 1), we perform multiple simulations with a fixed length and a different value of NN, where NN denotes the number of applications of T2T_{2} (i.e., half the number of Fourier transforms). Since the total length of the simulation is fixed, dxdx decreases as NN increases. We use a cosine wave initial condition (25), which is discussed in more detail in § 3.5.1 (Example 1). For each simulation, we compute the energy error (23) to gauge the performance of the different algorithms.

Table 1: Algorithms available for solving the cubic NLSE in NonlinearSchrodinger.jl. Class AA denotes integrators where we evaluate the nonlinear step first, then the dispersion step, and vice versa for class BB. The parameter ss, if noted, indicates the number of compositions of the integrator T2\mathcal{T}_2. The number of Fourier transforms (# FTs) required by each algorithm is multiplied by 2 to account for the inverse Fourier transform.

FunctionOrderTypeDescription# FTsRef
1T1A!FirstSymplecticSymplectic Euler AA2×12 \times1[39]
2T1B!FirstSymplecticSymplectic Euler BB2×12 \times1[39]
3T2A!SecondSymplecticVelocity Verlet2×12 \times1[41]
4T2B!SecondSymplecticPosition Verlet2×12 \times1[41]
5T4A_TJ!FourthSymplecticTriple Jump AA2×32 \times3[31, 32]
6T4B_TJ!FourthSymplecticTriple Jump BB2×32 \times3[31, 32]
7T4A_SF!FourthSymplecticSuzuki’s Fractal AA2×52 \times5[33]
8T4B_SF!FourthSymplecticSuzuki’s Fractal BB2×52 \times5[33]
9T4A_CMP!FourthRKNChin’s Multi-Product AA2×32 \times3[38]
10T4B_CMP!FourthRKNChin’s Multi-Product BB2×32 \times3[38]
11T6A_TJ!SixthSymplecticTriple Jump AA2×92 \times9[31]
12T6B_TJ!SixthSymplecticTriple Jump BB2×92 \times9[31]
13T6A_SF!SixthSymplecticSuzuki’s Fractal AA2×252 \times25[33]
14T6B_SF!SixthSymplecticSuzuki’s Fractal BB2×252 \times25[33]
15T6A_CMP!SixthRKNChin’s Multi-Product AA2×62 \times6[38]
16T6B_CMP!SixthRKNChin’s Multi-Product BB2×62 \times6[38]
17T8A_TJ!EighthSymplecticTriple Jump AA2×272 \times27[31]
18T8B_TJ!EighthSymplecticTriple Jump BB2×272 \times27[31]
19T8A_SF!EighthSymplecticSuzuki’s Fractal AA2×1252 \times125[33]
20T8B_SF!EighthSymplecticSuzuki’s Fractal BB2×1252 \times125[33]
21T8A_CMP!EighthRKNChin’s Multi-Product AA2×102 \times10[38]
22T8B_CMP!EighthRKNChin’s Multi-Product BB2×102 \times10[38]
23T6A_Ys7!SixthSymplecticYoshida’s s7s7 AA2×72 \times7[31]
24T6B_Ys7!SixthSymplecticYoshida’s s7s7 BB2×72 \times7[31]
25T6A_KLs9!SixthSymplecticKahan & Li’s s9s9 AA2×92 \times9[37]
26T6B_KLs9!SixthSymplecticKahan & Li’s s9s9 BB2×92 \times9[37]
27T6A_Ss14!SixthSymplecticSuzuki’s s14s14 AA2×142 \times14[35]
28T6B_Ss14!SixthSymplecticSuzuki’s s14s14 BB2×142 \times14[35]
29T8A_Ss15!EighthSymplecticSuzuki’s s15s15 AA2×152 \times15[34, 35, 36]
30T8B_Ss15!EighthSymplecticSuzuki’s s15s15 BB2×152 \times15[34, 35, 36]
31T8A_KLs17!EighthSymplecticKahan & Li’s s17s17 AA2×172 \times17[37]
32T8B_KLs17!EighthSymplecticKahan & Li’s s17s17 BB2×172 \times17[37]

Table 1. Algorithms available for solving the cubic NLSE in NonlinearSchrodinger.jl. Class AA denotes integrators where we evaluate the nonlinear step first, then the dispersion step, and vice versa for class BB. The parameter ss, if noted, indicates the number of compositions of the integrator T2\mathcal{T}_2. The number of Fourier transforms (# FTs) required by each algorithm is multiplied by 2 to account for the inverse Fourier transform.

A plot of the energy error (23) versus NN is shown in Figure 2 for a selection of algorithms. As demonstrated in Figure 2a, all benchmarked algorithms of orders two through six display a linear dependence of log⁡10∣δE∣\log_{10}|\delta E| on log⁡10(N)\log_{10}(N), as expected. The higher the order of the integrator, the steeper the slope.

Figure 2. The energy error (23) versus NN for a selection of algorithms. Algorithms of orders two, four, six and eight are shown as stars, diamonds, circles and squares, respectively. Each family has a different color, e.g. the Triple Jump family (TJ) is all shown in red. In (a), we show lower-order integrators, up to sixth order, and in (b), we show higher-order integrators of orders six and eight. For a description of the algorithms, refer to Table 1. This plot specifically shows the AA class of algorithms. Similar, albeit not identical, results can be computed for the BB class.

The second-order symplectic integrator T2A! performs quite poorly, with a comparatively large energy error. Moreover, we can see that the Triple Jump family does not perform well either, with the sixth order integrator (T6A_TJ!) overtaking the fourth-order one (T4A_TJ!) only at large NN (i.e., small dxdx). Chin’s Multi-Product family (CMP) performs the best, with T6A_CMP! having the smallest energy error in Figure 2a. More generally, it is the most accurate sixth-order integrator in the package.

On the other hand, in Figure 2b, we can see that the eighth order Triple Jump algorithm (T8A_TJ!) does not perform particularly well, with a slight nonlinear dependence of log⁡10∣δE∣\log_{10}|\delta E| on log⁡10(N)\log_{10}(N). This nonlinear dependence is an artifact of double-precision coupled with the 27 evaluations of T2T_{2} necessary per step of T8A_TJ!. In contrast, the optimal integrator T8A_Ss15! displays a mostly linear behavior, outperforming the sixth order optimal algorithm T6A_KLs9! quite quickly, at a relatively large dxdx. Still, Chin’s Multi-Product family is the best performer; it demonstrates a significantly smaller energy error than all other integrators.

One can see that the algorithms are bottlenecked by double-precision at around δE∼10−14\delta E \sim10^{-14} and N≥103.75N \ge10^{3.75}. To properly benchmark these eighth-order integrators without artifacts, one must implement quadruple precision, which is part of our road map as per 5.

Overall, we recommend using Chin’s Multi-Product integrators (CMP) when symplecticity is not a concern; they are the quickest and most accurate integrators this package has to offer. When one wishes to use symplectic integrators, we recommend Kahan and Li’s algorithms, T6_KLs9! and T8_KLs17!, as they offer the lowest error and are almost as quick as the nearest symplectic competitors.

The Necessity of Higher-Order Integrators

Suppose we want to solve (1) numerically using the initial condition

ψ(x=0,t)=eiπt/10(1+0.002cos⁡(πt/10)).(24)\psi(x=0,t)=e^{i\pi t/10}(1+0.002\cos(\pi t/10)). \tag*{(24)}

The purpose of this section is to demonstrate that higher-order integrators are crucial and that the second-order algorithm is generally insufficient. In Figure 3a, using a second-order symplectic integrator, we see a localized peak much higher than the background, what seems to be a high-amplitude rogue wave. However, upon using higher-order integrators, this peak immediately vanishes. Furthermore, the peak disappears upon halving the xx-step, using the same second-order integrator (results not shown).

Four heatmap panels showing numerical solutions of the NLSE

Figure 3. Solving (1) numerically using the initial condition (24) with Δx=10−4\Delta x = 10^{-4} and Nt=512N_t = 512. The algorithms are (a) T2A! (b) T4_TJ! (c) T6_KLs9! (d) T8_KLs17!. Refer to Table 1 for more details. The inset in (a) shows the higher-order peak, which has a height of 5.69. The lower-order peaks have a height of 2.98.

Moreover, it can be seen that the calculations performed using fourth and sixth order integrators (Figure 3b and Figure 3c) agree well up to x∼40x \sim40. In contrast, sixth and eighth order integrators (Figure 3c and Figure 3d) are almost identical, except at x=95x=95 where they slightly diverge. Hence, it seems that the calculation is converging using an eighth order integrator at this xx-step. However, more checking must be done using a smaller step (or a higher-order integrator, preferably with quadruple-precision), which is not shown here.

In conclusion, the first step towards convergence is simply checking the solution after reducing the xx-step or using a higher-order integrator, even before examining the error in the integrals of motion. In this way, one can avoid making hasty conclusions about extreme events such as rogue waves or higher-order breathers, which are very unlikely to spuriously appear using an arbitrary initial condition without finely tuned parameters (see Ref. [42]).

Using NonlinearSchrodinger.jl for simulations

This section provides three examples for using the package to perform simulations of the cubic NLSE (1). These examples are for demonstration purposes only and are designed to run quickly on most machines; they are not fully converged calculations. We recommend consulting Appendix § 7 before reading this section for users unfamiliar with Julia.

Example 1: Cosine Wave initial condition

In this section, we use a cosine wave initial condition to “seed” an Akhmediev breather, leading to its recurrence via modulation instability. See Ref. [15] and the references therein for more details. This initial condition is given by

ψ0≡ψ(x=0,t)=A0+2∑m=1nAmcos⁡(mΩt),(25)\psi_0 \equiv\psi(x=0,t)=A_0+2\sum_{m=1}^{n}A_m\cos(m\Omega t), \tag*{(25)}

for some real or complex coefficients AmA_m. As before, Ω=21−2a\Omega= 2\sqrt{1-2a} denotes the frequency of the breather, and its period is T=2π/ΩT = 2\pi/\Omega. We will often use the complex eigenvalue λ=iν=i2a\lambda= i\nu= i\sqrt{2a} in lieu of the parameter aa, such that λ∈(0,1)\lambda\in(0,1). We can always fix A0A_0 to be real, and by the normalization condition

N=1=1T∫0T∣ψ0∣2 dt=A02+2∑m=1n∣Am∣2⟹A0=1−2∑m=1n∣Am∣2.(26)N = 1 = \frac{1}{T}\int_0^T |\psi_0|^2\,\mathrm{d}t = A_0^2 + 2\sum_{m=1}^{n}|A_m|^2 \Longrightarrow A_0 = \sqrt{1-2\sum_{m=1}^{n}|A_m|^2}. \tag*{(26)}

To run such a simulation, we must select one of the three necessary parameters, λ\lambda (or equivalently, aa), Ω\Omega, or TT, then we compute the remaining two

λ, T, Ω = params(λ = 0.8im)  # or
λ, T, Ω = params(a = 0.8^2/2) # or
λ, T, Ω = params(Ω = 1.2)     # or
λ, T, Ω = params(T = 2*Pi/1.2)

The user should pick one of the four options; they are equivalent. However, note that everything is done in terms of λ\lambda, not aa. aa is only used as a parameter for breathers, while λ\lambda is used in the literature for other solutions as well.

The next step is to generate a simulation box. Since we are studying a periodic solution, the box’s transverse size should be a multiple of the breather’s period. For one period TT, we have t∈[−T/2,T/2)t \in[-T/2,T/2). Any longitudinal range of xx can be selected. The number of nodes in the transverse direction NtN_t should also be specified, as well as the longitudinal grid spacing, dxdx. Note that NtN_t is the number of grid points used in the computation of the Fourier transform.

xᵣ = 0=>100
box = Box(xᵣ, T, dx=1e-3, Nₜ=256)

Next, we generate the initial condition (25) using a helper function that automates the process.

coeff = [1e-4]
ψ₀, A₀ = ψ₀_periodic(coeff, box, Ω)

The size of the array coeff=Am\mathrm{coeff}=A_m is arbitrary, and the user can specify as many coefficients as they wish; we use only one in this example for simplicity. The final step is to create a simulation structure utilizing the box and initial condition we have produced, as well as λ\lambda and an algorithm from Table 1. Then we can solve it and (optionally) compute the integrals of motion.

sim = Sim(λ, box, ψ₀, T4A_TJ!) # Create simulation structure
solve!(sim)                     # Solve the simulation
compute_IoM!(sim)               # Compute the integrals of motion

At this point, the simulation has concluded, and one can access the solution as follows

λ, T, Ω = params(λ = 0.8im)

xᵣ = 0=>100
box = Box(xᵣ, T, dx=1e-3, Nₜ = 256, n_periods = 1)

coeff = [1e-4]
ψ₀, A₀ = ψ₀_periodic(coeff, box, Ω)

sim = Sim(λ, box, ψ₀, T4A_TJ!)

solve!(sim)
compute_IoM!(sim)

Example 1: Running a simulation with a cosine wave initial condition.

sim.ψ   # Array containing the solution ψ(x,t)
sim.ψ̃   # Array containing the spectrum of the solution ψ̃(ω,x)
sim.KE  # Array containing the kinetic energy K(x)
sim.PE  # Array containing the potential energy V(x)
sim.E   # Array containing the energy E(x)
sim.N   # Array containing the norm N(x)
sim.P   # Array containing the momentum P(x)

If one wishes to visualize the solution, NonlinearSchrodinger.jl provides Plots.jl “recipes” that allow normal plotting commands to interpret Sim (and Calc, discussed later) objects. An example is shown below.1

using Plots

surface(sim)                         # plot |ψ| in surface mode
contour(sim)                         # plot |ψ| in contour mode
heatmap(sim, res_x=1000, res_t=1000) # plot |ψ| in heatmap mode
                                     # using 1000 x nodes and 1000 t nodes
                                     # Default resolution is 500x500
heatmap(sim, :ψ̃)                    # plot log|ψ̃| in heatmap mode
plot(sim, :ψ̃)                       # plot log|ψ̃| in lines mode
plot(sim, :IoM)                      # plot integrals of motion and errors

These commands function as any Plots.jl commands would, and accept keyword arguments to adjust the plot parameters. All standard plotting commands should work; see the Plots.jl documentation for more details.

The full example is shown in listing 1, showcasing the simplicity of NonlinearSchrodinger.jl’s interface. Its results are displayed in Figure 4 and 5.2

Results of Example 1: (a) absolute value of the wave envelope and (b) log of the spectrum

Figure 4. The results of Example 1, with a cosine wave (25) initial condition. (a) The absolute value of the wave envelope, ∣ψ(x,t)∣|\psi(x,t)|, showing the breather recurrence due to modulation instability. (b) The log of the spectrum of the solution, showing the Fourier modes’ growth, the spectral signature of modulation instability.

Figure 5. The energy (total energy EE, kinetic energy KK and potential energy VV), energy error, momentum error and norm error in Example 1, corresponding to a cosine wave (25) initial condition. The energy error peaks when the breather forms.

λ = 0.75im

T = 20
xᵣ = 0=>100
box = Box(xᵣ, T, dx=1e-3, Nₜ = 256, n_periods = 1)

ψ₀ .= 2*imag(λ)./cosh.(2*imag(λ).*box.t) .+ 0*im

sim = Sim(λ, box, ψ₀, T4A_TJ!)

solve!(sim)

caption: Example 2: Running a simulation with a soliton initial condition.

Example 2: Soliton Initial Condition

We are not restricted to the helper function ψ0_periodic\psi_0\_\mathrm{periodic} to generate the initial condition. In fact, we can use any initial condition as long as it is an array of type Complex{Float64} and has the correct size (NtN_t). For example, we can use the soliton (2) at x=0x = 0 as an initial condition, as shown in Example 2.

Due to the soliton’s non-periodicity and the inherent periodic boundary conditions of the Fourier split-step algorithms, one must select a large enough transverse box size to ensure the soliton decays sufficiently at the boundaries of the box. As shown in Figure 6, the simulation propagates the soliton without changing its shape, as expected.

Simulation with a soliton initial condition

Figure 6. Simulation with a soliton initial condition (Example 2). The soliton maintains its shape while propagating.

Example 3: Pruning and Nonlinear Talbot Carpets

Assume one would like to run a simulation with MM periods and NtN_t Fourier modes. In this case, we expect that the Mth,2Mth,…,NtMthM^\mathrm{th}, 2M^\mathrm{th}, \ldots, N_tM^\mathrm{th} modes to grow together in lock-step, as discussed in [15, 43]. However, due to modulation instability, the remaining modes will inevitably grow from zero, and “ruin” the periodicity of the resultant solution, known as a nonlinear Talbot carpet. To circumvent this issue, we introduce a pruning procedure as follows. After every xx-evolution step, we “prune” the unwanted Fourier modes

ψ~(ωj)→f(ψ~(ωj)),j≠M,2M,…Nt×M,(27)\widetilde{\psi}(\omega_j) \to f(\widetilde{\psi}(\omega_j)), \qquad j \ne M, 2M, \ldots N_t \times M, \tag*{(27)}

where

f(ψ~(ωj))=ψ~(ωj)exp⁡(−β∣ψ~(ωj)∣),(28)f(\widetilde{\psi}(\omega_j)) = \widetilde{\psi}(\omega_j) \exp\left(-\beta\left|\widetilde{\psi}(\omega_j)\right|\right), \tag*{(28)}

for some constant β>1\beta> 1.

This pruning procedure was initially introduced in Ref. [44] and later refined and used to study nonlinear Talbot carpets in Ref. [43].

For example, suppose we use 3 periods. Then, we expect the 3rd,6th,9th3^\mathrm{rd}, 6^\mathrm{th}, 9^\mathrm{th}, etc. Fourier modes to grow together in lockstep. Thus, we can exponentially prune the 1st,2nd,4th,5th1^\mathrm{st}, 2^\mathrm{nd}, 4^\mathrm{th}, 5^\mathrm{th}, etc. Fourier modes, as demonstrated above, to stop their spurious growth that “ruins” the periodicity of the nonlinear Talbot carpet. See Example 3 for a demonstration with 5 periods. The results of this example without (β=0\beta= 0) and with (β=10\beta= 10) pruning are shown in Figure 7 and Figure 8, respectively.

Figure 7. The results of Example 3 with pruning disabled (β=0\beta= 0) (a) The absolute value of the wave envelope, ∣ψ(x,t)∣|\psi(x,t)|, showing a nonlinear Talbot carpet destroyed due to modulation instability of the “non-fundamental” modes. (b) The spectrum of the solution, showing the growth of the aforementioned modes.

Figure 8. The results of Example 3, with pruning enabled (β=10\beta= 10). (a) The absolute value of the wave envelope, ∣ψ(x,t)∣|\psi(x,t)|, showing a perfect nonlinear Talbot carpet. (b) The spectrum of the solution, demonstrating the suppressed “non-fundamental” modes.

λ, T, Ω = params(a = 0.36)

xᵣ = 0=>60
box = Box(xᵣ, T, dx=1e-4, Nₜ = 512, n_periods = 5)

coeff = [(2.7 + 4.6im)*1e-2]
ψ₀, A₀ = ψ₀_periodic(coeff, box, Ω)

# Set β = 0 to turn off pruning (default behavior when β is not set)
sim = Sim(λ, box, ψ₀, T4A_TJ!, β = 10.0)

solve!(sim)

Example 3: Running a simulation with pruning

Solving the NLSE Analytically

The most general extended nonlinear Schrödinger equation supported by the Darboux transformation scheme in NonlinerSchrodinger.jl is of the form

iψx+S[ψ(x,t)]−iαH[ψ(x,t)]+γP[ψ(x,t)]−iδQ[ψ(x,t)]=0(29)i\psi_x + S[\psi(x,t)] - i\alpha H[\psi(x,t)] + \gamma P[\psi(x,t)] - i\delta Q[\psi(x,t)] = 0 \tag*{(29)}

where

S[ψ(x,t)]=12ψtt+∣ψ∣2ψ,S[\psi(x,t)] = \frac{1}{2}\psi_{tt} + |\psi|^2\psi,
H[ψ(x,t)]=ψttt+6∣ψ∣2ψt,H[\psi(x,t)] = \psi_{ttt} + 6|\psi|^2\psi_t,
P[ψ(x,t)]=ψtttt+8∣ψ∣2ψtt+6∣ψ∣4ψ+4∣ψt∣2ψ+6ψt2ψ∗+2ψ2ψtt∗,P[\psi(x,t)] = \psi_{tttt} + 8|\psi|^2\psi_{tt} + 6|\psi|^4\psi+ 4|\psi_t|^2\psi+ 6\psi_t^2\psi^* + 2\psi^2\psi_{tt}^*,
Q[ψ(x,t)]=ψttttt+10∣ψ∣2ψttt+30∣ψ∣4ψt+10ψψtψtt∗+10ψψt∗ψtt+20ψ∗ψtψtt+10ψt2ψt∗.(30)Q[\psi(x,t)] = \psi_{ttttt} + 10|\psi|^2\psi_{ttt} + 30|\psi|^4\psi_t + 10\psi\psi_t\psi_{tt}^* + 10\psi\psi_t^*\psi_{tt} + 20\psi^*\psi_t\psi_{tt} + 10\psi_t^2\psi_t^*. \tag*{(30)}

Special cases include the cubic nonlinear Schrödinger equation (1) (α=γ=δ=0\alpha= \gamma= \delta= 0), the Hirota equation [9, 18, 45, 46] (α≠0,γ=δ=0\alpha\ne0, \gamma= \delta= 0) the Lakshmanan-Porsezian-Daniel (LPD) equation [5, 6, 47] (γ≠0,α=δ=0\gamma\ne0, \alpha= \delta= 0) and the Quintic nonlinear Schrödinger equation (QNLSE) [12, 48, 49] (δ≠0,α=γ=0\delta\ne0, \alpha= \gamma= 0).

For the sake of simplicity, we will restrict ourselves to the cubic nonlinear Schrödinger equation (1) in the discussion that follows as a prototypical example, and provide an example of the full extended equation (29) in § 4.6.6 (Example 9). The extension of the Darboux transformation (§ 4.2) to the extended equation for the soliton (Sec. 4.3.1) and breather (§ 4.3.2) seeds is simple but tedious. It is highly non-trivial for the cnoidal seeds (§ 4.3.3 and 4.3.4, see Ref. [12]) and is not yet implemented in this package.

The Lax System

It is well known that the cubic NLSE (1) can be written as the compatibility condition of the following system [17, 19, 26, 50]

Rt=LR,Rx=BR,(31)\begin{aligned} R_t &= LR,\\ R_x &= BR, \tag*{(31)} \end{aligned}

where

L=(−iλψ−ψ∗iλ),B=(−iλ2+i2∣ψ∣2λψ+i2ψx−λψ∗+i2ψx∗iλ2−i2∣ψ∣2).(32)L = \begin{pmatrix} -i\lambda& \psi\\ -\psi^* & i\lambda\end{pmatrix}, \qquad B = \begin{pmatrix} -i\lambda^2 + \frac{i}{2}|\psi|^2 & \lambda\psi+ \frac{i}{2}\psi_x \\ -\lambda\psi^* + \frac{i}{2}\psi_x^* & i\lambda^2 - \frac{i}{2}|\psi|^2 \end{pmatrix}. \tag*{(32)}

λ\lambda is an isospectral complex eigenvalue, i.e. λx=0\lambda_x = 0. By compatibility condition we mean that (Rx)t=(Rt)x(R_x)_t = (R_t)_x is only satisfied when ψ\psi is a solution of (1), as one can easily check. This condition is also called the zero-curvature condition as it has deep roots in differential geometry [25]. The system (31) is known as the Lax system [51] of the NLSE. We refer interested readers to [19, 50] for more details.

The Darboux Transformation

A set of solutions of (31) is written as

R=(r1,ps1,p)(33)R = \begin{pmatrix} r_{1,p} \\ s_{1,p} \end{pmatrix} \tag*{(33)}

where pp labels each unique solution with a unique eigenvalue λp\lambda_p. These solutions also depend, in principle, on arbitrary longitudinal and transverse shifts (xp,tp)(x_p,t_p), which appear as integration constants. We can obtain a solution of order nn recursively via the Darboux transformation [26]

ψn=ψn−1+2(λn∗−λn)sn,1rn,1∗∣rn,1∣2+∣sn,1∣2,(34)\psi_n = \psi_{n-1} + \frac{2(\lambda_n^*-\lambda_n)s_{n,1}r_{n,1}^*}{\lvert r_{n,1}\rvert^2+\lvert s_{n,1}\rvert^2}, \tag*{(34)}

where

rnp=[(λn−1∗−λn−1)sn−1,1∗rn−1,1∗sn−1,p+1+(λp+n−1−λn−1)∣rn−1,1∣2rn−1,p+1+(λp+n−1−λn−1∗)∣sn−1,1∣2rn−1,p+1]/(∣rn−1,1∣2+∣sn−1,1∣2),snp=[(λn−1∗−λn−1)sn−1,1rn−1,1∗rn−1,p+1+(λp+n−1−λn−1)∣sn−1,1∣2sn−1,p+1+(λp+n−1−λn−1∗)∣rn−1,1∣2sn−1,p+1]/(∣rn−1,1∣2+∣sn−1,1∣2).(35)\begin{aligned} r_{np} ={}& \bigl[(\lambda_{n-1}^*-\lambda_{n-1})s_{n-1,1}^*r_{n-1,1}^*s_{n-1,p+1} \\ &+(\lambda_{p+n-1}-\lambda_{n-1})\lvert r_{n-1,1}\rvert^2r_{n-1,p+1} \\ &+(\lambda_{p+n-1}-\lambda_{n-1}^*)\lvert s_{n-1,1}\rvert^2r_{n-1,p+1}\bigr]/(\lvert r_{n-1,1}\rvert^2+\lvert s_{n-1,1}\rvert^2), \\ s_{np} ={}& \bigl[(\lambda_{n-1}^*-\lambda_{n-1})s_{n-1,1}r_{n-1,1}^*r_{n-1,p+1} \\ &+(\lambda_{p+n-1}-\lambda_{n-1})\lvert s_{n-1,1}\rvert^2s_{n-1,p+1} \\ &+(\lambda_{p+n-1}-\lambda_{n-1}^*)\lvert r_{n-1,1}\rvert^2s_{n-1,p+1}\bigr]/(\lvert r_{n-1,1}\rvert^2+\lvert s_{n-1,1}\rvert^2). \tag*{(35)} \end{aligned}

The solution ψ0\psi_0 in (34) with n=1n=1 is called the “seed” solution of (1), and as long as we can solve for the Lax pair generating functions r1,pr_{1,p} and s1,ps_{1,p} for such a seed solution, we can then obtain higher-order analytical solutions of arbitrary order nn via the recursive scheme shown above. A visual representation of the recursion is shown in Figure 9.

Figure 9. A graphical representation of the Darboux transformation recursion for a fifth order solution. Each ordered pair in the nodes represents a value of (n,p)(n,p) in equations (35). It can be seen that functions with p=1p=1 are used multiple times, i.e., they are connected to multiple nodes in the “level” above them. In this package, each function is computed only once and then memoized (i.e., cached), and the cached value is used whenever needed to improve performance dramatically. Graphs similar to this one can be generated automatically using the script in the visualization section of the documentation for arbitrary solution order NN.

In principle, these equations can be implemented in a computer algebra system, such as Mathematica, and used to obtain symbolic expressions for any desired solution. However, such expressions are often too complicated and not particularly insightful, especially beyond the second order. For example, see Eq. (7) in Ref. [10] for the second-order breather’s analytical form. Furthermore, as we will show below, it is not always possible to find r1,pr_{1,p} and s1,ps_{1,p} analytically for every seed solution of (1). In this case, the procedure must be implemented numerically. In the sections that follow, we discuss the four possible seed solutions of (1) and how the Lax system (31) is solved for each of them.

The Four Seeds

In this section, we discuss the four most prominent seed solutions of the NLSE implemented in NonlinearSchrodinger.jl and the higher-order solutions to which they correspond.

ψ0=0\psi_0=0

The seed solution ψ0=0\psi_0=0 generates solitons via the Darboux transformation. Plugging ψ=0\psi=0 into (31), we get a simple form for r1,pr_{1,p} and s1,ps_{1,p}

r1,p(x,t)=exp⁡(+i[λp(t−tp)+λp2(x−xp)−π/4]),(36)r_{1,p}(x,t)=\exp\left(+i\left[\lambda_p(t-t_p)+\lambda_p^2(x-x_p)-\pi/4\right]\right), \tag*{(36)}
s1,p(x,t)=exp⁡(−i[λp(t−tp)+λp2(x−xp)−π/4]),(37)s_{1,p}(x,t)=\exp\left(-i\left[\lambda_p(t-t_p)+\lambda_p^2(x-x_p)-\pi/4\right]\right), \tag*{(37)}

where λp\lambda_p are unique eigenvalues and (tp,xp)(t_p,x_p) are arbitrary shifts in the tt and xx directions. The phase factor of π/4\pi/4 is selected to center the solutions at the origin [52].

ψ0=exp⁡(ix)\psi_0 = \exp(ix)

The second seed solution, ψ0=eix\psi_0 = e^{ix}, corresponds to breathers when passed through the Darboux transformation. Similar to the previous section, we plug ψ=eix\psi= e^{ix} into (31), and solve the resultant coupled differential equations. We can get a simple closed-form for the Lax pair generating functions

r1,p(x,t)=2ie−ix/2sin⁡(+χp+12Ωp(t−tp)+12Ωpλp(x−xp)−π4),s1,p(x,t)=2e+ix/2cos⁡(−χp+12Ωp(t−tp)+12Ωpλp(x−xp)−π4).(38)\begin{aligned} r_{1,p}(x,t) &= 2ie^{-ix/2}\sin\left(+\chi_p+\frac{1}{2}\Omega_p(t-t_p)+\frac{1}{2}\Omega_p\lambda_p(x-x_p)-\frac{\pi}{4}\right),\\ s_{1,p}(x,t) &= 2e^{+ix/2}\cos\left(-\chi_p+\frac{1}{2}\Omega_p(t-t_p)+\frac{1}{2}\Omega_p\lambda_p(x-x_p)-\frac{\pi}{4}\right). \tag*{(38)} \end{aligned}

Here, Ωp=21+λp2\Omega_p = 2\sqrt{1+\lambda_p^2} is the frequency of the pthp^{\mathrm{th}} constituent solution, and χp=arccos⁡(Ωp/2)/2\chi_p = \arccos(\Omega_p/2)/2.

ψ0=dn⁡(t,m)exp⁡(ix(1−m/2))\psi_0 = \operatorname{dn}(t,m)\exp(ix(1-m/2))

The seed solution ψ0=dn⁡(t,m)eix(1−m/2)\psi_0 = \operatorname{dn}(t,m)e^{ix(1-m/2)} corresponds to breathers on an elliptic dn background [20]. mm is the elliptic parameter (not to be confused with the elliptic modulus k=mk = \sqrt{m}) and dn is one of the Jacobi elliptic functions (JEFs). For a reference on JEFs, see [53].

In this case, we use the ansätze

r1p(x,t)=a1p(x,t)eix4(m−2),s1p(x,t)=b1p(x,t)e−ix4(m−2).(39)\begin{aligned} r_{1p}(x,t) &= a_{1p}(x,t)e^{\frac{ix}{4}(m-2)},\\ s_{1p}(x,t) &= b_{1p}(x,t)e^{-\frac{ix}{4}(m-2)}. \tag*{(39)} \end{aligned}

By substituting into (31), and suppressing the subscripts and dependence on xx and tt for clarity, we get [20]

at=iλa+ibdn⁡(t,m),bt=−iλb+iadn⁡(t,m),ax=12ia(2λ2+m(sn⁡2(t,m)−12))+b(iλdn⁡(t,m)−m2sn⁡(t,m)cn⁡(t,m)),bx=−12ib(2λ2+m(sn⁡2(t,m)−12))+a(iλdn⁡(t,m)+m2sn⁡(t,m)cn⁡(t,m)).(40)\begin{aligned} a_t &= i\lambda a+ib\operatorname{dn}(t,m),\\ b_t &= -i\lambda b+ia\operatorname{dn}(t,m),\\ a_x &= \frac{1}{2}ia\left(2\lambda^2+m\left(\operatorname{sn}^2(t,m)-\frac{1}{2}\right)\right)+b\left(i\lambda\operatorname{dn}(t,m)-\frac{m}{2}\operatorname{sn}(t,m)\operatorname{cn}(t,m)\right),\\ b_x &= -\frac{1}{2}ib\left(2\lambda^2+m\left(\operatorname{sn}^2(t,m)-\frac{1}{2}\right)\right)+a\left(i\lambda\operatorname{dn}(t,m)+\frac{m}{2}\operatorname{sn}(t,m)\operatorname{cn}(t,m)\right). \tag*{(40)} \end{aligned}

However, unlike the soliton and breather seeds, these coupled differential equations have no analytical solutions that we know of. We can solve for the profiles and derivatives at t=0t=0

a1p∣t=0=Aei(χp+12Ωpλp(x−xp))−Be−i(χp+12Ωpλp(x−xp)),b1p∣t=0=Aei(−χp+12Ωpλp(x−xp))+Be−i(−χp+12Ωpλp(x−xp)),a1p,t∣t=0=i(λpa1p∣t=0+b1p∣t=0),b1p,t∣t=0=−i(λpb1p∣t=0−a1p∣t=0).(41)\begin{aligned} a_{1p}|_{t=0} &= Ae^{i(\chi_p+\frac{1}{2}\Omega_p\lambda_p(x-x_p))}-Be^{-i(\chi_p+\frac{1}{2}\Omega_p\lambda_p(x-x_p))},\\ b_{1p}|_{t=0} &= Ae^{i(-\chi_p+\frac{1}{2}\Omega_p\lambda_p(x-x_p))}+Be^{-i(-\chi_p+\frac{1}{2}\Omega_p\lambda_p(x-x_p))},\\ a_{1p,t}|_{t=0} &= i(\lambda_pa_{1p}|_{t=0}+b_{1p}|_{t=0}),\\ b_{1p,t}|_{t=0} &= -i(\lambda_pb_{1p}|_{t=0}-a_{1p}|_{t=0}). \tag*{(41)} \end{aligned}

Here, we have defined Ωp=2(λp−m4λp)2+1\Omega_p = 2\sqrt{\left(\lambda_p-\frac{m}{4\lambda_p}\right)^2+1} as the frequency of the solution, and χp=arccos⁡(Ωp2)/2\chi_p = \arccos\left(\frac{\Omega_p}{2}\right)/2. Further, we set the integration constants A=e−iπ/4=B∗A=e^{-i\pi/4}=B^* as before to center the solutions at the origin (when the shifts are set to zero). Finally, we get a set of coupled equations along with their initial conditions

(a1p)t=iλa(x,t)+ib(x,t)dn⁡(t,m),(b1p)t=−iλb(x,t)+ia(x,t)dn⁡(t,m),a1p∣t=0=2isin⁡(χp+12Ωpλp(x−xp)−π4),b1p∣t=0=2cos⁡(−χp+12Ωpλp(x−xp)−π4).(42)\begin{aligned} (a_{1p})_t &= i\lambda a(x,t) + ib(x,t)\operatorname{dn}(t,m),\\ (b_{1p})_t &= -i\lambda b(x,t) + ia(x,t)\operatorname{dn}(t,m),\\ a_{1p}|_{t=0} &= 2i\sin\left(\chi_p+\frac{1}{2}\Omega_p\lambda_p(x-x_p)-\frac{\pi}{4}\right),\\ b_{1p}|_{t=0} &= 2\cos\left(-\chi_p+\frac{1}{2}\Omega_p\lambda_p(x-x_p)-\frac{\pi}{4}\right). \tag*{(42)} \end{aligned}

We have ignored the shifts tpt_p along the temporal direction in this procedure for simplicity. These coupled differential equations must be evolved numerically in tt to obtain the final solution. We are not aware of any methods to solve them analytically.

ψ0=mcn⁡(t,m)eix(m−1/2)\psi_0=\sqrt{m}\operatorname{cn}(t,m)e^{ix(m-1/2)}

The seed ψ0=mcn⁡(t,m)eix(m−1/2)\psi_0=\sqrt{m}\operatorname{cn}(t,m)e^{ix(m-1/2)} corresponds to solitons on a cnoidal background [20]. The solution process is very similar to what was presented in the previous section for the dnoidal seed. First, we take the ansätze

r1p(x,t)=a1p(x,t)e−ix4(2m−1),s1p(x,t)=b1p(x,t)eix4(2m−1).(43)\begin{aligned} r_{1p}(x,t) &= a_{1p}(x,t)e^{-\frac{ix}{4}(2m-1)},\\ s_{1p}(x,t) &= b_{1p}(x,t)e^{\frac{ix}{4}(2m-1)}. \tag*{(43)} \end{aligned}

Using these ansätze and the process previously outlined, we obtain [20]

(a1p)t=iλa(x,t)+imb(x,t)cn⁡(t,m),(b1p)t=−iλb(x,t)+ima(x,t)cn⁡(t,m),a1p∣t=0=2isin⁡(χp+12Ωpλp(x−xp)−π4),b1p∣t=0=2cos⁡(−χp+12Ωpλp(x−xp)−π4).(44)\begin{aligned} (a_{1p})_t &= i\lambda a(x,t)+i\sqrt{m}b(x,t)\operatorname{cn}(t,m),\\ (b_{1p})_t &= -i\lambda b(x,t)+i\sqrt{m}a(x,t)\operatorname{cn}(t,m),\\ a_{1p}|_{t=0} &= 2i\sin\left(\chi_p+\frac{1}{2}\Omega_p\lambda_p(x-x_p)-\frac{\pi}{4}\right),\\ b_{1p}|_{t=0} &= 2\cos\left(-\chi_p+\frac{1}{2}\Omega_p\lambda_p(x-x_p)-\frac{\pi}{4}\right). \tag*{(44)} \end{aligned}

Where now Ωp=2m1+1m(λp−14λp)2\Omega_p=2\sqrt{m}\sqrt{1+\frac{1}{m}\left(\lambda_p-\frac{1}{4\lambda_p}\right)^2} and χp=12arccos⁡(Ωp2m)\chi_p=\frac{1}{2}\arccos\left(\frac{\Omega_p}{2\sqrt{m}}\right).

Maximal Intensity Families

For the periodic seeds discussed in § 4.3.2 and 4.3.3, there are so-called maximal intensity families that match the constituent breathers’ periods to each other. See [42] for the uniform background case and [54] for the dnoidal background case.

In the uniform background case, it is simple to match these periods to each other: Ωp=pΩ\Omega_p=p\Omega, where Ω≡Ω1\Omega\equiv\Omega_1 is the period of the first-order constituent breather. This leads to the following equations for the imaginary parts of the eigenvalues

νp=p2(ν2−1)+1,(45)\nu_p=\sqrt{p^2(\nu^2-1)+1}, \tag*{(45)}

where νp=ℑ(λp)\nu_p = \Im(\lambda_p) and ν≡ν1=ℑ(λ1)\nu\equiv\nu_1 = \Im(\lambda_1) is the so-called fundamental eigenvalue of the maximal intensity family. Note that, for an NNth order breather, we must have ν>ν∗\nu> \nu^{*} for all the νp\nu_p to be real, where

ν∗=1−1N2.(46)\nu^{*} = \sqrt{1 - \frac{1}{N^2}}. \tag*{(46)}

Effectively, this collapses the parameter space of an NNth order breather from NN dimensions to 1 dimension, ignoring the spatiotemporal shifts.

For the breathers on the dnoidal background, the process is similar but more involved [54]. We start by defining the following function

Gp(m,ν)=m2p2+8(m−2)(p2−1)ν2+16p2ν4.(47)G_p(m,\nu) = m^2p^2 + 8(m-2)(p^2-1)\nu^2 + 16p^2\nu^4. \tag*{(47)}

Now, we get

νp=Gp(m,ν)+[Gp(m,ν)]2−64m2ν442ν,(48)\nu_p = \frac{\sqrt{G_p(m,\nu) + \sqrt{[G_p(m,\nu)]^2 - 64m^2\nu^4}}}{4\sqrt{2}\nu}, \tag*{(48)}

One can verify (47) reduces to (45) when m=0m = 0. There is an analogous but more complicated expression for ν∗\nu^{*} given in Ref. [54].

However, one must also match the breathers to the background for a truly periodic solution. In this case, TB=qTdnT_B = qT_{\rm dn} where qq is a positive integer, TBT_B is the period of the fundamental breather characterized by ν\nu and TdnT_{\rm dn} is the period of the dnoidal background, characterized by mm.

Skipping the details of the derivation, the implementation in NonlinearSchrodinger.jl uses the following equation to compute ν\nu given a value of mm

ν=122−F2−m+2(F2−1)(F2−1+m),(49)\nu= \frac{1}{2}\sqrt{2-F^2-m+2\sqrt{(F^2-1)(F^2-1+m)}}, \tag*{(49)}
F=π2qK(m).(50)F = \frac{\pi}{2qK(m)}. \tag*{(50)}

Here, K(m)K(m) is the complete elliptic integral of the first kind [53]. We are not aware of a method to invert this equation analytically to obtain mm given a value of ν\nu.

These maximal intensity families are implemented in NonlinearSchrodinger.jl via the functions λ_maximal (to get a set of λp\lambda_p given λ\lambda) and λ_given_m (to get a value of λ\lambda given mm and an integer qq). The code automatically checks that the provided λ\lambda is large enough (i.e., ν>ν∗\nu> \nu^{*}) for a given breather order NN and returns an error otherwise. For an example on how to use these functions, see Sec. 4.6.2 (Example 5) and 4.6.4 (Example 7).

Numerical Implementation

In NonlinearSchrodinger.jl, we implement the Darboux transformation numerically and use it to study these analytical solutions. If the seed solution leads to exact expressions for r1,pr_{1,p} and s1,ps_{1,p}, then the equations are implemented as is, and thus they are accurate within the limits of double-precision (i.e. ψ0=0\psi_0 = 0 (Sec. 4.3.1) and ψ0=eix\psi_0 = e^{ix} (Sec. 4.3.2)). If this is not possible (i.e. the cnoidal and dnoidal seeds discussed in Sec. 4.3.3 and 4.3.4), then we obtain r1,pr_{1,p} and s1,ps_{1,p} using standard numerical algorithms 3. We specifically use Tsitouras’ 5/4 Runge-Kutta method [55] as implemented in Julia’s DifferentialEquations.jl library [56].

Using NonlinearSchrodinger.jl for the Darboux Transformation

In what follows, we present several examples demonstrating how to use the package to perform Darboux transformation calculations using all four seeds.

Example 4: Seven-Soliton Collision

In this example, we demonstrate how to obtain a highly complicated solution, a seven-soliton collision. The first step is to create a calculation “box”, as was done in the simulation examples. In this case, it is often easier to specify the number of NxN_x grid points directly instead of dxdx.

xᵣ = -10=>10
T = 20
box = Box(xᵣ, T, Nₓ=1000, Nₜ = 1000)

We can use any box size since there is no need to worry about boundary conditions in Darboux transformation calculations. The next step is deciding on the eigenvalues λ\lambda and the spatiotemporal shifts. In this example, since we are interested in a seven-soliton solution, we have seven of each of these parameters. Recall that the eigenvalues must be unique in the Darboux transformation scheme. We use complex eigenvalues to give the solitons a velocity (or “tilt”) in the txtx-plane, determined by the eigenvalue’s real part. Further, we set all the shifts to zero so that the solitons collide at the origin.

λ = [-0.45 + 0.775im, -0.35 + 0.8im, -0.25 + 0.825im, 0.85im,
     0.25 + 0.875im, 0.35 + 0.9im, 0.45 + 0.925im]
xₛ = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
tₛ = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

The size of all three arrays must always be equal and determines the order of the solution. Finally, we create the calculation object and solve it.

seed = "0"
calc = Calc(λ, tₛ, xₛ, seed, box)

solve!(calc)

We can compute the integrals of motion as shown before using the compute_IoM! function. The spectrum is calculated automatically as with simulations. The final calculation results can be accessed and plotted in the same way shown in § 3.5.1. This example in its entirety is shown in code listing 4, and the result is depicted in Figure 10.

Figure 10. A seven-soliton collision obtained using the Darboux transformation as demonstrated in Example 4. The color scale is cut off at ∣ψ∣=5|\psi| = 5 to better highlight the low-intensity features of the collision. The actual peak-height of the soliton at (x,t)=(0,0)(x,t) = (0,0) is 11.9.

Example 5: Fifth-Order Breather on a Uniform Background

The purpose of this example is to demonstrate how to deal with breathers, where one often wants the transverse box size to be a multiple of their period. Furthermore, we demonstrate the usage of the function λ_maximal to generate a maximal intensity (i.e., fully periodic) solution.

First, we start by creating a box for the calculation, just as before. However, in this

xᵣ = -10=>10
T = 20
box = Box(xᵣ, T, Nₓ=1000, Nₜ = 1024)

λ = [-0.45 + 0.775im, -0.35 + 0.8im, -0.25 + 0.825im, 0.85im,
     0.25 + 0.875im, 0.35 + 0.9im, 0.45 + 0.925im]
xₛ = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
tₛ = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

seed = "0"
calc = Calc(λ, tₛ, xₛ, seed, box)

solve!(calc)

Example 4: Seven-soliton collision computed via the Darboux transformation

xᵣ = -10=>10
λ₁ = 0.98im
λ, T, Ω = params(λ = λ₁)
box = Box(xᵣ, T, Nₓ=1000, Nₜ = 1024, n_periods = 3)

λ = λₘₐₓᵢₘₐₗ(λ₁, 5)
xₛ = [0.0, 0.0, 0.0, 0.0, 0.0]
tₛ = [0.0, 0.0, 0.0, 0.0, 0.0]

seed = "exp"
calc = Calc(λ, tₛ, xₛ, seed, box)

solve!(calc)

Example 5: Calculating a maximal intensity fifth order breather via the Darboux transformation

case, we would like the box size to be three periods of the breather. We utilize the function params to compute the period of the breather, and use the n_periods argument of the Box constructor to get three periods.

xᵣ = -10=>10
λ₁ = 0.98im # The fundamental eigenvalue
λ, T, Ω = params(λ = λ₁)
box = Box(xᵣ, T, Nₓ=1000, Nₜ = 1024, n_periods = 3)

The next step is to set up the eigenvalues and shifts. Instead of specifying the eigenvalues explicitly as in the previous example, we employ the λ_maximal function to generate them automatically, with N=5N = 5 to get a fifth-order solution. These eigenvalues guarantee its periodicity, as discussed in § 4.4.

λ = λₘₐₓᵢₘₐₗ(λ₁, 5) # array of 5 eigenvalues
xₛ = [0.0, 0.0, 0.0, 0.0, 0.0]
tₛ = [0.0, 0.0, 0.0, 0.0, 0.0]

This results in the following values of λ\lambda:

λ = [0.98im, 0.9173875952943771im, 0.8022468448052632im,
     0.6053098380168617im, 0.0999999999999974im]

Finally, just as before, we define the Calc structure and solve it. The full example is shown in code listing 5, and the result of the calculation is depicted in Figure 11, highlighting the full periodicity of the solution. As a pedagogical exercise, we urge users to change these automatically generated eigenvalues by hand, run the calculation and observe the differences.

A fully periodic fifth-order breather

Figure 11. The result of Example 5, a fully periodic fifth-order breather.

xᵣ = -10=>10
T = 20

box = Box(xᵣ, T, Nₓ=1000, Nₜ = 1024)
λ = [-0.3+0.85im, 0.9im, 0.3+0.95im]
xₛ = [0.0, 0.0, 0.0]
tₛ = [0.0, 0.0, 0.0]

seed = "cn"
calc = Calc(λ, tₛ, xₛ, seed, box, m = 0.5)

solve!(calc)

Example 6: Collision of three solitons on a cnoidal background

m = 2/5
λ = λ_given_m(m, q=4)
λ, T, Ω = params(λ = λ, m=m)
xᵣ = -10=>10
box = Box(xᵣ, T, Nₓ=1000, Nₜ = 1024, n_periods = 3)

xₛ = [0.0]
tₛ = [0.0]

seed = "dn"
calc = Calc(λ, tₛ, xₛ, seed, box, m=m)

solve!(calc)

Example 7: First-order breather on a dnoidal background with q=4q = 4 and m=2/5m = 2/5.

Example 6: Three-Soliton Collision a Cnoidal Background

This example is quite simple and is analogous to Example 4 (§ 4.6.1), but on a cnoidal background. The main point to note here is that NtN_t used in the box is half the number of nodes used in the integration of Eq. (44). Thus, NtN_t should be treated as a convergence parameter. The full example is shown in code listing 6, and the result is depicted in Figure 12.

Results of Example 6, showcasing the collision of three solitons on a cnoidal background

Figure 12. Results of Example 6, showcasing the collision of three solitons on a cnoidal background with m=1/2m = 1/2.

Example 7: First-Order Breather on a Dnoidal Background

The purpose of this example is to demonstrate the usage of the function λ_given_m to generate a maximal intensity breather on a dnoidal background. As explained in § 4.4, one picks a value of mm, together with an integer q≥2q \ge2 to compute a fundamental eigenvalue λ\lambda. This λ\lambda can then be used to compute a higher-order breather’s eigenvalues as before if required. In this example, we restrict ourselves to a first-order breather to best highlight the effect of background matching.

This section should be self-explanatory with the background previously given. The full example is shown in code listing 7 and depicted in Figure 13. As before, we urge users to change the value of λ\lambda automatically computed by λ_given_m to see the effect on the solution.

Figure 13. First-order breather fully matched to the underlying dnoidal background, as computed in Example 7.

Example 8: Combining Darboux Transformations and Simulations

In this example, we combine the Darboux transformation with simulations to “dynamically” generate a higher-order solution of the NLSE, as done in Ref. [9, 12, 15] and others. We offer the utility function ψ0DT\psi_0{}_{\mathrm{DT}} to generate these initial conditions from whichever desired breather on a uniform background. Using this function with other seeds is not currently supported but can be done manually with ease, as long as care is taken with the boundary conditions. The full example is shown in code listing 8 and is quite similar to the previous examples. The result is depicted in Figure 14.

The result of Example 8, showing the fifth-order Akhmediev breather and subsequent smaller peaks

Figure 14. The result of Example 8. One can see the fifth-order Akhmediev breather formed at x=10x = 10 as expected, followed by smaller peaks due to modulation instability.

λ₁ = 0.98im
λ, T, Ω = params(λ = λ₁)

xᵣ = 0=>100
box = Box(xᵣ, T, dx=1e-3, Nₜ = 512, n_periods = 1)

λ = λ_maximal(λ₁, 5) # array of 5 eigenvalues
xₛ = [0.0, 0.0, 0.0, 0.0, 0.0]
tₛ = [0.0, 0.0, 0.0, 0.0, 0.0]
ψ₀ = ψ₀_DT(λ, tₛ, xₛ, -10, box) #Extract ψ from the DT at x=-10

sim = Sim(λ₁, box, ψ₀, T4A_TJ!)

solve!(sim)
compute_IoM!(sim)

Example 8: Solving the NLSE with an initial condition from the Darboux Transformation

Example 9: Breather to Soliton Conversion in a Fifth-Order NLSE

Given a generalized fifth-order NLSE of the form (29), we can compute the Darboux transformation by passing a dictionary f to the Calc constructor as follows

f = Dict{Symbol,Float64}(:α=> 0.75, :γ => -0.12, :δ=>-0.13)
calc = Calc(λ, tₛ, xₛ, seed, box, f = f)

Writing the eigenvalue as λ=v+iν\lambda= v + i\nu, one can impose some constraints on the real part vv as a function of α\alpha, γ\gamma, δ\delta and ν\nu to convert a breather to a soliton [12, 49]. Note that this is not possible in the simple case of the cubic NLSE. This constraint takes the form

64δv3−24γv2−8(α+2δ+8δν2)v+4γ(1+2ν2)+1=0.(51)64\delta v^3 - 24\gamma v^2 - 8(\alpha+ 2\delta+ 8\delta\nu^2)v + 4\gamma(1 + 2\nu^2) + 1 = 0. \tag*{(51)}

This is a simple cubic polynomial, and the real root gives the value of vv, which guarantees breather to soliton conversion. This functionality is implemented in NonlinearSchrodinger.jl via the function λ_given_f which can be used as shown

f = Dict{Symbol,Float64}(:α=> 0.75, :γ => -0.12, :δ=>-0.13)
ν = 0.9
λ = [λ_given_f(f, ν)]
xᵣ = -5=>5
T = 60
box = Box(xᵣ, T, Nₓ=1000, Nₜ = 1000)

f = Dict{Symbol,Float64}(:α=> 0.75, :γ => -0.12, :δ=>-0.13)
λ = [λ_given_f(f, 0.9)]
xₛ = [0.0]
tₛ = [0.0]

seed = "exp"
calc = Calc(λ, tₛ, xₛ, seed, box, f = f)

solve!(calc)

Example 9: Breather to soliton conversion in a fifth-order extended NLSE.

This function uses Skowron and Gould’s algorithm [57] as implemented in Julia’s PolynomialRoots.jl package. The rest of the computation is similar to any other Darboux transformation example and is shown in code listing 9. We stress that this example uses the breather seed of Sec. 4.3.2, not the soliton seed of Sec. 4.3.1, yet the resulting solution is a soliton, not a breather. This conversion is a fascinating feature of these extended NLSEs. The resulting soliton is depicted in Figure 15.

Figure 15. Breather to soliton conversion in a fifth-order extended NLSE as computed in Example 9.

Future Directions and Conclusion

There are many possible enhancements planned for NonlinearSchrodinger.jl’s future. First of all, we plan to implement several memory optimizations to aid in the performance of long-“time” simulations with a fine step dxdx. Moreover, we plan on supporting the numerical integration of more nonlinear Schrödinger-type equations such as the Hirota equation and the Sasa-Satsuma equation.

While our current implementation of the Darboux Transformation supports extended nonlinear Schrödinger equations of order up to 5, we plan to implement the entire hierarchy [16] so that calculations can be performed for arbitrary order equations. Furthermore, we plan to add support for cnoidal seeds beyond the cubic NLSE.

Finally, we plan to support quadruple-precision floating-point numbers to exploit higher-order integrators fully. We have already shown in Sec. 3.3 that eighth order algorithms are bottlenecked by double-precision. Quadruple-precision will alleviate this issue and allow for the implementation of even higher-order integrators.

Additionally, quadruple-precision will enable the calculation of much higher order solutions via the Darboux transformation. It is well known that double-precision can only handle breather and soliton solutions via the Darboux transformation up to order N∼30N \sim30 [58]. Quadruple-precision calculations will make the package more versatile and allow for computing, e.g., breather and soliton gas solutions with N∼100N \sim100 [58, 59].

In conclusion, we have presented a powerful and unique package that allows one to study numerical and analytical solutions of nonlinear Schrödinger equations via higher-order integrators and Darboux transformations. The package provides a simple interface and makes it straightforward to study complicated solutions and use optimal symplectic and RKN inte-

grators up to eighth order. Moreover, we offer many utilities for studying maximal intensity families, nonlinear Talbot carpets, breather to soliton conversion, and visualization of the solutions.

Acknowledgements

We are indebted to Siu A. Chin for the in-depth conversations on this manuscript, higher-order integrators, and much else. We thank Tomohiro Soejima for the insightful discussions about code optimization in Julia. We acknowledge the helpful talks with Milivoj R. Belić and Stanko N. Nikolić. We are grateful to Steven G. Louie for supporting this project.

Funding information O.A.A is supported by the UC Berkeley Physics Department.

Installation Instructions

After Julia is properly installed, it is quite simple to install NonlinearSchrodinger.jl as it is listed in Julia’s general repository. Julia comes with its own package manager and, starting from a terminal session; the package can be installed as follows:

$ julia
julia> ]
pkg> add NonlinearSchrodinger

The first command is run from the terminal, and the second command instantiates Julia’s built-in package manager. The third command installs the package from the general repository. No additional libraries or any other software are needed.

The following command must be issued once per session to use the package.

julia> using NonlinearSchrodinger

It is assumed in all exercises that it has already been run.

The Plots.jl package, used for plotting as outlined in § 3.5.1, is installed and used in the same way.

To input Greek letters (Unicode characters) in Julia, such as those shown in the exercises, enter them in the same way you would in LaTeX followed by the tab key. For example, to type λ\lambda in a Julia session, type the following: \lambda<TAB>. Please consult the Julia documentation for more details.

References

References

  1. [1]D. R. Solli, C. Ropers, P. Koonath and B. Jalali, Optical rogue waves., Nature 450, 1054 (2007), doi:10.1038/nature06402.DOI
  2. [2]B. Frisquet, B. Kibler and G. Millot, Collision of akhmediev breathers in nonlinear fiber optics, Physical Review X 3, 041032 (2014), doi:10.1103/PhysRevX.3.041032.DOI
  3. [3]A. Armaroli, C. Conti and F. Biancalana, Rogue solitons in optical fibers: a dynamical process in a complex energy landscape?, Optica 2, 497 (2015), doi:10.1364/OPTICA.2.000497.DOI
  4. [4]F. D. Zong, Y. S. Yan and S. T. Shen, Higher-order modes of modulation instability in bose-einstein condensates with a time-dependent three-dimensional parabolic potential, Journal of the Physical Society of Japan 83, 104002 (2014), doi:10.7566/JPSJ.83.104002.DOI
  5. [5]M. Lakshmanan, K. Porsezian and M. Daniel, Effect of discreteness on the continuum limit of the heisenberg spin chain, Physics Letters A 133(9), 483 (1988), doi:10.1016/0375-9601(88)90520-8.DOI
  6. [6]K. Porsezian, M. Daniel and M. Lakshmanan, On the integrability aspects of the one-dimensional classical continuum isotropic biquadratic heisenberg spin chain, Journal of Mathematical Physics 33(5), 1807 (1992), doi:10.1063/1.529658.DOI
  7. [7]C. Kharif and E. Pelinovsky, Physical mechanisms of the rogue wave phenomenon, European Journal of Mechanics -B/Fluids 22, 603 (2003), doi:10.1016/j.euromechflu.2003.09.002.DOI
  8. [8]P. A. E. M. Janssen, Nonlinear four-wave interactions and freak waves, Journal of Physical Oceanography 33, 863 (2003), doi:10.1175/1520-0485(2003)33<863:NFIAFW>2.0.CO;2.doi.org/10.1175/1520-0485(2003)33<863:nfiafw>2.0.co;2
  9. [9]S. N. Nikolić, N. B. Aleksić, O. A. Ashour, M. R. Belić and S. A. Chin, Systematic generation of higher-order solitons and breathers of the hirota equation on different backgrounds, Nonlinear Dynamics 89, 1637 (2017), doi:10.1007/s11071-017-3540-z.DOI
  10. [10]D. J. Kedziora, A. Ankiewicz and N. Akhmediev, Second-order nonlinear schrödinger equation breather solutions in the degenerate and rogue wave limits, Physical Review E 85(6) (2012), doi:10.1103/physreve.85.066601.DOI
  11. [11]D. J. Kedziora, A. Ankiewicz and N. Akhmediev, Triangular rogue wave cascades, Physical Review E 86, 056602 (2012), doi:10.1103/PhysRevE.86.056602.DOI
  12. [12]S. N. Nikolić, O. A. Ashour, N. B. Aleksić, M. R. Belić and S. A. Chin, Breathers, solitons and rogue waves of the quintic nonlinear schrödinger equation on various backgrounds, Nonlinear Dynamics 95(4), 2855 (2019), doi:10.1007/s11071-018-4726-8.DOI
  13. [13]D. J. Kedziora, A. Ankiewicz and N. Akhmediev, Circular rogue wave clusters, Physical Review E 84, 056611 (2011), doi:10.1103/PhysRevE.84.056611.DOI
  14. [14]A. Ankiewicz, D. J. Kedziora, A. Chowdury, U. Bandelow and N. Akhmediev, Infinite hierarchy of nonlinear schrödinger equations and their solutions, Physical Review E 93(1) (2016), doi:10.1103/physreve.93.012206.DOI
  15. [15]S. A. Chin, O. A. Ashour and M. R. Belic, Anatomy of the akhmediev breather: Cascading instability, first formation time, and fermi-pasta-ulam recurrence, Physical Review E 92, 063202 (2015), doi:10.1103/PhysRevE.92.063202.DOI
  16. [16]D. J. Kedziora, A. Ankiewicz, A. Chowdury and N. Akhmediev, Integrable equations of the infinite nonlinear schrödinger equation hierarchy with time variable coefficients, Chaos 25, 17105 (2015), doi:10.1063/1.4931710.DOI
  17. [17]V. E. Zakharov and A. B. Shabat, Exact theory of two-dimensional self-focusing and one-dimensional self-modulation of waves in nonlinear media, Zh. Eksp. Teor. Fiz 34, 118 (1972), doi:10.1007/BF01075696.
  18. [18]R. Hirota, Exact envelope-soliton solutions of a nonlinear wave equation, Journal of Mathematical Physics 14(7), 805 (1973), doi:10.1063/1.1666399.DOI
  19. [19]V. B. Matveev and M. A. Salle, Darboux Transformations and Solitons, Springer-Verlag, Heidelberg, ISBN 3-540-50660-8 (1991).DOI
  20. [20]D. J. Kedziora, A. Ankiewicz and N. Akhmediev, Rogue waves and solitons on a cnoidal background, European Physical Journal: Special Topics 223, 43 (2014), doi:10.1140/epjst/e2014-02083-4.DOI
  21. [21]N. N. Akhmediev, V. M. Eleonskii and N. E. Kulagin, Exact first-order solutions of the nonlinear schrödinger equation, Theoretical and Mathematical Physics 72, 809 (1987), doi:10.1007/BF01017105.DOI
  22. [22]E. A. Kuznetsov, Solitons in a parametrically unstable plasma, Akademiia Nauk SSSR Doklady 236, 575 (1977).
  23. [23]Y.-C. Ma, The perturbed plane-wave solutions of the cubic schrödinger equation, Studies in Applied Mathematics 60, 43 (1979), doi:10.1002/sapm197960143.DOI
  24. [24]D. H. Peregrine, Water waves, nonlinear schrödinger equations and their solutions, The ANZIAM Journal 25(1), 16 (1983), doi:10.1017/S0334270000003891.DOI
  25. [25]L. D. Faddeev and L. A. Takhtajan, Hamiltonian methods in the theory of solitons, Springer, Berlin; New York, ISBN 9783540698432 (softcover : alk. paper) (2007).
  26. [26]N. N. Akhmediev and A. Ankiewicz, Solitons Nonlinear Pulses and Beams, Chapman & Hall, London (1997).
  27. [27]R. M. Miura, Korteweg-de vries equation and generalizations. i. a remarkable explicit nonlinear transformation, Journal of Mathematical Physics 9(8), 1202 (1968), doi:10.1063/1.1664700.DOI
  28. [28]S. D. Nicola, Conservation laws for the non-linear schrödinger equation, Pure and Applied Optics: Journal of the European Optical Society Part A 2(1), 5 (1993), doi:10.1088/0963-9659/2/1/002.DOI
  29. [29]D. Donnelly and E. Rogers, Symplectic integrators: An introduction, American Journal of Physics 73(10), 938 (2005), doi:10.1119/1.2034523.DOI
  30. [30]S. A. Chin, Structure of numerical algorithms and advanced mechanics, American Journal of Physics 88(10), 883 (2020), doi:10.1119/10.0001616.DOI
  31. [31]H. Yoshida, Construction of higher order symplectic integrators, Physics Letters A 150, 262 (1990), doi:10.1016/0375-9601(90)90092-3.DOI
  32. [32]E. Forest and R. D. Ruth, Fourth-order symplectic integration, Physica D 43, 105 (1990), doi:10.1016/0167-2789(90)90001-L.DOI
  33. [33]M. Suzuki, Fractal decomposition of exponential operators with applications to many-body theories and monte carlo simulations, Physics Letters A 146(6), 319 (1990), doi:10.1016/0375-9601(90)90962-N.DOI
  34. [34]D. P. Landau, , K. K. Mon, and H.-B. Schuttler, eds., Higher-Order Decomposition Theory of Exponential Operators and Its Applications to QMC and Nonlinear Dynamics Computer Simulation Studies in Condensed-Matter Physics VI. Springer Berlin Heidelberg, Berlin, Heidelberg (1993).
  35. [35]M. Suzuki, Quantum monte carlo methods and general decomposition theory of exponential operators and symplectic integrators, Physica A: Statistical Mechanics and its Applications 205(1-3), 65 (1994), doi:10.1016/0378-4371(94)90491-X.DOI
  36. [36]R. I. McLachlan, On the numerical integration of ordinary differential equations by symmetric composition methods, SIAM Journal on Scientific Computing 16(1), 151 (1995).DOI
  37. [37]W. Kahan and R.-C. Li, Composition constants for raising the orders of unconventional schemes for ordinary differential equations, Mathematics of computation 66(219), 1089 (1997), doi:10.1090/S0025-5718-97-00873-9.DOI
  38. [38]S. A. Chin, Multi-product splitting and runge-kutta-nyström integrators, Celestial Mechanics and Dynamical Astronomy 106, 391 (2010), doi:10.1007/s10569-010-9255-9.DOI
  39. [39]E. Hairer, C. Lubich and G. Wanner, Geometric Numerical Integration, Springer Science & Business Media, ISBN 9783540306665 (2006).
  40. [40]M. Frigo and Johnson, The design and implementation of fftw3, Proceedings of the IEEE 3, 216 (2005).DOI
  41. [41]H. Gould, J. Tobochnik and W. Christian, An Introduction to Computer Simulation Methods, Addison-Wesley (2007).
  42. [42]S. A. Chin, O. A. Ashour, S. N. Nikolic and M. R. Belic, Maximal intensity higher-order akhmediev breathers of the nonlinear schrödinger equation and their systematic generation, Physics Letters A 380, 3625 (2016), doi:10.1016/j.physleta.2016.08.038.DOI
  43. [43]S. N. Nikolić, O. A. Ashour, N. B. Aleksić, Y. Zhang, M. R. Belić and S. A. Chin, Talbot carpets by rogue waves of extended nonlinear schrödinger equations, Nonlinear Dynamics 97(2), 1215 (2019), doi:10.1007/s11071-019-05042-1.DOI
  44. [44]O. A. Ashour, Maximal Intensity Higher-Order Breathers of the Nonlinear Schrödinger Equation on Different Backgrounds, Undergraduate Research Scholars Thesis, Texas A&M University (2017).
  45. [45]A. Ankiewicz, J. M. Soto-Crespo and N. Akhmediev, Rogue waves and rational solutions of the hirota equation, Physical Review E 81, 046602 (2010), doi:10.1103/PhysRevE.81.046602.DOI
  46. [46]Y. Tao and J. He, Multisolitons, breathers, and rogue waves for the hirota equation generated by the darboux transformation, Physical Review E 85(2) (2012), doi:10.1103/physreve.85.026601.DOI
  47. [47]L. H. Wang, K. Porsezian and J. S. He, Breather and rogue wave solutions of a generalized nonlinear schrödinger equation, Physical Review E 87(5) (2013), doi:10.1103/physreve.87.053202.DOI
  48. [48]A. Chowdury, D. J. Kedziora, A. Ankiewicz and N. Akhmediev, Breather-to-soliton conversions described by the quintic equation of the nonlinear schrodinger hierarchy, Physical Review E 91, 032928 (2015), doi:10.1103/PhysRevE.91.032928.DOI
  49. [49]A. Chowdury, D. J. Kedziora, A. Ankiewicz and N. Akhmediev, Breather solutions of the integrable quintic nonlinear schr??dinger equation and their interactions, Physical Review E 91, 022919 (2015), doi:10.1103/PhysRevE.91.022919.DOI
  50. [50]C. Gu, H. Hu, A. Hu and Z. Zhou, Darboux Transformations in Integrable Systems, Springer Science & Business Media, ISBN 9781402030871 (2004).DOI
  51. [51]P. D. Lax, Integrals of nonlinear equations of evolution and solitary waves, Communications on pure and applied mathematics 21(5), 467 (1968), doi:10.1002/cpa.3160210503.DOI
  52. [52]S. A. Chin, O. A. Ashour, S. N. Nikolic and M. R. Belic, Peak-height formula for higher-order breathers of the nonlinear schrodinger equation on non-uniform backgrounds, Physical Review E 95, 012211 (2017), doi:10.1103/PhysRevE.95.012211.DOI
  53. [53]W. A. Schwalm, Lectures on selected topics in mathematical physics: elliptic functions and elliptic integrals, Morgan & Claypool Publishers, ISBN 1681742306 (2015).DOI
  54. [54]O. A. Ashour, S. A. Chin, S. N. Nikolić and M. R. Belić, Higher-order breathers as quasi-rogue waves on a periodic background, arXiv p. 1810.02887v1 (2018).arxiv.org/abs/1810.02887
  55. [55]C. Tsitouras, Runge–kutta pairs of order 5(4) satisfying only the first column simplifying assumption, Computers & Mathematics with Applications 62(2), 770 (2011), doi:10.1016/j.camwa.2011.06.002.DOI
  56. [56]C. Rackauckas and Q. Nie, Differentialequations.jl–a performant and feature-rich ecosystem for solving differential equations in julia, Journal of Open Research Software 5(1) (2017), doi:10.5334/jors.151.DOI
  57. [57]J. Skowron and A. Gould, General complex polynomial root solver and its further optimization for binary microlenses, arXiv p. 1203.1034v1 (2012).arxiv.org/abs/1203.1034
  58. [58]A. A. Gelash and D. S. Agafontsev, Strongly interacting soliton gas and formation of rogue waves, Physical Review E 98(4) (2018), doi:10.1103/physreve.98.042210.DOI
  59. [59]G. Roberti, G. El, A. Tovbis, F. Copie, P. Suret and S. Randoux, Numerical spectral synthesis of breather gas for the focusing nonlinear schr´odinger equation, arXiv preprint arXiv:2101.05547 (2021).DOI

Paper details

vlnc:W_g4pbrexs
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents