diff options
| author | zitian-gao <zitian.gao@outlook.com> | 2025-05-27 16:45:31 +0800 |
|---|---|---|
| committer | zitian-gao <zitian.gao@outlook.com> | 2025-05-27 16:45:31 +0800 |
| commit | 7c792461c8e4e4f1f8734fed143630c74e76b27f (patch) | |
| tree | cf6341ff9f2727424751da7a11a3bea6c39015bb /Qwen2.5-Eval/evaluation/latex2sympy/sandbox/matrix.py | |
| parent | 16815c8c5ec263c4bd1a0af60030c1c0efa1421e (diff) | |
init eval
Diffstat (limited to 'Qwen2.5-Eval/evaluation/latex2sympy/sandbox/matrix.py')
| -rwxr-xr-x | Qwen2.5-Eval/evaluation/latex2sympy/sandbox/matrix.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Qwen2.5-Eval/evaluation/latex2sympy/sandbox/matrix.py b/Qwen2.5-Eval/evaluation/latex2sympy/sandbox/matrix.py new file mode 100755 index 0000000..9aed3c2 --- /dev/null +++ b/Qwen2.5-Eval/evaluation/latex2sympy/sandbox/matrix.py @@ -0,0 +1,46 @@ +from latex2sympy import process_sympy +from sympy import * +import sys +sys.path.append("..") + +theta = Symbol('theta', real=True) + +latex = "\\begin{matrix}1&2\\\\3&4\\end{matrix}" +math = process_sympy(latex) +print("latex: %s to math: %s" % (latex, math)) + +latex = "\\begin{matrix}1&2\\\\3&4\\\\5&6\\end{matrix}" +math = process_sympy(latex) +print("latex: %s to math: %s" % (latex, math)) + +latex = "\\begin{matrix}1&2&3\\\\4&5&6\\\\7&8&9\\end{matrix}" +math = process_sympy(latex) +print("latex: %s to math: %s" % (latex, math)) + +latex = "\\begin{matrix}x^1&x^2&x^3\\\\y^1&y^2&y^3\\\\z^1&z^2&z^3\\end{matrix}" +math = process_sympy(latex) +print("latex: %s to math: %s" % (latex, math)) + +latex = "\\begin{matrix}x\\\\y\\end{matrix}" +math = process_sympy(latex) +print("latex: %s to math: %s" % (latex, math)) + +latex = "2\\cdot\\begin{matrix}x\\\\y\\end{matrix}" +math = process_sympy(latex) +print("latex: %s to math: %s" % (latex, math)) + +latex = "2\\cdot\\begin{matrix}x\\\\y\\end{matrix} + \\begin{matrix}2\\\\3\\end{matrix}" +math = process_sympy(latex) +print("latex: %s to math: %s" % (latex, math)) + +latex = "-2\\begin{matrix}1&2\\\\3&4\\end{matrix}" +math = process_sympy(latex) +print("latex: %s to math: %s" % (latex, math)) + +latex = "2\\cdot\\theta\\begin{matrix}x\\\\y\\end{matrix} + \\begin{matrix}2\\\\3\\end{matrix}" +math = process_sympy(latex) +print("latex: %s to math: %s" % (latex, math)) + +latex = "\\theta\\begin{matrix}1\\\\3\\end{matrix} - \\begin{matrix}-1\\\\2\\end{matrix}" +math = process_sympy(latex) +print("latex: %s to math: %s" % (latex, math)) |
