Conceptual Guides¶
These guides explain the mathematical and computational foundations of Quivers by feature area. They assume familiarity with basic category theory or a willingness to learn it alongside the material. For complete worked examples, see the tutorials; for formal semantics, see Semantics.
For declaration-by-declaration syntax and operational behavior, use the QVR language reference. The guides explain why a feature exists and how it relates to the rest of Quivers; the reference states what source forms are accepted and how they run.
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¶
These guides introduce the categorical primitives used throughout the library.
- 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 operations (
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 operators, 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 registry of more than forty parameterized distributions, event ranks, and the structured priors (MatrixNormal, InverseWishart, GP, Horseshoe, LKJ) that use the axis-role syntax.
- 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 / IWAEBound / 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¶
These guides cover higher-order categorical constructions used elsewhere in the library.
- 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¶
These guides cover weighted parsing and the structural-compression framework.
- Weighted Deduction Systems. Agenda-engine runtime, semirings, charts as differentiable values, the seven canonical parameters.
- Structural Compression: Signatures and
Encoders.
signatureandencoderblocks; the F-algebra interface for compressing structured objects; factory form and sequence / graph sugar. - Structural Compression: Decoders and
Losses.
Kleisli-coalgebra
decoderblocks,lossdeclarations, deduction and Bayesian integration.
Analysis¶
These guides cover data preparation, model fitting, and diagnostics.
- 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, QVR Language Reference, 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.