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 \Phi(z,s,a)=z^{-a}\Gamma(1-s)\sum_{k=-\infty}^\infty [2k\pi i-\log(z)]^{s-1}e^{2k\pi ai} }

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

Semantic latex: \Phi(z , s , a) = z^{-a} \Gamma(1 - s) \sum_{k=-\infty}^\infty [2 k \cpi \iunit - \log(z)]^{s-1} \expe^{2 k \cpi a \iunit}

Confidence: 0

Mathematica

Translation: \[CapitalPhi][z , s , a] == (z)^(- a)* \[CapitalGamma]*(1 - s)*Sum[(2*k*Pi*I - Log[z])^(s - 1)* Exp[2*k*Pi*a*I], {k, - Infinity, Infinity}, GenerateConditions->None]

Information

Sub Equations

  • \[CapitalPhi][z , s , a] = (z)^(- a)* \[CapitalGamma]*(1 - s)*Sum[(2*k*Pi*I - Log[z])^(s - 1)* Exp[2*k*Pi*a*I], {k, - Infinity, Infinity}, GenerateConditions->None]

Free variables

  • \[CapitalGamma]
  • \[CapitalPhi]
  • a
  • s
  • z

Symbol info

  • Pi was translated to: Pi
  • Logarithm; Example: \log@@{z}

Will be translated to: Log[$0] Constraints: z != 0 Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E2 Mathematica: https://reference.wolfram.com/language/ref/Log.html

  • Recognizes e with power as the exponential function. It was translated as a function.
  • Imaginary unit was translated to: I
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic

Test expression: (\[CapitalPhi]*(z , s , a))-((z)^(- a)* \[CapitalGamma]*(1 - s)*Sum[(2*k*Pi*I - Log[z])^(s - 1)* Exp[2*k*Pi*a*I], {k, - Infinity, Infinity}, GenerateConditions->None])

ERROR:

{
    "result": "ERROR",
    "testTitle": "Simple",
    "testExpression": null,
    "resultExpression": null,
    "wasAborted": false,
    "conditionallySuccessful": false
}
Numeric

SymPy

Translation: Symbol('Phi')(z , s , a) == (z)**(- a)* Symbol('Gamma')*(1 - s)*Sum((2*k*pi*I - log(z))**(s - 1)* exp(2*k*pi*a*I), (k, - oo, oo))

Information

Sub Equations

  • Symbol('Phi')(z , s , a) = (z)**(- a)* Symbol('Gamma')*(1 - s)*Sum((2*k*pi*I - log(z))**(s - 1)* exp(2*k*pi*a*I), (k, - oo, oo))

Free variables

  • Symbol('Gamma')
  • Symbol('Phi')
  • a
  • s
  • z

Symbol info

  • Pi was translated to: pi
  • Logarithm; Example: \log@@{z}

Will be translated to: log($0) Constraints: z != 0 Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E2 SymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#log

  • Recognizes e with power as the exponential function. It was translated as a function.
  • Imaginary unit was translated to: I
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Maple

Translation: Phi(z , s , a) = (z)^(- a)* Gamma*(1 - s)*sum((2*k*Pi*I - log(z))^(s - 1)* exp(2*k*Pi*a*I), k = - infinity..infinity)

Information

Sub Equations

  • Phi(z , s , a) = (z)^(- a)* Gamma*(1 - s)*sum((2*k*Pi*I - log(z))^(s - 1)* exp(2*k*Pi*a*I), k = - infinity..infinity)

Free variables

  • Gamma
  • Phi
  • a
  • s
  • z

Symbol info

  • Pi was translated to: Pi
  • Logarithm; Example: \log@@{z}

