Simple-idealized-1d-nlse: Pseudo-spectral solver for the 1D nonlinear Schrödinger equation
DOI:
https://doi.org/10.31349/RevMexFisE.23.020206Keywords:
Fourier pseudo-spectral method, Akhmediev breather, eighth-order dormand-prince integration, focusing cubic NLSE, modulation instability dynamicsAbstract
We present an open-source Python implementation of an idealized high-order pseudo-spectral solver for the one-dimensional nonlinear Schrödinger equation (NLSE). The solver combines Fourier spectral spatial discretization with an adaptive eighth-order Dormand-Prince time integration scheme to achieve machine-precision conservation of mass and near-perfect preservation of momentum and energy for smooth solutions. The implementation accurately reproduces fundamental NLSE phenomena including soliton collisions with analytically predicted phase shifts, Akhmediev breather dynamics, and the development of modulation instability from noisy initial conditions. Four canonical test cases validate the numerical scheme: single soliton propagation, two-soliton elastic collision, breather evolution, and noiseseeded modulation instability. The solver employs a 2/3 dealiasing rule with exponential filtering to prevent aliasing errors from the cubic nonlinearity. Statistical analysis using Shannon, Rényi, and Tsallis entropies quantifies the spatio-temporal complexity of solutions, while phase space representations reveal the underlying coherence structure. The implementation prioritizes code transparency and educational accessibility over computational performance, providing a valuable pedagogical tool for exploring nonlinear wave dynamics. Complete source code, documentation, and example configurations are freely available, enabling reproducible computational experiments across diverse physical contexts where the NLSE governs wave evolution, including nonlinear optics, Bose-Einstein condensates, and ocean surface waves.
Downloads
References
V. E. Zakharov, Stability of periodic waves of finite amplitude on the surface of a deep fluid, J. Appl. Mech. Tech. Phys. 9 (1968) 190, https://doi.org/10.1007/BF00913182
P. L. Kelley, Self-Focusing of Optical Beams, Phys. Rev. Lett. 15 (1965) 1005, https://doi.org/10.1103/PhysRevLett.15.1005
E. P. Gross, Structure of a quantized vortex in boson systems, Nuovo Cim. 20 (1961) 454, https://doi.org/10.1007/BF02731494
L. P. Pitaevskii, Vortex Lines in an Imperfect Bose Gas, Sov. Phys. JETP 13 (1961) 451, http://www.jetp.ras.ru/cgi-bin/dn/e_013_02_0451.pdf
V. E. Zakharov and A. B. Shabat, Exact Theory of Two-dimensional Self-focusing and One-dimensional Self-modulation of Wave in Nonlinear Media, Sov. Phys. JETP 34 (1972) 62, http://www.jetp.ras.ru/cgi-bin/dn/e_034_01_0062.pdf
M. J. Ablowitz and P. A. Clarkson, Solitons, Nonlinear Evolution Equations and Inverse Scattering (Cambridge University Press, Cambridge, 1991), https://doi.org/10.1017/CBO9780511623998
E. A. Kuznetsov, Solitons in a parametrically unstable plasma, Sov. Phys. Dokl. 22 (1977) 507, https://ui.adsabs.harvard.edu/abs/1977DoSSR.236..575K/abstract
Y. C. Ma, The Perturbed Plane-Wave Solutions of the Cubic Schrödinger Equation, Stud. Appl. Math. 60 (1979) 43, https://doi.org/10.1002/sapm197960143
N. Akhmediev and V. I. Korneev, Modulation instability and periodic solutions of the nonlinear Schrödinger equation, Theor. Math. Phys. 69 (1986) 1089, https://doi.org/10.1007/BF01037866
D. R. Solli, et al., Optical rogue waves, Nature 450 (2007) 1054, https://doi.org/10.1038/nature06402
T. B. Benjamin and J. E. Feir, The disintegration of wave trains on deep water. Part 1. Theory, J. Fluid Mech. 27 (1967) 417, https://doi.org/10.1017/S002211206700045X
C. Kharif and E. Pelinovsky, Physical mechanisms of the rogue wave phenomenon, Eur. J. Mech. B/Fluids 22 (2003) 603, https://doi.org/10.1016/j.euromechflu.2003.09.002
J. M. Dudley, et al., Instabilities, breathers and rogue waves in optics, Nat. Photon. 8 (2014) 755, https://doi.org/10.1038/nphoton.2014.220
C. Sulem and P.-L. Sulem, The Nonlinear Schrödinger Equation: Self-Focusing and Wave Collapse (Springer-Verlag, New York, 1999), https://doi.org/10.1007/b98958
M. Delfour, M. Fortin, and G. Payr, Finite-difference solutions of a nonlinear Schrödinger equation, J. Comput. Phys. 44 (1981) 277, https://doi.org/10.1016/0021-9991(81)90052-8
B. Fornberg, On a Fourier Method for the Integration of Hyperbolic Equations, SIAM J. Numer. Anal. 12 (1975) 509, https://doi.org/10.1137/0712040
F. D. Tappert and C. M. Varma, Asymptotic Theory of Self-Trapping of Heat Pulses in Solids, Phys. Rev. Lett. 25 (1970) 1108, https://doi.org/10.1103/PhysRevLett.25.1108
J. A. C. Weideman and B. M. Herbst, Split-Step Methods for the Solution of the Nonlinear Schrödinger Equation, SIAM J. Numer. Anal. 23 (1986) 485, https://doi.org/10.1137/0723033
S. M. Cox and P. C. Matthews, Exponential Time Differencing for Stiff Systems, J. Comput. Phys. 176 (2002) 430, https://doi.org/10.1006/jcph.2002.6995
A. K. Kassam and L. N. Trefethen, Fourth-Order Time-Stepping for Stiff PDEs, SIAM J. Sci. Comput. 26 (2005) 1214, https://doi.org/10.1137/S1064827502410633
R. Jordan and C. Josserand, Self-organization in nonlinear wave turbulence, Phys. Rev. E 61 (2000) 1527, https://doi.org/10.1103/PhysRevE.61.1527
G. P. Agrawal, Nonlinear Fiber Optics, 6th ed. (Academic Press, San Diego, 2019), https://doi.org/10.1016/C2018-0-01168-8
W. Bao, D. Jaksch, and P. A. Markowich, Numerical solution of the Gross-Pitaevskii equation for Bose-Einstein condensation, J. Comput. Phys. 187 (2003) 318, https://doi.org/10.1016/S0021-9991(03)00102-5
K. Dysthe, H. E. Krogstad, and P. Müller, Oceanic Rogue Waves, Annu. Rev. Fluid Mech. 40 (2008) 287, https://doi.org/10.1146/annurev.fluid.40.111406.102203
J. P. Boyd, Chebyshev and Fourier Spectral Methods, 2nd ed. (Dover Publications, New York, 2001).
L. N. Trefethen, Spectral Methods in MATLAB (SIAM, Philadelphia, 2000), https://doi.org/10.1137/1.9780898719598
S. Herho, et al., COMPARING SCIENTIFIC COMPUTING ENVIRONMENTS FOR SIMULATING 2D NON-BUOYANT FLUID PARCEL TRAJECTORY UNDER INERTIAL OSCILLATION: A PRELIMINARY EDUCATIONAL STUDY, Indones. Phys. Rev. 7 (2024) 451, https://doi.org/10.29303/ipr.v7i3.335
R. W. Boyd, Chapter 1 - The Nonlinear Optical Susceptibility, In R. W. Boyd, ed., Nonlinear Optics, 3rd ed., pp. 1–67 (Academic Press, Burlington, 2008), https://doi.org/10.1016/B978-0-12-369470-6.00001-0
C. C. Mei, M. Stiassnie, and D. K.-P. Yue, Theory and Applications of Ocean Surface Waves (World Scientific, Singapore, 2005), https://doi.org/10.1142/5566
M. J. Ablowitz and H. Segur, Solitons and the Inverse Scattering Transform (SIAM, Philadelphia, 1981), https://doi.org/10.1137/1.9781611970883
D. J. Benney and A. C. Newell, The Propagation of Nonlinear Wave Envelopes, J. Math. Phys. 46 (1967) 133, https://doi.org/10.1002/sapm1967461133
H. Hasimoto and H. Ono, Nonlinear Modulation of Gravity Waves, J. Phys. Soc. Jpn. 33 (1972) 805, https://doi.org/10.1143/JPSJ.33.805
H. C. Yuen and B. M. Lake, Nonlinear Dynamics of Deep-Water Gravity Waves, Adv. Appl. Mech. 22 (1982) 67, https://doi.org/10.1016/S0065-2156(08)70066-8
E. H. Lieb, R. Seiringer, and J. Yngvason, Bosons in a trap: A rigorous derivation of the Gross-Pitaevskii energy functional, Phys. Rev. A 61 (2000) 043602, https://doi.org/10.1103/PhysRevA.61.043602
L. Erdös, B. Schlein, and H. T. Yau, Rigorous Derivation of the Gross-Pitaevskii Equation, Phys. Rev. Lett. 98 (2007) 040404, https://doi.org/10.1103/PhysRevLett.98.040404
M. Olshanii, Atomic Scattering in the Presence of an External Confinement and a Gas of Impenetrable Bosons, Phys. Rev. Lett. 81 (1998) 938, https://doi.org/10.1103/PhysRevLett.81.938
M. Frigo and S. G. Johnson, FFTW: An adaptive software architecture for the FFT, Proc. ICASSP 3 (1998) 1381, https://doi.org/10.1109/ICASSP.1998.681704
D. Gottlieb and S. A. Orszag, Numerical Analysis of Spectral Methods: Theory and Applications, CBMS-NSF Regional Conference Series in Applied Mathematics 26 (1977), https://doi.org/10.1137/1.9781611970425
G. S. Patterson and S. A. Orszag, Spectral Calculations of Isotropic Turbulence: Efficient Removal of Aliasing Interactions, Phys. Fluids 14 (1971) 2538, https://doi.org/10.1063/1.1693365
S. A. Orszag, On the Elimination of Aliasing in Finite-Difference Schemes by Filtering High-Wavenumber Components, J. Atmos. Sci. 28 (1971) 1074, https://doi.org/10.1175/1520-0469(1971)028<1074:OTEOAI>2.0.CO;2
J. W. Cooley and J. W. Tukey, An algorithm for the machine calculation of complex Fourier series, Math. Comput. 19 (1965) 297, https://doi.org/10.1090/S0025-5718-1965-0178586-1
J. R. Dormand and P. J. Prince, A family of embedded Runge-Kutta formulae, J. Comput. Appl. Math. 6 (1980) 19, https://doi.org/10.1016/0771-050X(80)90013-3
P. J. Prince and J. R. Dormand, High order embedded Runge-Kutta formulae, J. Comput. Appl. Math. 7 (1981) 67, https://doi.org/10.1016/0771-050X(81)90010-3
E. Hairer, S. P. Nørsett, and G. Wanner, Solving Ordinary Differential Equations I: Nonstiff Problems, 2nd ed. (Springer-Verlag, Berlin, 1993), https://doi.org/10.1007/978-3-540-78862-1
C. Harris, et al., Array Programming with NumPy, Nature 585 (2020) 357, https://doi.org/10.1038/s41586-020-2649-2
S. Herho, et al., Reappraising double pendulum dynamics across multiple computational platforms, CLEI Electron. J. 28 (2025), https://doi.org/10.19153/cleiej.28.1.10
S. H. S. Herho and S. N. Kaban, Quantitative Performance Analysis of Spring-Mass-Damper Control Systems, Indones. J. Appl. Math. 5 (2025) 10, https://doi.org/10.35472/indojam.v5i1.2104
S. K. Lam, A. Pitrou, and S. Seibert, Numba: A LLVM-based Python JIT Compiler, In Proceedings of the Second Workshop on the LLVM Compiler Infrastructure in HPC (ACM, 2015) pp. 7:1–7:6, https://doi.org/10.1145/2833157.2833162
S. Herho, et al., Efficient 1D Heat Equation Solver: Leveraging Numba in Python, Eksakta : Berkala Ilmiah Bidang MIPA (2024), https://doi.org/10.24036/eksakta/vol25-iss02/487
J. P. Gordon, Interaction forces among solitons in optical fibers, Opt. Lett. 8 (1983) 596, https://doi.org/10.1364/OL.8.000596
P. Virtanen, et al., SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python, Nat. Methods 17 (2020) 261, https://doi.org/10.1038/s41592-019-0686-2
J. D. Hunter, Matplotlib: A 2D graphics environment, Comput. Sci. Eng. 9 (2007) 90, https://doi.org/10.1109/MCSE.2007.55
R. Rew and G. Davis, NetCDF: An interface for scientific data access, IEEE Comput. Graph. Appl. 10 (1990) 76, https://doi.org/10.1109/38.56302
C. E. Shannon, A mathematical theory of communication, Bell Syst. Tech. J. 27 (1948) 379, https://doi.org/10.1002/j.1538-7305.1948.tb01338.x
A. Rényi, On Measures of Entropy and Information, Proceedings of the Fourth Berkeley Symposium on Mathematical Statistics and Probability 1 (1961) 547, https://projecteuclid.org/ebook/Download?urlid=bsmsp/1200512181&isFullBook=false
C. Tsallis, Possible generalization of Boltzmann-Gibbs statistics, J. Stat. Phys. 52 (1988) 479, https://doi.org/10.1007/BF01016429
C. Bandt and B. Pompe, Permutation Entropy: A Natural Complexity Measure for Time Series, Phys. Rev. Lett. 88 (2002) 174102, https://doi.org/10.1103/PhysRevLett.88.174102
J. S. Richman and J. R. Moorman, Physiological time-series analysis using approximate entropy and sample entropy, Am. J. Physiol. Heart Circ. Physiol. 278 (2000) H2039, https://doi.org/10.1152/ajpheart.2000.278.6.H2039
R. López-Ruiz, H. L. Mancini, and X. Calbet, A statistical measure of complexity, Phys. Lett. A 209 (1995) 321, https://doi.org/10.1016/0375-9601(95)00867-5
C. Spearman, The Proof and Measurement of Association between Two Things, Am. J. Psychol. 15 (1904) 72, https://doi.org/10.2307/1412159
T. M. Cover and J. A. Thomas, Elements of Information Theory, 2nd ed. (John Wiley & Sons, Hoboken, NJ, 2006), https://doi.org/10.1002/047174882X
K. V. Mardia and P. E. Jupp, Directional Statistics (John Wiley & Sons, Chichester, 1999), https://doi.org/10.1002/9780470316979
B. P. Welford, Note on a Method for Calculating Corrected Sums of Squares and Products, Technometrics 4 (1962) 419, https://doi.org/10.1080/00401706.1962.10490022
J. S. Vitter, Random sampling with a reservoir, ACM Trans. Math. Software 11 (1985) 37, https://doi.org/10.1145/3147.3165
W. H. Kruskal and W. A. Wallis, Use of Ranks in One-Criterion Variance Analysis, J. Am. Stat. Assoc. 47 (1952) 583, https://doi.org/10.1080/01621459.1952.10483441
N. Cliff, Dominance statistics: Ordinal analyses to answer ordinal questions, Psychol. Bull. 114 (1993) 494, https://doi.org/10.1037/0033-2909.114.3.494
M. Rosenblatt, Remarks on Some Nonparametric Estimates of a Density Function, Ann. Math. Stat. 27 (1956) 832, https://doi.org/10.1214/aoms/1177728190
E. Parzen, On Estimation of a Probability Density Function and Mode, Ann. Math. Stat. 33 (1962) 1065, https://doi.org/10.1214/aoms/1177704472
D. W. Scott, On optimal and data-based histograms, Biometrika 66 (1979) 605, https://doi.org/10.1093/biomet/66.3.605
C. Canuto, et al., Spectral Methods: Fundamentals in Single Domains (Springer-Verlag, Berlin, 2006), https://doi.org/10.1007/978-3-540-30726-6
T. Y. Hou and R. Li, Computing nearly singular solutions using pseudo-spectral methods, J. Comput. Phys. 226 (2007) 379, https://doi.org/10.1016/j.jcp.2007.04.014
D. H. Peregrine, Water waves, nonlinear Schrödinger equations and their solutions, J. Aust. Math. Soc. B 25 (1983) 16, https://doi.org/10.1017/S0334270000003891
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 S. H. S. Herho, I. P. Anwar, F. Khadami, R. Suwarman, D. E. Irawan

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
Authors retain copyright and grant the Revista Mexicana de Física E right of first publication with the work simultaneously licensed under a CC BY-NC-ND 4.0 that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.