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 Y_{\ell, m}(\theta, \phi)}

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

Semantic latex: \sphharmonicY{\ell}{m}@{\theta}{\phi}

Confidence: 0.92732082802543

Mathematica

Translation: SphericalHarmonicY[\[ScriptL], m, \[Theta], \[Phi]]

Information

Sub Equations

  • SphericalHarmonicY[\[ScriptL], m, \[Theta], \[Phi]]

Free variables

  • \[Phi]
  • \[ScriptL]
  • \[Theta]
  • m

Symbol info

  • Spherical harmonics; Example: \sphharmonicY{l}{m}@{\theta}{\phi}

Will be translated to: SphericalHarmonicY[$0, $1, $2, $3] Relevant links to definitions: DLMF: http://dlmf.nist.gov/14.30#E1 Mathematica: https://reference.wolfram.com/language/ref/SphericalHarmonicY.html

  • was translated to: \[ScriptL]
  • Could be the golden ratio == golden mean == golden section == extreme and mean ratio == medial section == divine proportion == divine section == golden proportion == golden cut == golden number.

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

Tests

Symbolic
Numeric

SymPy

Translation:

Information

Symbol info

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

Tests

Symbolic
Numeric

Maple

Translation: SphericalY(ell, m, theta, phi)

Information

Sub Equations

  • SphericalY(ell, m, theta, phi)

Free variables

  • ell
  • m
  • phi
  • theta

Symbol info

  • Spherical harmonics; Example: \sphharmonicY{l}{m}@{\theta}{\phi}

Will be translated to: SphericalY($0, $1, $2, $3) Relevant links to definitions: DLMF: http://dlmf.nist.gov/14.30#E1 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=SphericalY

  • was translated to: ell
  • Could be the golden ratio == golden mean == golden section == extreme and mean ratio == medial section == divine proportion == divine section == golden proportion == golden cut == golden number.

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

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Description

  • spherical harmonic
  • function
  • identity
  • normalizing factor
  • quantity in the square root
  • solution
  • term
  • relation
  • Legendre function

Complete translation information:

{
  "id" : "FORMULA_93157dd7c297fd36ded248449857eac3",
  "formula" : "Y_{\\ell, m}(\\theta, \\phi)",
  "semanticFormula" : "\\sphharmonicY{\\ell}{m}@{\\theta}{\\phi}",
  "confidence" : 0.9273208280254316,
  "translations" : {
    "Mathematica" : {
      "translation" : "SphericalHarmonicY[\\[ScriptL], m, \\[Theta], \\[Phi]]",
      "translationInformation" : {
        "subEquations" : [ "SphericalHarmonicY[\\[ScriptL], m, \\[Theta], \\[Phi]]" ],
        "freeVariables" : [ "\\[Phi]", "\\[ScriptL]", "\\[Theta]", "m" ],
        "tokenTranslations" : {
          "\\sphharmonicY" : "Spherical harmonics; Example: \\sphharmonicY{l}{m}@{\\theta}{\\phi}\nWill be translated to: SphericalHarmonicY[$0, $1, $2, $3]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/14.30#E1\nMathematica:  https://reference.wolfram.com/language/ref/SphericalHarmonicY.html",
          "\\ell" : "was translated to: \\[ScriptL]",
          "\\phi" : "Could be the golden ratio == golden mean == golden section == extreme and mean ratio == medial section == divine proportion == divine section == golden proportion == golden cut == golden number.\nBut this system doesn't know how to translate it as a constant. It was translated as a general letter.\n"
        }
      },
      "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: \\sphharmonicY [\\sphharmonicY]"
        }
      },
      "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" : "SphericalY(ell, m, theta, phi)",
      "translationInformation" : {
        "subEquations" : [ "SphericalY(ell, m, theta, phi)" ],
        "freeVariables" : [ "ell", "m", "phi", "theta" ],
        "tokenTranslations" : {
          "\\sphharmonicY" : "Spherical harmonics; Example: \\sphharmonicY{l}{m}@{\\theta}{\\phi}\nWill be translated to: SphericalY($0, $1, $2, $3)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/14.30#E1\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=SphericalY",
          "\\ell" : "was translated to: ell",
          "\\phi" : "Could be the golden ratio == golden mean == golden section == extreme and mean ratio == medial section == divine proportion == divine section == golden proportion == golden cut == golden number.\nBut this system doesn't know how to translate it as a constant. It was translated as a general letter.\n"
        }
      },
      "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" : 12,
    "sentence" : 12,
    "word" : 2
  } ],
  "includes" : [ "m", "\\phi", "\\theta" ],
  "isPartOf" : [ "Y_{\\ell, m}(\\theta, \\phi) =  \\sqrt{\\frac{(2\\ell+1)(\\ell-m)!}{4\\pi(\\ell+m)!}}\\ P_\\ell^{m}(\\cos \\theta)\\ e^{im\\phi}\\qquad -\\ell \\le m \\le \\ell", "Y_{\\ell, m}^*(\\theta, \\phi) = (-1)^m Y_{\\ell, -m}(\\theta, \\phi)" ],
  "definiens" : [ {
    "definition" : "spherical harmonic",
    "score" : 0.8728715749853855
  }, {
    "definition" : "function",
    "score" : 0.722
  }, {
    "definition" : "identity",
    "score" : 0.6793245439387732
  }, {
    "definition" : "normalizing factor",
    "score" : 0.6687181434333315
  }, {
    "definition" : "quantity in the square root",
    "score" : 0.6288842031023242
  }, {
    "definition" : "solution",
    "score" : 0.6033992232315736
  }, {
    "definition" : "term",
    "score" : 0.6033992232315736
  }, {
    "definition" : "relation",
    "score" : 0.5561420434722057
  }, {
    "definition" : "Legendre function",
    "score" : 0.5074197820340112
  } ]
}

Specify your own input