2021/11/10 by Kenneth J. Sible, Z. B. Etienne, Sible, Kenneth J. +1
Computer Science · #Distributed and Parallel Computing Systems #FOS: Computer and information sciences #FOS: Physical sciences #General Relativity and Quantum Cosmology (gr-qc) #High Energy Astrophysical Phenomena (astro-ph.HE) #Mathematics, Computing, and Information Processing #Parallel Computing and Optimization Techniques #Symbolic Computation (cs.SC)
paper · pdf · doi:10.48550/arxiv.2111.05861
openalex publication_date 2021/11/10 · openalex created_date 2022/07/25 · openalex updated_date 2026/07/28
While each computer algebra system (CAS) contains its own unique syntax for\ninputting mathematical expressions, LaTeX is perhaps the most widespread\nlanguage for typesetting mathematics. NRPyLaTeX (NL) enables direct LaTeX input\nof complex tensorial expressions (written in Einstein notation) relevant to\ngeneral relativity and differential geometry into the SymPy CAS. As SymPy also\nsupports output compatible with the Mathematica and Maple CASs, NL lowers the\nlearning curve for inputting and manipulating tensorial expressions in three\nwidely used CASs. LaTeX however is a typesetting language, and as such is not\ndesigned to resolve ambiguities in mathematical expressions. To address this,\nNL implements a convenient configuration interface that, e.g., defines\nvariables with certain attributes. Configuration commands appear as LaTeX\ncomments, so that entire NL workflows can fit seamlessly into the LaTeX source\ncode of scientific papers without interfering with the rendered mathematical\nexpressions. Further, NL adopts NRPy+'s rigid syntax for indexed symbols (e.g.,\ntensors), which enables NL output to be directly converted into highly\noptimized C/C++-code kernels using NRPy+. Finally NL has robust and\nuser-friendly error-handling, which catches common tensor indexing errors and\nreports unresolved ambiguities, further expediting the input and validation of\nLaTeX expressions into a CAS.\n