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 \displaystyle L_n^{(\alpha)}(x;q) = \frac{(q^{\alpha+1};q)_n}{(q;q)_n} {}_1\phi_1(q^{-n};q^{\alpha+1};q,-q^{n+\alpha+1}x) }

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

Semantic latex: L_n^{(\alpha)}(x ; q) = \frac{\qmultiPochhammersym{q^{\alpha+1}}{q}{n}}{\qmultiPochhammersym{q}{q}{n}} \qgenhyperphi{1}{1}@{q^{-n}}{q^{\alpha+1}}{q}{- q^{n+\alpha+1} x}

Confidence: 0.53716562906851

Mathematica

Translation: (Subscript[L, n])^(\[Alpha])[x ; q] == Divide[Product[QPochhammer[Part[{(q)^(\[Alpha]+ 1)},i],q,n],{i,1,Length[{(q)^(\[Alpha]+ 1)}]}],Product[QPochhammer[Part[{q},i],q,n],{i,1,Length[{q}]}]]*QHypergeometricPFQ[{(q)^(- n)},{(q)^(\[Alpha]+ 1)},q,- (q)^(n + \[Alpha]+ 1)* x]

Information

Sub Equations

  • (Subscript[L, n])^(\[Alpha])[x ; q] = Divide[Product[QPochhammer[Part[{(q)^(\[Alpha]+ 1)},i],q,n],{i,1,Length[{(q)^(\[Alpha]+ 1)}]}],Product[QPochhammer[Part[{q},i],q,n],{i,1,Length[{q}]}]]*QHypergeometricPFQ[{(q)^(- n)},{(q)^(\[Alpha]+ 1)},q,- (q)^(n + \[Alpha]+ 1)* x]

Free variables

  • \[Alpha]
  • n
  • q
  • x

Symbol info

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Could be the second Feigenbaum constant.

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

  • basic hypergeometric (or $q$-hypergeometric) function; Example: \qgenhyperphi{r}{s}@@@{a_1,...,a_r}{b_1,...,b_s}{q}{z}

Will be translated to: QHypergeometricPFQ[{$2},{$3},$4,$5] Relevant links to definitions: DLMF: http://dlmf.nist.gov/17.4#E1 Mathematica: https://reference.wolfram.com/language/ref/QHypergeometricPFQ.html

  • q-Multi-Pochhammer symbol; Example: \qmultiPochhammersym{a_1,\ldots,a_n}{q}{n}

Will be translated to: Alternative translations: [Product[QPochhammer[Part[{$0},i],$1,$2],{i,1,Length[{$0}]}]]Relevant links to definitions: DLMF: http://dlmf.nist.gov/17.2.E5 Mathematica:

Tests

Symbolic
Numeric

SymPy

Translation:

Information

Symbol info

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

Tests

Symbolic
Numeric

Maple

Translation:

Information

Symbol info

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

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_120b78b7ef96f38580a9f1e45e7764aa",
  "formula" : "L_n^{(\\alpha)}(x;q) = \\frac{(q^{\\alpha+1};q)_n}{(q;q)_n} {}_1\\phi_1(q^{-n};q^{\\alpha+1};q,-q^{n+\\alpha+1}x)",
  "semanticFormula" : "L_n^{(\\alpha)}(x ; q) = \\frac{\\qmultiPochhammersym{q^{\\alpha+1}}{q}{n}}{\\qmultiPochhammersym{q}{q}{n}} \\qgenhyperphi{1}{1}@{q^{-n}}{q^{\\alpha+1}}{q}{- q^{n+\\alpha+1} x}",
  "confidence" : 0.5371656290685125,
  "translations" : {
    "Mathematica" : {
      "translation" : "(Subscript[L, n])^(\\[Alpha])[x ; q] == Divide[Product[QPochhammer[Part[{(q)^(\\[Alpha]+ 1)},i],q,n],{i,1,Length[{(q)^(\\[Alpha]+ 1)}]}],Product[QPochhammer[Part[{q},i],q,n],{i,1,Length[{q}]}]]*QHypergeometricPFQ[{(q)^(- n)},{(q)^(\\[Alpha]+ 1)},q,- (q)^(n + \\[Alpha]+ 1)* x]",
      "translationInformation" : {
        "subEquations" : [ "(Subscript[L, n])^(\\[Alpha])[x ; q] = Divide[Product[QPochhammer[Part[{(q)^(\\[Alpha]+ 1)},i],q,n],{i,1,Length[{(q)^(\\[Alpha]+ 1)}]}],Product[QPochhammer[Part[{q},i],q,n],{i,1,Length[{q}]}]]*QHypergeometricPFQ[{(q)^(- n)},{(q)^(\\[Alpha]+ 1)},q,- (q)^(n + \\[Alpha]+ 1)* x]" ],
        "freeVariables" : [ "\\[Alpha]", "n", "q", "x" ],
        "tokenTranslations" : {
          "L" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\alpha" : "Could be the second Feigenbaum constant.\nBut this system doesn't know how to translate it as a constant. It was translated as a general letter.\n",
          "\\qgenhyperphi" : "basic hypergeometric (or $q$-hypergeometric) function; Example: \\qgenhyperphi{r}{s}@@@{a_1,...,a_r}{b_1,...,b_s}{q}{z}\nWill be translated to: QHypergeometricPFQ[{$2},{$3},$4,$5]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/17.4#E1\nMathematica:  https://reference.wolfram.com/language/ref/QHypergeometricPFQ.html",
          "\\qmultiPochhammersym" : "q-Multi-Pochhammer symbol; Example: \\qmultiPochhammersym{a_1,\\ldots,a_n}{q}{n}\nWill be translated to: \nAlternative translations: [Product[QPochhammer[Part[{$0},i],$1,$2],{i,1,Length[{$0}]}]]Relevant links to definitions:\nDLMF:         http://dlmf.nist.gov/17.2.E5\nMathematica:  "
        }
      },
      "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: \\qmultiPochhammersym [\\qmultiPochhammersym]"
        }
      },
      "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: \\qmultiPochhammersym [\\qmultiPochhammersym]"
        }
      },
      "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" : [ "q", "\\displaystyle  L_n^{(\\alpha)}(x;q) = \\frac{(q^{\\alpha+1};q)_n}{(q;q)_n} {}_1\\phi_1(q^{-n};q^{\\alpha+1};q,-q^{n+\\alpha+1}x)", "P_{n}^{(\\alpha)}(x;q)" ],
  "isPartOf" : [ "\\displaystyle  L_n^{(\\alpha)}(x;q) = \\frac{(q^{\\alpha+1};q)_n}{(q;q)_n} {}_1\\phi_1(q^{-n};q^{\\alpha+1};q,-q^{n+\\alpha+1}x)" ],
  "definiens" : [ ]
}

Specify your own input