Installation
TensND is registered in the Julia General registry.
julia> import Pkg; Pkg.add("TensND")or, from the Pkg REPL mode (]):
pkg> add TensNDOptional dependency
The orientation search of proj_tens and best_sym_tens — finding the transversely isotropic axis or the orthotropic frame when it is not known in advance — is provided by a package extension:
pkg> add NLoptLoading NLopt activates TensNDNLoptExt and enables the methods of proj_tens that take no axis or frame:
using TensND, NLopt
B, d, drel = proj_tens(:TI, A) # axis optimized
B, d, drel = proj_tens(:ORTHO, A) # frame optimizedWithout NLopt, everything else works, including projection onto a class with a given axis or frame and the optimize_angles = false path of best_sym_tens, which infers the orientation from the Kelvin–Mandel eigenstructure. See Projection.
Symbolic backends
SymPy and Symbolics are ordinary dependencies, so both symbolic element types are available without further installation. SymPy calls into Python through PyCall; if its build fails, the usual remedy is
ENV["PYTHON"] = ""
import Pkg; Pkg.build("PyCall")which installs a private Conda Python. See Symbolic and numeric for how the four scalar worlds — Float64, ForwardDiff.Dual, Sym and Num — relate.
Checking the installation
using TensND
Spherical = coorsys_spherical()
θ, ϕ, r = getcoords(Spherical)
𝐞ᶿ, 𝐞ᵠ, 𝐞ʳ = unitvec(Spherical)
@set_coorsys Spherical
DIV(𝐞ʳ) # 2/r
LAPLACE(1 / r) # 0If those two return 2/r and 0, the symbolic stack is working.
Citing
@misc{TensND.jl,
author = {Jean-François Barthélémy},
title = {TensND.jl: symbolic and numerical tensor calculations
in arbitrary coordinate systems},
url = {https://github.com/MicroPoroChemoMechanics/TensND.jl},
doi = {10.5281/zenodo.17985768},
year = {2026}
}CITATION.cff in the repository root carries the same metadata in a machine-readable form. Works cited by this documentation are collected on the References page.
Related packages
| Package | Role here |
|---|---|
| Tensors.jl | low-level storage for small tensors |
| OMEinsum.jl | the contraction engine |
| SymPy.jl | symbolic backend |
| Symbolics.jl | native Julia CAS backend |
| Rotations.jl | rotation representations |
| ForwardDiff.jl | automatic differentiation |
| NLopt.jl | optional, orientation search |