Symbolic and numerical analysis in general relativity with open source computer algebra systems

  • Tolga BirkandanEmail author
  • Ceren Güzelgün
  • Elif Şirin
  • Mustafa Can Uslu
Research Article


We study three computer algebra systems, namely SageMath (with SageManifolds package), Maxima (with ctensor package) and Python language (with GraviPy module), which allow tensor manipulation for general relativity calculations along with general algebraic calculations. We present a benchmark of these systems using simple examples. After the general analysis, we focus on the SageMath and SageManifolds system to derive, analyze and visualize the solutions of the massless Klein–Gordon equation and geodesic motion with Hamilton–Jacobi formalism. We compare our numerical result of the Klein–Gordon equation with the asymptotic form of the analytical solution to see that they agree.


Symbolic analysis Numerical analysis Wave equations Geodesic motion 



We would like to thank Profs. Neşe Özdemir, Durmuş Ali Demir and Éric Gourgoulhon for stimulating discussions. We also thank our anonymous referee for the constructive comments which helped us to improve the manuscript. This work is partially supported by TÜBİTAK, the Scientific and Technological Council of Turkey.


  1. 1.
    Heinicke, C., Hehl, F.W.: Computer algebra in gravity. In: Grabmeier, J., Kaltofen, E., Weispfennig V. (eds.) Computer Algebra Handbook. Springer, Berlin (2003). arXiv: gr-qc/0105094
  2. 2.
    Korolkova, A.V., Kulyabov, D.S., Sevastyanov, L.A.: Tensor computations in computer algebra systems. Program. Comput. Softw. 39(3), 135–142, (2013). arXiv:1402.6635 [cs.SC]
  3. 3.
    MacCallum, M.A.H.: Computer algebra in gravity research. Living Rev. Relat. 21, (1), 6 (2018)ADSCrossRefGoogle Scholar
  4. 4.
    Cohen, I., Frick, I., Åman, J.E.: Algebraic computing in general relativity. Fundam. Theor. Phys. 9, 139 (1984)MathSciNetGoogle Scholar
  5. 5.
    Birkandan, T.: A Newman–Penrose calculator for instanton metrics. Int. J. Mod. Phys. C 19, 1277 (2008). arXiv:0711.0613 [gr-qc]
  6. 6.
    SageMath, the Sage Mathematics Software System (Version 8.3), The Sage Developers (2018) Accessed 3 Oct 2018
  7. 7.
    Maxima, a Computer Algebra System (Version 18.02.0) (2018) Accessed 3 Oct 2018
  8. 8.
    Python Software Foundation, Python Language Reference, version 2.7 (2017) Accessed 3 Oct 2018
  9. 9.
    Peeters, K.: Introducing Cadabra: A Symbolic computer algebra system for field theory problems. arXiv:hep-th/0701238 [HEP-TH]
  10. 10.
    Poslavsky, S., Bolotin, D.: Redberry: a computer algebra system designed for tensor manipulation. J. Phys. Conf. Ser. 608(1), 012060 (2015)CrossRefGoogle Scholar
  11. 11.
    Vincent, F.H., Paumard, T., Gourgoulhon, E., Perrin, G.: GYOTO: a new general relativistic ray-tracing code. Class. Quant. Grav. 28, 225011 (2011). arXiv:1109.4769 [gr-qc]. Accessed 3 Oct 2018
  12. 12.
    Gourgoulhon, E., Bejger, M., Mancini, M.: Tensor calculus with open-source software: the SageManifolds project. J. Phys. Conf. Ser. 600(1), 012002 (2015). arXiv:1412.4765 [gr-qc]. Accessed 3 Oct 2018
  13. 13.
    Toth, V.: Tensor manipulation in GPL Maxima. arXiv:cs/0503073v2 [cs.SC]
  14. 14.
    GraviPy, Tensor Calculus Package for General Relativity (Version 0.1.0) (2014) Accessed 3 Oct 2018
  15. 15.
    Gourgoulhon E., Mancini, M.: Symbolic tensor calculus on manifolds: a SageMath implementation. In: Lectures at JNCF 2018, CIRM, Marseille (France), arXiv:1804.07346 [gr-qc]
  16. 16.
    Birkandan, T., Cvetič, M.: Conformal invariance and near-extreme rotating AdS black holes. Phys. Rev. D 84, 044018 (2011). arXiv:1106.4329 [hep-th]
  17. 17.
    Chandrasekhar, S.: The Mathematical Theory of Black Holes. Oxford University Press, New York (1992)zbMATHGoogle Scholar
  18. 18.
  19. 19.
    Birrell, N.D., Davies, P.C.: Quantum Fields in Curved Space. Cambridge University Press, Cambridge (1986)zbMATHGoogle Scholar
  20. 20.
    Vieira, H.S., Bezerra, V.B.: Confluent Heun functions and the physics of black holes: resonant frequencies, Hawking radiation and scattering of scalar waves. Ann. Phys. 373, 28 (2016). arXiv:1603.02233 [gr-qc]
  21. 21.
    Ronveaux, A. (ed.): Heun’s Differential Equation. Oxford University Press, Oxford (1995)zbMATHGoogle Scholar
  22. 22.
    Slavyanov, S.Y., Lay, W.: Special Functions: A Unified Theory Based on Singularities. Oxford University Press, Oxford (2000)zbMATHGoogle Scholar
  23. 23.
    Hortaçsu, M.: Heun functions and some of their applications in physics. Adv. High Energy Phys. 2018, 8621573 (2018). arXiv:1101.0471 [math-ph]
  24. 24.
    Birkandan, T., Hortaçsu, M.: Examples of Heun and Mathieu functions as solutions of wave equations in curved spaces. J. Phys. A 40, 1105 (2007) [J. Phys. A 40, 11203 (2007)]. arXiv:gr-qc/0607108
  25. 25.
    Birkandan, T., Hortaçsu, M.: Quantum field theory applications of Heun type functions. Rep. Math. Phys. 79, 81 (2017). arXiv:1605.07848 [hep-th]
  26. 26.
    Fiziev, P., Staicova, D.: Application of the confluent Heun functions for finding the quasinormal modes of nonrotating black holes. Phys. Rev. D 84, 127502 (2011). arXiv:1109.1532 [gr-qc]
  27. 27.
    Motygin, O.V.: On Numerical Evaluation of the Heun Functions. Proceedings on Days on Diffraction. p. 222 (2015). arXiv:1506.03848 [math.NA]. Accessed 3 Oct 2018
  28. 28.
    Motygin, O.V.: On Evaluation of the Confluent Heun Functions. arXiv:1804.01007 [math.NA]. Accessed 3 Oct 2018

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2018

Authors and Affiliations

  1. 1.Department of PhysicsIstanbul Technical UniversityIstanbulTurkey
  2. 2.Institute of informaticsIstanbul Technical UniversityIstanbulTurkey

Personalised recommendations