Coefficient fields and numeric computations

Working with linear categories requires a coefficient field $k$, together with arithmetic and linear algebra over $k$. TensorCategories.jl supports two approaches: exact symbolic computation and numerical computation. The function base_ring(C) returns the coefficient parent used by a category C.

Exact symbolic computations

OSCAR provides several exact fields that commonly occur in tensor-category computations. For further coefficient fields, constructors, and conversion functions, see the Fields chapter of the OSCAR manual.

FieldOSCAR constructorDescription
$\mathbb Q$QQthe rational numbers
a number field $K/\mathbb Q$number_field(f, "a"), quadratic_field(d)a finite extension given by algebraic generators and relations
an embedded real number field $K\subset\mathbb R$embedded_number_field(f,r)a number field together with a chosen real embedding
$\mathbb Q^{\mathrm{ab}}$abelian_closure(QQ)the maximal abelian extension of $\mathbb Q$, containing all roots of unity
$\overline{\mathbb Q}$algebraic_closure(QQ)the field of algebraic numbers
$\mathbb F_p$GF(p)the prime field of characteristic $p$
$\mathbb F_{p^n}$GF(p,n)the finite field with $p^n$ elements
$\overline{\mathbb F}_p$algebraic_closure(GF(p))the algebraic closure of the prime field $\mathbb F_p$

Ordinary division of Julia integers produces a floating-point number. Use the OSCAR field QQ when an exact rational number and its mathematical parent field are required:

julia> a = QQ(1)/3;

julia> 3*a == 1
true

julia> parent(a) == QQ
true

A number field is a finite extension of $\mathbb Q$. OSCAR presents it by generators and polynomial relations. The following constructs $K=\mathbb Q(s)$ with $s^2=2$:

using TensorCategories, Oscar
K, s = quadratic_field(2)
@assert s^2 == 2
(K, minpoly(s))
(Real quadratic field defined by x^2 - 2, x^2 - 2)

The element $s$ is an exact algebraic element. The abstract field does not declare that it is the positive real square root of $2$. An embedding $\sigma\colon K\hookrightarrow\mathbb C$ specifies which complex root the generator represents. In this example there are two real embeddings, $\sigma_+(s)=\sqrt{2}$ and $\sigma_-(s)=-\sqrt{2}$, exchanged by the nontrivial element of $\operatorname{Gal}(K/\mathbb Q)$. Applying different embeddings to algebraic coefficients produces their Galois-conjugate realizations. When an ordered realization inside $\mathbb R$ is required, OSCAR records the chosen real embedding with embedded_number_field.

Computations are often more efficient over a small number field containing the required coefficients than over a large algebraic closure. Working over the smaller field also retains arithmetic information that disappears after choosing one complex realization. It can, however, prevent objects from decomposing into absolutely simple summands. The resulting questions of splitness and scalar extension are treated in Scalar extension and splitting.

The algebraic and abelian closures are exact fields rather than numerical approximations to $\mathbb C$:

julia> Qab, z = abelian_closure(QQ);

julia> Qbar = algebraic_closure(QQ);

julia> F25 = GF(5, 2);

julia> order(F25)
25

julia> Fbar = algebraic_closure(GF(5))
Algebraic closure of prime field of characteristic 5

Here $\mathbb Q^{\mathrm{ab}}$ is the union of the cyclotomic fields, whereas $\overline{\mathbb Q}$ contains every algebraic number. Algebraically closed coefficient fields remove division-algebra phenomena for finite-dimensional endomorphism algebras of simple objects, but they are not automatically the best computational choice. The positive-characteristic constructor currently takes a prime field GF(p) and represents $\overline{\mathbb F}_p$ as the union of its finite extensions.

Numerical computations

Arb is a library for arbitrary-precision ball arithmetic (Johansson, 2017). A real or complex ball records a midpoint together with an error radius, and arithmetic propagates these enclosures. The user chooses the working precision; a computation continues at that precision unless an algorithm explicitly increases it.

