Supported Mathematical Types
The qFALL-math crate provides types that align closely with mathematical notation, offering core domains and their extensions to matrices and polynomials.
| Mathematical Domain | Mathematical Notation | Type Description | Struct in qFALL-math |
|---|---|---|---|
| Integers | \(\mathbb{Z}\) | Arbitrarily big 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}\) | Arbitrary-precision 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, andQ, introduce some features and present some arithmetic operations. - Complex Structures: We present more advanced types like
MatZ,PolyOverZ, orPolynomialRingZqand give some intuition on working with them. - NTT: We consider how values of
PolynomialRingZqcan be represented differently (using the Number Theoretic Transform) for more efficient multiplication.