Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Supported Mathematical Types

The qFALL-math library provides types that align closely with mathematical notation, offering core domains and their extensions to matrices and polynomials.

Mathematical DomainMathematical NotationType DescriptionqFALL-math Rust Type
Integers\(\mathbb{Z}\)Arbitrarily large integersZ
\(\mathbb{Z}^{n\times m}\)Matrices over \(\mathbb{Z}\)MatZ
\(\mathbb{Z}[X]\)Polynomials over \(\mathbb{Z}\)PolyOverZ
\(\mathbb{Z}[X]^{n \times m}\)Matrices over polynomials over \(\mathbb{Z}\)MatPolyOverZ
Integers Modulo \(q\)\(\mathbb{Z}_q\)Integers modulo a natural number \(q\)Zq
\(\mathbb{Z}_q^{n\times m}\)Matrices over \(\mathbb{Z}_q\)MatZq
\(\mathbb{Z}_q[X]\)Polynomials over \(\mathbb{Z}_q\)PolyOverZq
Polynomial Ring\(\mathbb{Z}_q[X]/f(X)\)Elements of a polynomial ring over \(\mathbb{Z}_q\), where \(f(X)\) is the defining polynomial (often cyclotomic).PolynomialRingZq
\((\mathbb{Z}_q[X]/f(X))^{n \times m}\)Matrices over the polynomial ringMatPolynomialRingZq
Rationals\(\mathbb{Q}\)Arbitrarily precise rationalsQ
\(\mathbb{Q}^{n\times m}\)Matrices over \(\mathbb{Q}\)MatQ
\(\mathbb{Q}[X]\)Polynomials over \(\mathbb{Q}\)PolyOverQ

How is this Section structured?

  1. Basic Types: We show how to instantiate the three base types Z, Zq, Q and introduce some features and present some arithmetics.
  2. Complex Structures: We present the more advanced types like MatZ, PolyZ, PolynomialRingZq and give some intuition on how they work, as all similar types also behave similarly, this allows you to figure out how to use the others.
  3. NTT: We consider how values of PolynomialRingZq can be represented differently (using the NTT-transform) for more efficient multiplication.