amangkurat
A Python library for symplectic pseudo-spectral solution of the idealized (1+1)D nonlinear Klein-Gordon equation
Abstract
This study introduces amangkurat, an open-source Python library designed for the robust numerical simulation of relativistic scalar field dynamics governed by the nonlinear Klein-Gordon equation in (1 + 1)D spacetime. The software implements a hybrid computational strategy that couples Fourier pseudo-spectral spatial discretization with a symplectic Størmer-Verlet temporal integrator, ensuring both exponential spatial convergence for smooth solutions and long-term preservation of Hamiltonian structure. To optimize performance, the solver incorporates adaptive timestepping based on Courant-Friedrichs-Lewy (CFL) stability criteria and utilizes Just-In-Time (JIT) compilation for parallelized force computation. The library’s capabilities are validated across four canonical physical regimes: dispersive linear wave propagation, static topological kink preservation in phi-fourth theory, integrable breather dynamics in the sine-Gordon model, and non-integrable kink-antikink collisions. Beyond standard numerical validation, this work establishes a multi-faceted analysis framework employing information-theoretic entropy metrics (Shannon, Rényi, and Tsallis), kernel density estimation, and phase space reconstruction to quantify the distinct phenomenological signatures of these regimes. Statistical hypothesis testing confirms that these scenarios represent statistically distinguishable dynamical populations. Benchmarks on standard workstation hardware demonstrate that the implementation achieves high computational efficiency, making it a viable platform for exploratory research and education in nonlinear field theory.
Downloads
References
J. K. Perring and T. H. R. Skyrme, "A model unified field equation," Nuclear Physics, vol. 31, pp. 550–555, 1962. https://doi.org/10.1016/0029-5582(62)90774-5
R. F. Dashen, B. Hasslacher, and A. Neveu, "Semiclassical bound states in an asymptotically free theory," Physical Review D, vol. 12, no. 8, pp. 2443–2458, 1975. https://doi.org/10.1103/PhysRevD.12.2443
Barone, F. Esposito, C. J. Magee, and A. C. Scott, "Theory and applications of the sine-Gordon equation," Rivista del Nuovo Cimento, vol. 1, pp. 227–267, 1971. https://doi.org/10.1007/BF02820622
R. Bishop, J. A. Krumhansl, and S. E. Trullinger, "Solitons in condensed matter: A paradigm," Physica D, vol. 1, no. 1, pp. 1–44, 1980. https://doi.org/10.1016/0167-2789(80)90003-2
N. S. Manton, "Geometry of Skyrmions," Communications in Mathematical Physics, vol. 111, pp. 469–478, 1987. https://doi.org/10.1007/BF01238909
Y. M. Shnir, Topological and Non-Topological Solitons in Scalar Field Theories. Cambridge, UK: Cambridge University Press, 2018. https://doi.org/10.1017/9781108555623
W. H. Zurek, "Cosmological experiments in superfluid helium?" Nature, vol. 317, pp. 505–508, 1985. A. F. Ranada and M. F. Ranada, "Klein-Gordon kinks with fourth order derivative self-coupling," Journal of Mathematical Physics, vol. 18, no. 12, pp. 2427–2431, 1985. https://doi.org/10.1038/317505a0
F. Ranada and M. F. Ranada, "Klein-Gordon kinks with fourth order derivative self-coupling," Journal of Mathematical Physics, vol. 18, no. 12, pp. 2427–2431, 1977. https://doi.org/10.1063/1.523231
D. K. Campbell, J. F. Schonfeld, and C. A. Wingate, "Resonance structure in kink-antikink interactions in ϕ⁴ theory," Physica D, vol. 9, no. 1–2, pp. 1–32, 1983. https://doi.org/10.1016/0167-2789(83)90289-0
P. Anninos, S. Oliveira, and R. A. Matzner, "Fractal structure in the scalar λ(ϕ²−1)² theory," Physical Review D, vol. 44, no. 4, pp. 1147–1160, 1991. https://doi.org/10.1103/PhysRevD.44.1147
R. H. Goodman and R. Haberman, "Kink-Antikink Collisions in the ϕ⁴ Equation: The n-Bounce Resonance and the Separatrix Map," SIAM Journal on Applied Dynamical Systems, vol. 4, no. 4, pp. 1195–1283, 2005. https://doi.org/10.1137/050632981
C. Scott, F. Y. F. Chu, and D. W. McLaughlin, "The soliton: A new concept in applied science," Proceedings of the IEEE, vol. 61, no. 10, pp. 1443–1483, 1973. https://doi.org/10.1109/PROC.1973.9296
R. Courant, K. Friedrichs, and H. Lewy, "Über die partiellen Differenzengleichungen der mathematischen Physik," Mathematische Annalen, vol. 100, pp. 32–74, 1928. https://doi.org/10.1007/BF01448839
Fornberg, A Practical Guide to Pseudospectral Methods. Cambridge, UK: Cambridge University Press, 2009. https://doi.org/10.1017/CBO9780511626357
L. N. Trefethen, Spectral Methods in MATLAB. Philadelphia, PA: SIAM, 2000. https://doi.org/10.1137/1.9780898719598
E. Hairer, C. Lubich, and G. Wanner, "Geometric numerical integration illustrated by the Størmer-Verlet method," Acta Numerica, vol. 12, pp. 399–450, 2003. https://doi.org/10.1017/S0962492902000144
H. Yoshida, "Construction of higher order symplectic integrators," Physics Letters A, vol. 150, no. 5–7, pp. 262–268, 1990. https://doi.org/10.1016/0375-9601(90)90092-3
Leimkuhler and S. Reich, Simulating Hamiltonian Dynamics. Cambridge, UK: Cambridge University Press, 2009. https://doi.org/10.1017/CBO9780511614118
R. Harris, K. J. Millman, S. J. Walt, et al., "Array programming with NumPy," Nature, vol. 585, pp. 357–362, 2020. https://doi.org/10.1038/s41586-020-2649-2
P. Virtanen, R. Gommers, T. E. Oliphant, et al., "SciPy 1.0: Fundamental algorithms for scientific computing in Python," Nature Methods, vol. 17, pp. 261–272, 2020. https://doi.org/10.1038/s41592-019-0686-2
R. Rew and G. Davis, "NetCDF: an interface for scientific data access," IEEE Computer Graphics and Applications, vol. 10, no. 4, pp. 76–82, 1990. https://doi.org/10.1109/38.56302
J. D. Hunter, "Matplotlib: A 2D graphics environment," Computing in Science & Engineering, vol. 9, no. 3, pp. 90–95, 2007. https://doi.org/10.1109/MCSE.2007.55
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, 2015, pp. 1–6. https://doi.org/10.1145/2833157.2833162
S. Herho, S. N. Kaban, D. E. Irawan, and R. Kapid, "Efficient 1D Heat Equation Solver: Leveraging Numba in Python," Eksakta: Berkala Ilmiah Bidang MIPA, vol. 25, no. 2, pp. 126–137, 2024. https://doi.org/10.24036/eksakta/vol25-iss02/487
S. H. S. Herho, I. P. Anwar, F. Khadami, R. Suwarman, and D. E. Irawan, "simple-idealized-1d-nlse: Pseudo-Spectral Solver for the 1D Nonlinear Schrödinger Equation," arXiv preprint arXiv:2509.05901, 2025. https://doi.org/10.48550/arXiv.2509.05901
S. H. S. Herho, N. J. Trilaksono, F. R. Fajary, G. Napitupulu, I. P. Anwar, F. Khadami, and D. E. Irawan, "kh2d-solver: A Python Library for Idealized Two-Dimensional Incompressible Kelvin-Helmholtz Instability," arXiv preprint arXiv:2509.16080, 2025. https://doi.org/10.48550/arXiv.2509.16080
V. E. Zakharov, P. Guyenne, A. N. Pushkarev, and F. Dias, "Wave turbulence in one-dimensional models," Physica D, vol. 152–153, pp. 573–619, 2001. https://doi.org/10.1016/S0167-2789(01)00194-4
T. Sugiyama, "Kink-Antikink Collisions in the Two-Dimensional ϕ⁴ Model," Progress of Theoretical Physics, vol. 61, no. 5, pp. 1550–1563, 1979. https://doi.org/10.1143/PTP.61.1550
M. Ram, Ed., Recent Advances in Mathematics for Engineering. Boca Raton, FL: CRC Press, 2020. https://doi.org/10.1201/9780429200304
M. B. Fogel, S. E. Trullinger, A. R. Bishop, and J. A. Krumhansl, "Dynamics of sine-Gordon solitons in the presence of perturbations," Physical Review B, vol. 15, pp. 1578–1592, 1977. https://doi.org/10.1103/PhysRevB.15.1578
Y. S. Kivshar and G. I. Stegeman, "Spatial Optical Solitons," Optics & Photonics News, vol. 13, no. 2, pp. 59–63, 2002. https://doi.org/10.1364/OPN.13.2.000059
M. Gleiser and A. Sornborger, "Long-lived localized field configurations in small lattices: Application to oscillons," Physical Review E, vol. 62, pp. 1368–1374, 2000. https://doi.org/10.1103/PhysRevE.62.1368
Y. S. Kivshar and B. A. Malomed, "Dynamics of solitons in nearly integrable systems," Reviews of Modern Physics, vol. 61, no. 4, pp. 763–915, 1989. https://doi.org/10.1103/RevModPhys.61.763
C. E. Shannon, "A mathematical theory of communication," Bell System Technical Journal, vol. 27, no. 3, pp. 379–423, 1948. https://doi.org/10.1002/j.1538-7305.1948.tb01338.x
Rényi, "On measures of entropy and information," in Proceedings of the Fourth Berkeley Symposium on Mathematical Statistics and Probability, vol. 1, Berkeley, CA, 1961, pp. 547–561. https://projecteuclid.org/ebooks/berkeley-symposium-on-mathematical-statistics-and-probability/On-Measures-of-Entropy-and-Information/chapter/On-Measures-of-Entropy-and-Information/bsmsp/1200512181
Tsallis, "Possible generalization of Boltzmann-Gibbs statistics," Journal of Statistical Physics, vol. 52, pp. 479–487, 1988. https://doi.org/10.1007/BF01016429
P. Borges, "A possible deformed algebra and calculus inspired in nonextensive thermostatistics," Physica A, vol. 340, no. 1–3, pp. 95–101, 2004. https://doi.org/10.1016/j.physa.2004.03.082
W. Silverman, Density Estimation for Statistics and Data Analysis. New York, NY: Routledge, 1998. https://doi.org/10.1007/978-1-4899-3324-9
W. H. Kruskal and W. A. Wallis, "Use of ranks in one-criterion variance analysis," Journal of the American Statistical Association, vol. 47, no. 260, pp. 583–621, 1952. https://doi.org/10.1080/01621459.1952.10483441
N. Cliff, "Dominance statistics: Ordinal analyses to answer ordinal questions," Psychological Bulletin, vol. 114, no. 3, pp. 494–509, 1993. https://doi.org/10.1037/0033-2909.114.3.494
J. Romano, J. Kromrey, J. Coraggio, J. Skowronek, and L. Devine, "Exploring methods for evaluating group differences on the NSSE and other surveys: Are the t-test and Cohen's d indices the most appropriate choices?" presented at Annual Meeting of the Southern Association for Institutional Research, Arlington, VA, 2006.
V. I. Arnold, Mathematical Methods of Classical Mechanics, 2nd ed. New York, NY: Springer, 1989. https://doi.org/10.1007/978-1-4757-2063-1
N. Manton and P. Sutcliffe, Topological Solitons. Cambridge, UK: Cambridge University Press, 2010. https://doi.org/10.1017/CBO9780511617034
Copyright (c) 2026 Indonesian Journal of Applied Mathematics

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.


