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 \mathcal{K}_k(x; n,q) = \sum_{j=0}^{k}(-q)^j (q-1)^{k-j} \binom {n-j}{k-j} \binom{x}{j}. }

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

Semantic latex: \mathcal{K}_k(x; n,q) = \sum_{j=0}^{k}(-q)^j (q-1)^{k-j} \binom {n-j}{k-j} \binom{x}{j}

Confidence: 0

Mathematica

Translation: Subscript[K, k][x ; n , q] == Sum[(- q)^(j)*(q - 1)^(k - j)*Binomial[n - j,k - j]*Binomial[x,j], {j, 0, k}, GenerateConditions->None]

Information

Sub Equations

  • Subscript[K, k][x ; n , q] = Sum[(- q)^(j)*(q - 1)^(k - j)*Binomial[n - j,k - j]*Binomial[x,j], {j, 0, k}, GenerateConditions->None]

Free variables

  • k
  • n
  • q
  • x

Symbol info

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

SymPy

Translation: Symbol('{K}_{k}')(x ; n , q) == Sum((- q)**(j)*(q - 1)**(k - j)*binomial(n - j,k - j)*binomial(x,j), (j, 0, k))

Information

Sub Equations

  • Symbol('{K}_{k}')(x ; n , q) = Sum((- q)**(j)*(q - 1)**(k - j)*binomial(n - j,k - j)*binomial(x,j), (j, 0, k))

Free variables

  • k
  • n
  • q
  • x

Symbol info

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Maple

Translation: K[k](x ; n , q) = sum((- q)^(j)*(q - 1)^(k - j)*binomial(n - j,k - j)*binomial(x,j), j = 0..k)

Information

Sub Equations

  • K[k](x ; n , q) = sum((- q)^(j)*(q - 1)^(k - j)*binomial(n - j,k - j)*binomial(x,j), j = 0..k)

Free variables

  • k
  • n
  • q
  • x

Symbol info

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • following alternative expression
  • Kravchuk polynomial

Complete translation information:

{
  "id" : "FORMULA_6b7eb62a3e02e45fb1365dd2f07a5bbc",
  "formula" : "\\mathcal{K}_k(x; n,q) = \\sum_{j=0}^{k}(-q)^j (q-1)^{k-j} \\binom {n-j}{k-j} \\binom{x}{j}",
  "semanticFormula" : "\\mathcal{K}_k(x; n,q) = \\sum_{j=0}^{k}(-q)^j (q-1)^{k-j} \\binom {n-j}{k-j} \\binom{x}{j}",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "Subscript[K, k][x ; n , q] == Sum[(- q)^(j)*(q - 1)^(k - j)*Binomial[n - j,k - j]*Binomial[x,j], {j, 0, k}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "Subscript[K, k][x ; n , q] = Sum[(- q)^(j)*(q - 1)^(k - j)*Binomial[n - j,k - j]*Binomial[x,j], {j, 0, k}, GenerateConditions->None]" ],
        "freeVariables" : [ "k", "n", "q", "x" ],
        "tokenTranslations" : {
          "K" : "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" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "SymPy" : {
      "translation" : "Symbol('{K}_{k}')(x ; n , q) == Sum((- q)**(j)*(q - 1)**(k - j)*binomial(n - j,k - j)*binomial(x,j), (j, 0, k))",
      "translationInformation" : {
        "subEquations" : [ "Symbol('{K}_{k}')(x ; n , q) = Sum((- q)**(j)*(q - 1)**(k - j)*binomial(n - j,k - j)*binomial(x,j), (j, 0, k))" ],
        "freeVariables" : [ "k", "n", "q", "x" ],
        "tokenTranslations" : {
          "K" : "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" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "Maple" : {
      "translation" : "K[k](x ; n , q) = sum((- q)^(j)*(q - 1)^(k - j)*binomial(n - j,k - j)*binomial(x,j), j = 0..k)",
      "translationInformation" : {
        "subEquations" : [ "K[k](x ; n , q) = sum((- q)^(j)*(q - 1)^(k - j)*binomial(n - j,k - j)*binomial(x,j), j = 0..k)" ],
        "freeVariables" : [ "k", "n", "q", "x" ],
        "tokenTranslations" : {
          "K" : "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" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    }
  },
  "positions" : [ {
    "section" : 2,
    "sentence" : 0,
    "word" : 9
  } ],
  "includes" : [ "q", "n" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "following alternative expression",
    "score" : 0.7125985104912714
  }, {
    "definition" : "Kravchuk polynomial",
    "score" : 0.6460746792928004
  } ]
}

Specify your own input