OSCAR exposes real and complex ball arithmetic through two pairs of constructors. The functions real_field() and complex_field() return RealField and ComplexField parents controlled by the global Balls precision. The names RR and CC are commonly assigned to these parents in examples. The constructors ArbField(p) and AcbField(p) instead store the working precision $p$ in the parent. TensorCategories.jl uses these explicit-precision parents for its main numerical workflows; in particular, numeric(E,p) produces a category over an AcbField.

These parents implement AbstractAlgebra's computational Field interface, but their elements are not exact symbolic scalars: a ball containing zero, for example, cannot be inverted. Accordingly, is_exact_type(elem_type(K)) is false for all four ball-field types, whereas it is true for an exact field such as QQ.

Unlike Float64, ball fields are not restricted to 53 binary digits and retain uncertainty as part of every scalar. They provide controlled numerical computation rather than point-valued floating-point arithmetic with untracked rounding error. In ArbField(p) and AcbField(p), the precision belongs to the field and hence to a category over that field. For reproducible category computations, prefer these explicit-precision parents.

Here is a scalar computation over a real ball field:

using Oscar
R = ArbField(128)
x = sqrt(R(2))
@assert contains_zero(x^2 - R(2))
precision(R)
128

These numerical coefficient parents can also be used directly by a supported category. For example, the usual coordinate model of vector spaces and its matrix operations work over a real ball field:

using TensorCategories, Oscar
R = ArbField(128)
C = vector_spaces(R)
X = VectorSpaceObject(C, 2)
A = matrix(R, [sqrt(R(2)) 0; 0 R(1)/3])
f = morphism(X, X, A)
g = f ∘ f
@assert base_ring(C) == R
(int_dim(X), contains_zero(matrix(g)[1,1] - R(2)))
(2, true)

This returns (2,true): the first diagonal entry of $g$ is a ball containing the exact value $2$.

Current numerical limitations

TensorCategories.jl and its OSCAR/Nemo backends do not yet provide every algorithm required by the numerical side of the package. Basic category models can often be constructed over a real or complex ball field, and specified objects and morphisms can be manipulated using the available matrix operations. This does not imply that every higher algorithm is implemented for that field type.

In particular, simple-object enumeration for group representations over ball fields is not currently implemented. Direct computation and skeletonization of Drinfeld centers over real ball fields also require further support for scalar extraction, numerical decomposition and linear dependence, and the recovery of fusion multiplicities. Extending these interfaces and algorithms is ongoing work.

Exact field types support algebraic equality and symbolic field operations. Inexact ball types support high-precision analytic and linear-algebra computations and retain an enclosure for every result. When exact source data are available, keep them and construct a numerical model for the required computation. The exact source records the algebraic object; the numerical model records one realization at one chosen working precision.

For a supported object E, numeric(E,p) requests a numerical realization at approximately $p$ bits. A conversion may use guard bits, so the precision of the resulting base field is authoritative. For coefficients in a number field, the conversion also requires a complex embedding. Increasing the precision cannot recover information already lost through decimal or low-precision input.

Structural equality == remains an equivalence relation. It is not replaced by ball overlap, because overlap is not transitive. Numerical algorithms instead use explicit tests such as overlaps(x,y) and contains_zero(x) where the mathematics asks whether two enclosures are compatible or whether a quantity may vanish.

Suppose that a ball $B$ contains an exact quantity $b$.

  • If $0\notin B$, then $b\ne0$.
  • Disjoint balls containing $b$ and $c$ prove $b\ne c$.
  • If $0\in B$, or if two balls overlap, this does not prove equality.

Thus a numerical calculation can give an exact mathematical conclusion. For example, a determinant ball excluding zero certifies nonvanishing. This does not turn every ball-valued calculation into symbolic algebra: its scalars are still enclosures rather than exact algebraic expressions.

Supported categorical predicates over a ball field use the corresponding numerical criterion at the field's working precision. They do not reject an input merely because it lacks an exact symbolic certificate. Unless a predicate explicitly documents a rigorous certificate, a successful result means that the defining equations hold to the chosen working precision. Ball arithmetic can nevertheless certify particular conclusions, such as nonvanishing or strict separation, when the computed enclosures imply them. The pages introducing each categorical structure state the equations tested by its predicate.

Continue with simple objects and finite-length categories.