Crates.io | abstalg |
lib.rs | abstalg |
version | 0.2.0 |
source | src |
created_at | 2020-09-26 10:13:02.815184 |
updated_at | 2024-10-17 22:19:29.102869 |
description | Abstract algebraic structures for Rust |
homepage | |
repository | https://github.com/mmaroti/abstalg-rs/ |
max_upload_size | |
id | 293111 |
size | 104,009 |
This is a crate for doing abstract algebraic calculations in Rust. Unlike other implementations, the elements do not know to which algebraic structure they belong to, so all operations are performed through algebraic objects. For example, calculating within the ring of modular arithmetic modulo 6 the elements are still primitive i32 values, and only the quotient ring stores the value 6. This allows putting many such elements into polynomials or matrices efficiently, since this common value need to be stored only once in the algebra. Another benefit is that matrices are stored as simple vectors, and only the matrix algebra needs to know the shape of the matrix.
All prime-element fields can be constructed from the ring of integers by
taking the quotient ring by a prime number, or using the 2-element field
on the set of bool
values directly. All finite fields can be constructed
by forming the ring of polynomials over their prime field and then taking
the quotient ring by an irreducible polynomial. All finite boolean algebras
can be constructed as the direct power of the 2-element boolean algebra.
The divisibility order (on the set of association classes) with distributive
lattice operations can be constructed for Euclidean domains, such as the
ring of integers and the ring of polynomials over a field. The ring of
rectangular matrices can be formed over a field. The linear group of
invertible matrices, and the special linear group of matrices of unit
determinant can be formed over any field.