Wolfram Translation Reference

LLM TL;DR
  • This page is the lookup reference for Wolfram xAct to XAct.jl translation
  • Use Wolfram Migration Guide for the workflow
  • Use Getting Started if you are learning the native APIs rather than migrating

This page lists the direct mappings used during migration from Wolfram xAct. It is a reference page: use it when you need lookup tables, not when you need a step-by-step migration procedure.

Rosetta stone: common operations

OperationWolfram (xAct)Julia (XAct.jl)Status
DefManifoldDefManifold[M, 4, {a,b}]def_manifold!(:M, 4, [:a, :b])✅ Verified
DefTensorDefTensor[T[-a,-b], M]def_tensor!(:T, ["-a", "-b"], :M)✅ Verified
DefMetricDefMetric[-1, g[-a,-b], CD]def_metric!(-1, "g[-a,-b]", :CD)✅ Verified
ToCanonicalToCanonical[expr]ToCanonical(expr)✅ Verified
ContractMetricContractMetric[expr]Contract(expr)✅ Verified
Simplify / SimplificationSimplification[expr]Simplify(expr)✅ Verified
RiemannSimplifyRiemannSimplify[expr, CD]RiemannSimplify(expr, :CD)✅ Verified
RiemannToPermRiemannToPerm[expr]RiemannToPerm(expr)✅ Verified
SortCovDsSortCovDs[expr]SortCovDs(expr)✅ Verified
CommuteCovDsCommuteCovDs[expr]CommuteCovDs(expr)✅ Verified
IBPIBP[expr, v]IBP(expr, :CD)✅ Verified
VarDVarD[field][CD]exprVarD(expr, :field, :CD)✅ Verified
PerturbationPerturbation[expr]Perturb(expr) or perturb_curvature(...) depending on context✅ Verified

Translator output formats

FormatFlagUse case
JSON--to jsonMachine-readable action dicts
Julia--to juliaREPL sessions and Julia scripts
TOML--to tomlsxAct verification test files
Python--to pythonPython adapter scripts

Supported definition translations

Wolfram inputJulia outputNotes
DefManifold[M, 4, {a,b}]def_manifold!(:M, 4, [:a, :b])
DefMetric[-1, g[-a,-b], CD]def_metric!(-1, "g[-a, -b]", :CD)Auto-creates curvature tensors
DefTensor[T[-a,-b], M]def_tensor!(:T, ["-a", "-b"], :M)
DefTensor[T[-a,-b], M, Symmetric[{-a,-b}]]def_tensor!(:T, ..., symmetry_str=...)Symmetry passed as keyword
DefBasis[e, M, {1,2,3,4}]def_basis!(:e, :M, [1,2,3,4])
DefChart[cart, M, {1,2,3,4}, {x,y,z,t}]def_chart!(:cart, :M, ..., [:x,:y,:z,:t])
DefPerturbation[pert, g]def_perturbation!(:pert, :g)

Supported computation translations

Wolfram inputJulia outputNotes
ToCanonical[expr]ToCanonical("expr")Butler-Portugal canonicalization
ContractMetric[expr]Contract("expr")Metric contraction
Simplify[expr]Simplify("expr")Iterative Contract + ToCanonical
CommuteCovDs[expr]CommuteCovDs("expr")Covariant derivative commutation
SortCovDs[expr]SortCovDs("expr")Canonical CovD ordering
Perturb[expr]perturb("expr", 1)Perturbation expansion
Perturbation[expr]perturb_curvature("expr", 1)Curvature perturbation
PerturbationOrder[expr]PerturbationOrder("expr")Query perturbation order
PerturbationAtOrder[expr, n]PerturbationAtOrder("expr", n)Extract specific order
VarD[field][expr]VarD("field", "expr")Euler-Lagrange variation
IBP[expr, v]IBP("expr", :v)Integration by parts
TotalDerivativeQ[expr]TotalDerivativeQ("expr")Total derivative check
CheckMetricConsistency[g]CheckMetricConsistency("g")Metric validation

Supported basis and component translations

Wolfram inputJulia outputNotes
SetBasisChange[...]SetBasisChange(...)Define basis transformation
ChangeBasis[expr, basis]ChangeBasis("expr", :basis)Change basis
ToBasis[basis][expr]ToBasis(:basis, "expr")Convert to basis
FromBasis[basis][expr]FromBasis(:basis, "expr")Convert from basis
SetComponents[...]SetComponents(...)Assign component values
GetComponents[...]GetComponents(...)Retrieve component values
TraceBasisDummy[expr]TraceBasisDummy("expr")Trace over basis indices

Naming and behavior differences

ConceptWolframJulia / translator
NamesBare symbols: M, TJulia symbols: :M, :T
Indices in API callsT[-a, -b]Strings such as "-a", "-b"
Session stateGlobal kernelGlobal registry; use reset_state!()
Side effectsOften implicit! suffix marks state mutation
ContractionContractMetricContract
Simplification namingSimplification in Wolfram materialUse Simplify in translated/native code
CovD orderingSortCovDsSortCovDs and CommuteCovDs both exist
Perturbation namingPerturbation[expr]Split across Perturb, perturb_curvature, and related APIs
Auto-created tensorsDefMetric creates curvature objectsdef_metric! does the same
Scoping constructsModule, Block, WithTranslate manually
LicensingMathematica licenseGPL-3.0 open source

When this reference is the wrong page

NeedBetter page
Step-by-step migration procedureWolfram Migration Guide
First working Julia or Python examplesGetting Started
Guided Julia practiceBasics tutorial
Typed expression detailsTyped Expressions (TExpr)