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

Confidence: 0.74275173447925

Mathematica

Translation: (Subscript[L, n])^(\[Alpha])[x ; q] == Divide[QPochhammer[(q)^(\[Alpha]+ 1), q, n],QPochhammer[q, q, n]]Subscript[, 1]*Subscript[\[Phi], 1][(q)^(- n); (q)^(\[Alpha]+ 1); q , - (q)^(n + \[Alpha]+ 1)* x]

Information

Sub Equations

  • (Subscript[L, n])^(\[Alpha])[x ; q] = Divide[QPochhammer[(q)^(\[Alpha]+ 1), q, n],QPochhammer[q, q, n]]Subscript[, 1]*Subscript[\[Phi], 1][(q)^(- n); (q)^(\[Alpha]+ 1); q , - (q)^(n + \[Alpha]+ 1)* x]

Free variables

  • Subscript[\[Phi], 1]
  • \[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.

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • q-Pochhammer symbol; Example: \qPochhammer{a}{q}{n}

Will be translated to: QPochhammer[$0, $1, $2] Relevant links to definitions: DLMF: http://dlmf.nist.gov/17.2#SS1.p1 Mathematica: https://reference.wolfram.com/language/ref/QPochhammer.html

Tests

Symbolic
Numeric

SymPy

Translation:

Information

Symbol info

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

Tests

Symbolic
Numeric

Maple

Translation: (L[n])^(alpha)(x ; q) = (QPochhammer((q)^(alpha + 1), q, n))/(QPochhammer(q, q, n))[1]*phi[1]((q)^(- n); (q)^(alpha + 1); q , - (q)^(n + alpha + 1)* x)

Information

Sub Equations

  • (L[n])^(alpha)(x ; q) = (QPochhammer((q)^(alpha + 1), q, n))/(QPochhammer(q, q, n))[1]*phi[1]((q)^(- n); (q)^(alpha + 1); q , - (q)^(n + alpha + 1)* x)

Free variables

  • alpha
  • n
  • phi[1]
  • 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.

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • q-Pochhammer symbol; Example: \qPochhammer{a}{q}{n}

Will be translated to: QPochhammer($0, $1, $2) Required Packages: [QDifferenceEquations,QPochhammer] Relevant links to definitions: DLMF: http://dlmf.nist.gov/17.2#SS1.p1 Maple: https://de.maplesoft.com/support/help/Maple/view.aspx?path=QDifferenceEquations/QPochhammer

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

  • Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle ^}
  • Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle +1}}}
  • Failed to parse (syntax error): {\displaystyle +1}}

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{\\qPochhammer{q^{\\alpha+1}}{q}{n}}{\\qPochhammer{q}{q}{n}}{}_1 \\phi_1(q^{-n} ; q^{\\alpha+1} ; q , - q^{n+\\alpha+1} x)",
  "confidence" : 0.7427517344792491,
  "translations" : {
    "Mathematica" : {
      "translation" : "(Subscript[L, n])^(\\[Alpha])[x ; q] == Divide[QPochhammer[(q)^(\\[Alpha]+ 1), q, n],QPochhammer[q, q, n]]Subscript[, 1]*Subscript[\\[Phi], 1][(q)^(- n); (q)^(\\[Alpha]+ 1); q , - (q)^(n + \\[Alpha]+ 1)* x]",
      "translationInformation" : {
        "subEquations" : [ "(Subscript[L, n])^(\\[Alpha])[x ; q] = Divide[QPochhammer[(q)^(\\[Alpha]+ 1), q, n],QPochhammer[q, q, n]]Subscript[, 1]*Subscript[\\[Phi], 1][(q)^(- n); (q)^(\\[Alpha]+ 1); q , - (q)^(n + \\[Alpha]+ 1)* x]" ],
        "freeVariables" : [ "Subscript[\\[Phi], 1]", "\\[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",
          "\\phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\qPochhammer" : "q-Pochhammer symbol; Example: \\qPochhammer{a}{q}{n}\nWill be translated to: QPochhammer[$0, $1, $2]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/17.2#SS1.p1\nMathematica:  https://reference.wolfram.com/language/ref/QPochhammer.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: \\qPochhammer [\\qPochhammer]"
        }
      },
      "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" : "(L[n])^(alpha)(x ; q) = (QPochhammer((q)^(alpha + 1), q, n))/(QPochhammer(q, q, n))[1]*phi[1]((q)^(- n); (q)^(alpha + 1); q , - (q)^(n + alpha + 1)* x)",
      "translationInformation" : {
        "subEquations" : [ "(L[n])^(alpha)(x ; q) = (QPochhammer((q)^(alpha + 1), q, n))/(QPochhammer(q, q, n))[1]*phi[1]((q)^(- n); (q)^(alpha + 1); q , - (q)^(n + alpha + 1)* x)" ],
        "freeVariables" : [ "alpha", "n", "phi[1]", "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",
          "\\phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\qPochhammer" : "q-Pochhammer symbol; Example: \\qPochhammer{a}{q}{n}\nWill be translated to: QPochhammer($0, $1, $2)\nRequired Packages: [QDifferenceEquations,QPochhammer]\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/17.2#SS1.p1\nMaple: https://de.maplesoft.com/support/help/Maple/view.aspx?path=QDifferenceEquations/QPochhammer"
        }
      },
      "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" : [ "^", "+1}}", "\\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)", "+1}", "+1" ],
  "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