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 Domain | Mathematical Notation | Type Description | qFALL-math Rust Type |
|---|---|---|---|
| Integers | \(\mathbb{Z}\) | Arbitrarily large integers | Z |
| \(\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 ring | MatPolynomialRingZq | |
| Rationals | \(\mathbb{Q}\) | Arbitrarily precise rationals | Q |
| \(\mathbb{Q}^{n\times m}\) | Matrices over \(\mathbb{Q}\) | MatQ | |
| \(\mathbb{Q}[X]\) | Polynomials over \(\mathbb{Q}\) | PolyOverQ |
How is this Section structured?
- Basic Types: We show how to instantiate the three base types
Z, Zq, Qand introduce some features and present some arithmetics. - Complex Structures: We present the more advanced types like
MatZ, PolyZ, PolynomialRingZqand 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. - NTT: We consider how values of
PolynomialRingZqcan be represented differently (using the NTT-transform) for more efficient multiplication.