arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2111.05861gr-qcastro-ph.HEcs.SC
收藏

NRPyLaTeX:广义相对论计算机代数系统的LaTeX接口

NRPyLaTeX: A LaTeX interface to computer algebra systems for general relativity

Kenneth J. Sible, Zachariah B. Etienne

摘要:

虽然每个计算机代数系统(CAS)都有自己独特的语法来输入数学表达式,但LaTeX可能是最广泛的数学排版语言。NRPyLaTeX(NL)支持将与广义相对论和微分几何相关的复杂张量表达式(用爱因斯坦符号表示)直接输入SymPy CAS。由于SymPy还支持与Mathematica和Maple CAS兼容的输出,NL降低了在三种广泛使用的CAS中输入和操作张量表达式的学习曲线。然而,LaTeX是一种排版语言,因此并不是为了解决数学表达式中的歧义而设计的。为了解决这个问题,NL实现了一个方便的配置界面,例如,定义具有某些属性的变量。配置命令显示为LaTeX注释,因此整个NL工作流可以无缝地融入科学论文的LaTeX源代码,而不会干扰渲染的数学表达式。此外,NL采用NRPy+的用于索引符号的严格语法(例如,张量),这使得NL输出能够使用NRPy+直接转换为高度优化的C/C++代码内核。最后,NL具有强大且用户友好的错误处理功能,可以捕获常见的张量索引错误并报告未解决的歧义,进一步加快了LaTeX表达式到CAS中的输入和验证。

英文摘要:

While each computer algebra system (CAS) contains its own unique syntax for inputting mathematical expressions, LaTeX is perhaps the most widespread language for typesetting mathematics. NRPyLaTeX (NL) enables direct LaTeX input of complex tensorial expressions (written in Einstein notation) relevant to general relativity and differential geometry into the SymPy CAS. As SymPy also supports output compatible with the Mathematica and Maple CASs, NL lowers the learning curve for inputting and manipulating tensorial expressions in three widely used CASs. LaTeX however is a typesetting language, and as such is not designed to resolve ambiguities in mathematical expressions. To address this, NL implements a convenient configuration interface that, e.g., defines variables with certain attributes. Configuration commands appear as LaTeX comments, so that entire NL workflows can fit seamlessly into the LaTeX source code of scientific papers without interfering with the rendered mathematical expressions. Further, NL adopts NRPy+'s rigid syntax for indexed symbols (e.g., tensors), which enables NL output to be directly converted into highly optimized C/C++-code kernels using NRPy+. Finally NL has robust and user-friendly error-handling, which catches common tensor indexing errors and reports unresolved ambiguities, further expediting the input and validation of LaTeX expressions into a CAS.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