API Reference

This page details the public API for QRecoupling.jl. Internal evaluations are abstracted away to provide a clean, unified interface.

Core Recoupling Symbols

The master dispatchers for evaluating $3j$ and $6j$ symbols. The computational regime is dynamically routed based on the provided target: integer level $k$ (Turaev-Viro), parameter $q$ (complex analytic), or $q=1$ (classical Ponzano-Regge limit). Precision is controlled via the exact boolean flag.

QRecoupling.q6jFunction
q6j(j1, j2, j3, j4, j5, j6; k=nothing, q=nothing, exact::Bool=false, eager::Bool=false, T=Float64)

Returns the Quantum 6j-symbol.

  • If k and q are omitted, returns the abstract DCR object.
  • If k is provided, projects to the root of unity (Float64 by default, Cyclotomic if exact=true).
  • If q=1, computes the exact classical Ponzano-Regge limit.
  • If eager=true, bypasses DCR construction for raw speed (only valid for root of unity k).
source
QRecoupling.q3jFunction
q3j(j1, j2, j3, m1, m2, m3; k=nothing, q=nothing, exact::Bool=false, eager::Bool=false, T=Float64)

Returns the quantum Wigner 3j-symbol.

source

Other TQFT Tensors

Composite tensors and network invariants used in the construction of 3D TQFTs, spin foam models, and string-net models.

QRecoupling.qdimFunction
qdim(j; k=nothing, q=nothing, exact::Bool=false, T=Float64)

Quantum dimension [2j+1]_q.

source
QRecoupling.rmatrixFunction
rmatrix(j1, j2, j3; k=nothing, q=nothing, exact::Bool=false, T=ComplexF64)

Returns the R-matrix phase (braiding eigenvalue) for j1, j2 crossing into j3.

source
QRecoupling.fsymbolFunction
fsymbol(j1, j2, j3, j4, j5, j6; k=nothing, q=nothing, exact::Bool=false, T=Float64)

Unitary crossing matrix element: √([d3][d6]) * {6j}.

source
QRecoupling.gsymbolFunction
gsymbol(j1, j2, j3, j4, j5, j6; k=nothing, q=nothing, exact::Bool=false, T=Float64)

Tetrahedrally symmetric invariant: √(Π[di]) * {6j}.

source

Generic Series & Universal Evaluation

QRecoupling.jl separates algebraic construction from field evaluation. These functions allow you to construct custom $q$-hypergeometric series and project abstract Deferred Cyclotomic Representation (DCR) objects into concrete target fields.

QRecoupling.build_dcr!Function
build_dcr!(pref_func, base_func, ratio_func, z_min, z_max; kwargs...)

The master DCR compiler. Generates the full combinatorial skeleton of an arbitrary sequence by orchestrating closures over a highly optimized CycloBuffer.

Keyword Arguments:

  • extract_radical::Bool (default false): If true, searches the prefactor for perfect squares and separates them into the root and radical fields.
  • alternating_sign::Bool (default false): If true, automatically injects a (-1)^z term into the sequence (standard for recoupling invariants).
source
QRecoupling.build_dcrFunction
build_dcr(pref_func, base_func, ratio_func, z_min, z_max; kwargs...)

The master DCR compiler. Generates the full combinatorial skeleton of an arbitrary sequence.

source
QRecoupling.project_dcrFunction
project_dcr(dcr::DCR; k=nothing, q=nothing, exact::Bool=false, T::Type=Float64)

Universal evaluation API for a DCR.

  • Classical Limit: Pass q = 1.
  • Root of Unity (TQFT): Pass k (integer level).
  • Complex Analytic: Pass q (complex or real parameter).
  • Precision is controlled by exact (Float64 vs Rational/Cyclotomic).
source

Memory & Cache Management

When changing the topological level $k$ drastically, performing exact computations in cyclotomic fields, or benchmarking tight loops, it is recommended to clear these caches to free RAM.