Changelog¶
All notable changes to the quivers library are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]¶
[0.2.0] - 2026-05-06¶
Changed¶
- Every record-shaped value type (AST nodes,
FinSet,ProductSet,CoproductSet,ContinuousSpacevariants,Categoryvariants,RuleSystem) is now adidactic.api.Model. Recursive sums aredx.TaggedUnionroots discriminated by akind: Literal[...]field. JSON round-trips viamodel_dump_json/model_validate_jsonare available on every value type. - Resolution from
TypeExpr/SpaceExprAST trees to runtimeSetObject/ContinuousSpacevalues is expressed as adx.Lensfamily inquivers.dsl.resolution. - Variadic constructors
ProductSet(A, B, C)andCoproductSet(A, B, C)are replaced by keyword formProductSet(components=(A, B, C))andCoproductSet(components=(A, B, C)). The flattening converter preserves the previous flattening behaviour. - Continuous spaces (
Euclidean,Simplex,PositiveReals,ProductSpace) expose publicnameanddimfields (no longer private with property accessors). - Minimum supported Python is now 3.14.
Added¶
- A tree-sitter grammar for the QVR DSL at
grammars/qvr/, registered with panproto'spanproto-grammars-alldistribution. quivers.dsl.parserdelegates parsing to panproto via theqvrtree-sitter grammar.quivers.dsl.program_theorydefinesQVR_PROGRAM_PROTOCOLandextract_program_schema, lifting every compiled program to a panprotoSchemafor use withpanproto schema diff,panproto lens generate, and related tooling.- A
Denotational Semanticsdocumentation section giving a formal, compositional semantics for the DSL across the discrete, stochastic, and continuous strata, plus an adequacy theorem connecting the compiler implementation to the denotation. RuleSystemcarries cross-field axioms (__axioms__) ensuringbinary_weights/unary_weightslengths matchbinary_rules/unary_ruleswhen supplied..github/workflows/release.ymlbuilds an sdist + wheel on tag push and publishes to PyPI via the FACTSlab/quivers OIDC trusted publisher.- Pull request template under
.github/PULL_REQUEST_TEMPLATE.mdand issue templates under.github/ISSUE_TEMPLATE/.
Removed¶
quivers.dsl.lexerandquivers.dsl.tokens: the hand-written lexer is replaced by panproto's tree-sitter–integrated lexing.LexError: lexical errors now surface asParseError.
[0.1.0] - 2026-03-26¶
Added¶
Core Categorical Algebra¶
- Fundamental category types and morphisms
- Object declarations and morphism composition
- Support for latent and observed morphisms
- Basic categorical operations and abstractions
Stochastic Morphisms¶
- Stochastic morphism declarations and semantics
- Integration with probability theory
- Support for morphism composition in stochastic settings
Continuous Distributions (30+ Families)¶
- Normal distribution and variants (LogitNormal, TruncatedNormal)
- Beta, Dirichlet for probability simplices
- Exponential family: Exponential, Gamma, Chi2
- Heavy-tailed: Cauchy, StudentT, Pareto
- Bounded: Uniform, Kumaraswamy
- Half-variants: HalfCauchy, HalfNormal
- Transformed: LogNormal, Gumbel, Laplace, Weibull
- Multivariate: MultivariateNormal, LowRankMVN, Wishart
- Bernoulli variants: Bernoulli, ContinuousBernoulli, RelaxedBernoulli
- Advanced: RelaxedOneHotCategorical, FisherSnedecor
- Normalized flows: Flow
- Categorical and discrete approximations
Monadic Programs¶
- Draw statements for sampling from morphisms
- Observe statements for conditioning and likelihood
- Return statements with optional labeled outputs
- Variable binding and destructuring in patterns
- Program parameters and composition
QVR DSL¶
- Complete lexer with token recognition for all language constructs
- Recursive descent parser with full grammar support
- Abstract syntax tree (AST) node definitions
- Program block execution with proper scoping
- Let bindings for expression computation
- Built-in let functions: sigmoid, exp, log, abs, softplus
- Comment support (#)
- Type expressions: products (*), coproducts (+)
- Expression operators: composition (>>), tensor product (@), marginalization
- Indentation-aware program body parsing
- Specialized handling for draw/observe arguments
Variational Inference Layer¶
- Inference interface for probabilistic programs
- Support for approximate posterior computation
- Integration with continuous distribution families