Conceptual Guides¶
This section gives feature-area introductions to the mathematical and computational foundations of quivers. The guides assume familiarity with basic category theory or a willingness to learn it alongside the material. For a more discursive treatment, see the tutorial; for the formal denotational semantics, see Semantics.
The guides are organized in seven thematic sections; each section's pages stand alone, but reading them in order gives the clearest picture of how the pieces fit together.
Foundations¶
The categorical primitives every other layer is built on.
- Core Types & Algebras. Finite sets (the SetObject hierarchy), algebras as enrichment algebras, and the algebraic primitives that underpin all morphism composition.
- Transformations & Composition Rules.
First-class change-of-base transformations, the
>>>composition operator, and theCompositionRule → Semigroupoid → Algebrahierarchy. - Morphisms & Composition. What a morphism is as
a tensor in \(\mathcal{V}^{|A| \times |B|}\), the morphism
hierarchy, composition, tensor product, marginalization, and
the compact-closed surface (
dagger,trace,cup,cap).
DSL¶
Writing programs in the typed .qvr language.
- DSL Overview. File format, grammar, doc comments, compilation pipeline, error handling.
- DSL Declarations.
composition,object,morphism(with the[role=...]option block selectinglatent/observed/kernel/embed/discretize),bundle, the fan / repeat / stack / scan / curry combinators, andexport. - DSL Programs and Let-Expressions.
programblocks, bind / observe / marginalize / let steps, the axis-role clause, factor expressions, the let-expression primitive surface, and inline distributions. - DSL Contractions. Operadic n-ary
contractions, type-driven wiring inference,
shareclause, explicitwiringescape hatch.
Probabilistic Programming¶
The runtime semantics of programs and distributions.
- Monadic Programs. Probabilistic programming via
sequential bind,
let,observe, andreturnsteps; ancestral sampling; log-joint computation. - Hierarchical Programs. Parametric templates for crossed random intercepts, monotone-spline coefficients, and grouped marginalization over fibred discrete latents.
- Continuous Spaces and Morphisms. The
ContinuousSpacehierarchy, theContinuousMorphisminterface, sampled composition, the discrete / continuous boundary, normalizing flows. - Continuous Families. The 30+ parameterized distribution registry, event ranks, and the structured priors (MatrixNormal, InverseWishart, GP, Horseshoe, LKJ) that interact with the axis-role surface.
- Stochastic Morphisms. The FinStoch category: Markov kernels, conditioning, queries, the Giry monad.
Inference¶
Fitting models to data.
- Inference Foundations. The six-layer inference stack, trace and sample-site interface, conditioning.
- Variational Inference: Guides, Objectives, and
SVI. The
Auto*Guidefamily, ELBO / IWAE / Rényi / VR-IWAE objectives, gradient estimators, SVI loop, predictive sampling. - Variational Inference: MCMC and Hybrid
Samplers. HMC and NUTS kernels,
AutoDAIS,WarmupThenHMC, predictive sampling from MCMC chains.
Categorical Structures¶
Higher-order categorical machinery the rest of the library is built on or reuses.
- Categorical Structures. Functors, natural transformations, adjunctions, monoidal structures, base change.
- Monads & Comonads. Monadic abstractions, Kleisli / coKleisli categories, algebras, coalgebras, distributive laws.
- Enriched Category Theory. Ends, coends, Kan extensions, weighted limits, profunctors, Yoneda, Day convolution, optics.
- Compositional Effects. Algebraic-effects framework over the residuated category universe.
Structured Prediction¶
The chart-parser and structural-compression substrate.
- Weighted Deduction Systems. Agenda-engine runtime, semirings, charts as differentiable values, the seven canonical parameters.
- Structural Compression: Signatures and
Encoders.
signatureandencoderblocks; F-algebra surface for compressing structured objects; factory form and sequence / graph sugar. - Structural Compression: Decoders and
Losses.
Kleisli-coalgebra
decoderblocks,lossdeclarations, deduction and Bayesian integration.
Analysis¶
Workflow surface around inference.
- Analysis: Data and Formulas.
DatasetSchema, brms-style formulas, the formula-to-QVR compile lens, family registry. - Analysis: Fitting and
Diagnostics. One-line
fit, ArviZ-based diagnostics, algebra-guided training tooling (ChainShape,recommend_init,saturation_warnings), autograd-safe morphism transforms.
Quick navigation¶
- Probabilistic programming. Core, Stochastic, Monadic Programs, Inference Foundations, SVI.
- Hybrid discrete-continuous models. Continuous Spaces, Continuous Families, Monadic Programs, Inference.
- Building models declaratively. DSL Overview, DSL Declarations, DSL Programs, Transformations, Inference.
- Category-theoretic extension. Categorical Structures, Monads & Comonads, Enriched Category Theory.
- Structured prediction and parsing. Weighted Deduction Systems, Structural Compression: Signatures, Structural Compression: Decoders.
- Working with fitted models. Inference Foundations, SVI, MCMC, Analysis: Data, Analysis: Fitting.