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 \begin{pmatrix} j_1 & j_2 & j_3\\ m_1 & m_2 & m_3 \end{pmatrix} = \begin{pmatrix} j_2 & j_3 & j_1\\ m_2 & m_3 & m_1 \end{pmatrix} = \begin{pmatrix} j_3 & j_1 & j_2\\ m_3 & m_1 & m_2 \end{pmatrix}. }

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

Semantic latex: \Wignerthreejsym{j_1}{j_2}{j_3}{m_1}{m_2}{m_3} = \Wignerthreejsym{j_2}{j_3}{j_1}{m_2}{m_3}{m_1} = \Wignerthreejsym{j_3}{j_1}{j_2}{m_3}{m_1}{m_2}

Confidence: 0.66574040393935

Mathematica

Translation: ThreeJSymbol[{Subscript[j, 1], Subscript[m, 1]}, {Subscript[j, 2], Subscript[m, 2]}, {Subscript[m, 1], Subscript[m, 3]}] == ThreeJSymbol[{Subscript[j, 2], Subscript[m, 2]}, {Subscript[j, 3], Subscript[m, 3]}, {Subscript[m, 2], Subscript[m, 1]}] == ThreeJSymbol[{Subscript[j, 3], Subscript[m, 3]}, {Subscript[j, 1], Subscript[m, 1]}, {Subscript[m, 3], Subscript[m, 2]}]

Information

Sub Equations

  • ThreeJSymbol[{Subscript[j, 1], Subscript[m, 1]}, {Subscript[j, 2], Subscript[m, 2]}, {Subscript[m, 1], Subscript[m, 3]}] = ThreeJSymbol[{Subscript[j, 2], Subscript[m, 2]}, {Subscript[j, 3], Subscript[m, 3]}, {Subscript[m, 2], Subscript[m, 1]}]
  • ThreeJSymbol[{Subscript[j, 2], Subscript[m, 2]}, {Subscript[j, 3], Subscript[m, 3]}, {Subscript[m, 2], Subscript[m, 1]}] = ThreeJSymbol[{Subscript[j, 3], Subscript[m, 3]}, {Subscript[j, 1], Subscript[m, 1]}, {Subscript[m, 3], Subscript[m, 2]}]

Free variables

  • Subscript[j, 1]
  • Subscript[j, 2]
  • Subscript[j, 3]
  • Subscript[m, 1]
  • Subscript[m, 2]
  • Subscript[m, 3]

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

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_ac35c3efbad138eb4844417fa385c7aa",
  "formula" : "\\begin{pmatrix}\n  j_1 & j_2 & j_3\\\\\n  m_1 & m_2 & m_3\n\\end{pmatrix}\n=\n\\begin{pmatrix}\n  j_2 & j_3 & j_1\\\\\n  m_2 & m_3 & m_1\n\\end{pmatrix}\n=\n\\begin{pmatrix}\n  j_3 & j_1 & j_2\\\\\n  m_3 & m_1 & m_2\n\\end{pmatrix}",
  "semanticFormula" : "\\Wignerthreejsym{j_1}{j_2}{j_3}{m_1}{m_2}{m_3} = \\Wignerthreejsym{j_2}{j_3}{j_1}{m_2}{m_3}{m_1} = \\Wignerthreejsym{j_3}{j_1}{j_2}{m_3}{m_1}{m_2}",
  "confidence" : 0.6657404039393544,
  "translations" : {
    "Mathematica" : {
      "translation" : "ThreeJSymbol[{Subscript[j, 1], Subscript[m, 1]}, {Subscript[j, 2], Subscript[m, 2]}, {Subscript[m, 1], Subscript[m, 3]}] == ThreeJSymbol[{Subscript[j, 2], Subscript[m, 2]}, {Subscript[j, 3], Subscript[m, 3]}, {Subscript[m, 2], Subscript[m, 1]}] == ThreeJSymbol[{Subscript[j, 3], Subscript[m, 3]}, {Subscript[j, 1], Subscript[m, 1]}, {Subscript[m, 3], Subscript[m, 2]}]",
      "translationInformation" : {
        "subEquations" : [ "ThreeJSymbol[{Subscript[j, 1], Subscript[m, 1]}, {Subscript[j, 2], Subscript[m, 2]}, {Subscript[m, 1], Subscript[m, 3]}] = ThreeJSymbol[{Subscript[j, 2], Subscript[m, 2]}, {Subscript[j, 3], Subscript[m, 3]}, {Subscript[m, 2], Subscript[m, 1]}]", "ThreeJSymbol[{Subscript[j, 2], Subscript[m, 2]}, {Subscript[j, 3], Subscript[m, 3]}, {Subscript[m, 2], Subscript[m, 1]}] = ThreeJSymbol[{Subscript[j, 3], Subscript[m, 3]}, {Subscript[j, 1], Subscript[m, 1]}, {Subscript[m, 3], Subscript[m, 2]}]" ],
        "freeVariables" : [ "Subscript[j, 1]", "Subscript[j, 2]", "Subscript[j, 3]", "Subscript[m, 1]", "Subscript[m, 2]", "Subscript[m, 3]" ],
        "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"
        }
      },
      "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" : [ "j_{2}", "j_{3}", "j_{1}", "m_{3}", "\\begin{pmatrix}  j_1 & j_2 & j_3\\\\  m_1 & m_2 & m_3\\end{pmatrix}=\\begin{pmatrix}  j_2 & j_3 & j_1\\\\  m_2 & m_3 & m_1\\end{pmatrix}=\\begin{pmatrix}  j_3 & j_1 & j_2\\\\  m_3 & m_1 & m_2\\end{pmatrix}", "j", "m_{2}", "m_{1}", "m" ],
  "isPartOf" : [ "\\begin{pmatrix}  j_1 & j_2 & j_3\\\\  m_1 & m_2 & m_3\\end{pmatrix}=\\begin{pmatrix}  j_2 & j_3 & j_1\\\\  m_2 & m_3 & m_1\\end{pmatrix}=\\begin{pmatrix}  j_3 & j_1 & j_2\\\\  m_3 & m_1 & m_2\\end{pmatrix}" ],
  "definiens" : [ ]
}

Specify your own input