Will be translated to: log($0) Constraints: z != 0 Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E2 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=log

  • Recognizes e with power as the exponential function. It was translated as a function.
  • Imaginary unit was translated to: I
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_e3f20db22a7bc9467a2e0a677af1892a",
  "formula" : "\\Phi(z,s,a)=z^{-a}\\Gamma(1-s)\\sum_{k=-\\infty}^\\infty\n[2k\\pi i-\\log(z)]^{s-1}e^{2k\\pi ai}",
  "semanticFormula" : "\\Phi(z , s , a) = z^{-a} \\Gamma(1 - s) \\sum_{k=-\\infty}^\\infty [2 k \\cpi \\iunit - \\log(z)]^{s-1} \\expe^{2 k \\cpi a \\iunit}",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "\\[CapitalPhi][z , s , a] == (z)^(- a)* \\[CapitalGamma]*(1 - s)*Sum[(2*k*Pi*I - Log[z])^(s - 1)* Exp[2*k*Pi*a*I], {k, - Infinity, Infinity}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "\\[CapitalPhi][z , s , a] = (z)^(- a)* \\[CapitalGamma]*(1 - s)*Sum[(2*k*Pi*I - Log[z])^(s - 1)* Exp[2*k*Pi*a*I], {k, - Infinity, Infinity}, GenerateConditions->None]" ],
        "freeVariables" : [ "\\[CapitalGamma]", "\\[CapitalPhi]", "a", "s", "z" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: Pi",
          "\\log" : "Logarithm; Example: \\log@@{z}\nWill be translated to: Log[$0]\nConstraints: z != 0\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/4.2#E2\nMathematica:  https://reference.wolfram.com/language/ref/Log.html",
          "\\expe" : "Recognizes e with power as the exponential function. It was translated as a function.",
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\Phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "ERROR",
        "numberOfTests" : 1,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 1,
        "crashed" : false,
        "testCalculationsGroup" : [ {
          "lhs" : "\\[CapitalPhi]*(z , s , a)",
          "rhs" : "(z)^(- a)* \\[CapitalGamma]*(1 - s)*Sum[(2*k*Pi*I - Log[z])^(s - 1)* Exp[2*k*Pi*a*I], {k, - Infinity, Infinity}, GenerateConditions->None]",
          "testExpression" : "(\\[CapitalPhi]*(z , s , a))-((z)^(- a)* \\[CapitalGamma]*(1 - s)*Sum[(2*k*Pi*I - Log[z])^(s - 1)* Exp[2*k*Pi*a*I], {k, - Infinity, Infinity}, GenerateConditions->None])",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "Symbol('Phi')(z , s , a) == (z)**(- a)* Symbol('Gamma')*(1 - s)*Sum((2*k*pi*I - log(z))**(s - 1)* exp(2*k*pi*a*I), (k, - oo, oo))",
      "translationInformation" : {
        "subEquations" : [ "Symbol('Phi')(z , s , a) = (z)**(- a)* Symbol('Gamma')*(1 - s)*Sum((2*k*pi*I - log(z))**(s - 1)* exp(2*k*pi*a*I), (k, - oo, oo))" ],
        "freeVariables" : [ "Symbol('Gamma')", "Symbol('Phi')", "a", "s", "z" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: pi",
          "\\log" : "Logarithm; Example: \\log@@{z}\nWill be translated to: log($0)\nConstraints: z != 0\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.2#E2\nSymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#log",
          "\\expe" : "Recognizes e with power as the exponential function. It was translated as a function.",
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\Phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
        }
      }
    },
    "Maple" : {
      "translation" : "Phi(z , s , a) = (z)^(- a)* Gamma*(1 - s)*sum((2*k*Pi*I - log(z))^(s - 1)* exp(2*k*Pi*a*I), k = - infinity..infinity)",
      "translationInformation" : {
        "subEquations" : [ "Phi(z , s , a) = (z)^(- a)* Gamma*(1 - s)*sum((2*k*Pi*I - log(z))^(s - 1)* exp(2*k*Pi*a*I), k = - infinity..infinity)" ],
        "freeVariables" : [ "Gamma", "Phi", "a", "s", "z" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: Pi",
          "\\log" : "Logarithm; Example: \\log@@{z}\nWill be translated to: log($0)\nConstraints: z != 0\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.2#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=log",
          "\\expe" : "Recognizes e with power as the exponential function. It was translated as a function.",
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\Phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
        }
      }
    }
  },
  "positions" : [ ],
  "includes" : [ "a", "\\Phi(z,s,a)", "z", "s", "\\Phi(z,s,a)=z^{-a}\\Gamma(1-s)\\sum_{k=-\\infty}^\\infty[2k\\pi i-\\log(z)]^{s-1}e^{2k\\pi ai}" ],
  "isPartOf" : [ "\\Phi(z,s,a)=z^{-a}\\Gamma(1-s)\\sum_{k=-\\infty}^\\infty[2k\\pi i-\\log(z)]^{s-1}e^{2k\\pi ai}" ],
  "definiens" : [ ]
}

Specify your own input