LaTeX to CAS translator

Jump to navigation Jump to search

This mockup demonstrates the concept of TeX to Computer Algebra System (CAS) conversion.

The demo-application converts LaTeX functions which directly translate to CAS counterparts.

Functions without explicit CAS support are available for translation via a DRMF package (under development).

The following LaTeX input ...

{\displaystyle \sum_m (-1)^{j - m} \begin{pmatrix} j & j & J \\ m & -m & 0 \end{pmatrix} = \sqrt{2 j + 1} \, \delta_{J, 0}. }

... is translated to the CAS output ...

Semantic latex: \sum_m(- 1)^{j - m} \Wignerthreejsym{j}{j}{J}{m}{-m}{0} = \sqrt{2 j + 1} \delta_{J, 0}

Confidence: 0.7295905487765

Mathematica

Translation: Sum[(- 1)^(j - m)* ThreeJSymbol[{j, m}, {j, - m}, {m, 0}], {m, - Infinity, Infinity}, GenerateConditions->None] == Sqrt[2*j + 1]*Subscript[\[Delta], J , 0]

Information

Sub Equations

  • Sum[(- 1)^(j - m)* ThreeJSymbol[{j, m}, {j, - m}, {m, 0}], {m, - Infinity, Infinity}, GenerateConditions->None] = Sqrt[2*j + 1]*Subscript[\[Delta], J , 0]

Free variables

  • J
  • Subscript[\[Delta], J , 0]
  • j

Symbol info

  • 3j symbol; Example: \Wignerthreejsym@@{j_1}{j_2}{j_3}{m_1}{m_2}{m_3}

Will be translated to: ThreeJSymbol[{$0, $3}, {$1, $4}, {$3, $5}] Relevant links to definitions: DLMF: http://dlmf.nist.gov/34.2#E4 Mathematica: https://reference.wolfram.com/language/ref/ThreeJSymbol.html

  • Could be the first Feigenbaum constant.

But this system doesn't know how to translate it as a constant. It was translated as a general letter.

Tests

Symbolic
Numeric

SymPy

Translation:

Information

Symbol info

  • (LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \Wignerthreejsym [\Wignerthreejsym]

Tests

Symbolic
Numeric

Maple

Translation:

Information

Symbol info

  • (LaTeX -> Maple) No translation possible for given token: Cannot extract information from feature set: \Wignerthreejsym [\Wignerthreejsym]

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_703108e67aed65deb0ded6f85028871e",
  "formula" : "\\sum_m (-1)^{j - m}\n\\begin{pmatrix}\n  j & j & J \\\\\n  m & -m & 0\n\\end{pmatrix} = \\sqrt{2 j + 1}  \\delta_{J, 0}",
  "semanticFormula" : "\\sum_m(- 1)^{j - m} \\Wignerthreejsym{j}{j}{J}{m}{-m}{0} = \\sqrt{2 j + 1} \\delta_{J, 0}",
  "confidence" : 0.729590548776502,
  "translations" : {
    "Mathematica" : {
      "translation" : "Sum[(- 1)^(j - m)* ThreeJSymbol[{j, m}, {j, - m}, {m, 0}], {m, - Infinity, Infinity}, GenerateConditions->None] == Sqrt[2*j + 1]*Subscript[\\[Delta], J , 0]",
      "translationInformation" : {
        "subEquations" : [ "Sum[(- 1)^(j - m)* ThreeJSymbol[{j, m}, {j, - m}, {m, 0}], {m, - Infinity, Infinity}, GenerateConditions->None] = Sqrt[2*j + 1]*Subscript[\\[Delta], J , 0]" ],
        "freeVariables" : [ "J", "Subscript[\\[Delta], J , 0]", "j" ],
        "tokenTranslations" : {
          "\\Wignerthreejsym" : "3j symbol; Example: \\Wignerthreejsym@@{j_1}{j_2}{j_3}{m_1}{m_2}{m_3}\nWill be translated to: ThreeJSymbol[{$0, $3}, {$1, $4}, {$3, $5}]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/34.2#E4\nMathematica:  https://reference.wolfram.com/language/ref/ThreeJSymbol.html",
          "\\delta" : "Could be the first Feigenbaum constant.\nBut this system doesn't know how to translate it as a constant. It was translated as a general letter.\n"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "SymPy" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \\Wignerthreejsym [\\Wignerthreejsym]"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "Maple" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> Maple) No translation possible for given token: Cannot extract information from feature set: \\Wignerthreejsym [\\Wignerthreejsym]"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    }
  },
  "positions" : [ ],
  "includes" : [ "\\sum_m (-1)^{j - m}\\begin{pmatrix}  j & j & J \\\\  m & -m & 0\\end{pmatrix} = \\sqrt{2 j + 1} \\, \\delta_{J, 0}", "j", "m" ],
  "isPartOf" : [ "\\sum_m (-1)^{j - m}\\begin{pmatrix}  j & j & J \\\\  m & -m & 0\\end{pmatrix} = \\sqrt{2 j + 1} \\, \\delta_{J, 0}" ],
  "definiens" : [ ]
}

Specify your own input