这是indexloc提供的服务,不要输入任何密码
Skip to content

Tensorium_tex is a symbolic parser that converts LaTeX mathematical notation into a structured AST, enabling automatic code generation for high-performance tensor algebra and general relativity backends (such as MLIR or C++).

License

Notifications You must be signed in to change notification settings

TensoriumCore/Tensorium_tex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tensorium_tex

Tensorium_tex is a symbolic parser and code generation tool designed to bridge LaTeX mathematical notation and tensor-based computation backends (such as MLIR or C++). The goal of this project is to provide a robust frontend that parses LaTeX expressions, builds a structured Abstract Syntax Tree (AST), and enables automatic code generation for high-performance tensor algebra and general relativity.

Features

  • LaTeX Parser: Converts LaTeX expressions (including tensor indices and subscripts/superscripts) into an internal AST representation.
  • AST Utilities: Tools for manipulating and analyzing the parsed abstract syntax tree.
  • Tensor Indexing Support: Support for complex tensor index manipulation (covariant, contravariant, partial derivatives, etc.).
  • Code Generation Ready: Backend-agnostic, with planned support for MLIR and C++ code generation.
  • Test Suite: Simple tests to validate parser and AST functionality.

Build Instructions

Requirements:

  • C++17 or newer compiler (tested with Clang and GCC)
  • CMake (recommended)
  • (Optional) MLIR/LLVM if targeting MLIR backend (future)

Build

mkdir build
cd build
cmake ..
make

Usage Example

Given a LaTeX file like:

$R_{\mu\nu} = R^{\lambda}_{\ \mu\lambda\nu}$

Tensorium_tex will parse the expression and build the corresponding AST, ready for further processing or code generation.

Project Goals

  • Robust LaTeX → AST pipeline for tensor and index-rich expressions
  • Symbolic manipulation and simplification
  • Code generation for MLIR and C++ (planned)
  • Extensible design for additional backends and transformations

Contribution

PRs, issues, and suggestions are welcome! Please use English for all code and documentation.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For questions or discussions, please open an issue on the GitHub repository or contact the maintainers. @at0m741

About

Tensorium_tex is a symbolic parser that converts LaTeX mathematical notation into a structured AST, enabling automatic code generation for high-performance tensor algebra and general relativity backends (such as MLIR or C++).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published