Skip to content

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.

  1. Core Types & Algebras. Finite sets (the SetObject hierarchy), algebras as enrichment algebras, and the algebraic primitives that underpin all morphism composition.
  2. Transformations & Composition Rules. First-class change-of-base transformations, the >>> composition operator, and the CompositionRule → Semigroupoid → Algebra hierarchy.
  3. 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.

  1. DSL Overview. File format, grammar, doc comments, compilation pipeline, error handling.
  2. DSL Declarations. composition, object, morphism (with the [role=...] option block selecting latent / observed / kernel / embed / discretize), bundle, the fan / repeat / stack / scan / curry combinators, and export.
  3. DSL Programs and Let-Expressions. program blocks, bind / observe / marginalize / let steps, the axis-role clause, factor expressions, the let-expression primitive operators, and inline distributions.
  4. DSL Contractions. Operadic n-ary contractions, type-driven wiring inference, share clause, explicit wiring escape hatch.

Probabilistic Programming

The runtime semantics of programs and distributions.

  1. Monadic Programs. Probabilistic programming via sequential bind, let, observe, and return steps; ancestral sampling; log-joint computation.
  2. Hierarchical Programs. Parametric templates for crossed random intercepts, monotone-spline coefficients, and grouped marginalization over fibred discrete latents.
  3. Continuous Spaces and Morphisms. The ContinuousSpace hierarchy, the ContinuousMorphism interface, sampled composition, the discrete / continuous boundary, normalizing flows.
  4. 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.
  5. Stochastic Morphisms. The FinStoch category: Markov kernels, conditioning, queries, the Giry monad.

Inference

Fitting models to data.

  1. Inference Foundations. The six-layer inference stack, trace and sample-site interface, conditioning.
  2. Variational Inference: Guides, Objectives, and SVI. The Auto*Guide family, ELBO / IWAEBound / Rényi / VR-IWAE objectives, gradient estimators, SVI loop, predictive sampling.
  3. 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.

  1. Categorical Structures. Functors, natural transformations, adjunctions, monoidal structures, base change.
  2. Monads & Comonads. Monadic abstractions, Kleisli / coKleisli categories, algebras, coalgebras, distributive laws.
  3. Enriched Category Theory. Ends, coends, Kan extensions, weighted limits, profunctors, Yoneda, Day convolution, optics.
  4. Compositional Effects. Algebraic-effects framework over the residuated category universe.

Structured Prediction

These guides cover weighted parsing and the structural-compression framework.

  1. Weighted Deduction Systems. Agenda-engine runtime, semirings, charts as differentiable values, the seven canonical parameters.
  2. Structural Compression: Signatures and Encoders. signature and encoder blocks; the F-algebra interface for compressing structured objects; factory form and sequence / graph sugar.
  3. Structural Compression: Decoders and Losses. Kleisli-coalgebra decoder blocks, loss declarations, deduction and Bayesian integration.

Analysis

These guides cover data preparation, model fitting, and diagnostics.

  1. Analysis: Data and Formulas. DatasetSchema, brms-style formulas, the formula-to-QVR compile lens, family registry.
  2. 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