Expand description
A Rust library for abstract algebra.
This crate provides implementations of various algebraic structures and operations, with a focus on modular arithmetic and abstract algebra concepts.
§Features
- Modular Arithmetic: Create custom modular number types with the
modular!macro - Abstract Algebra: Implementations of fundamental algebraic structures:
- Groups (both Abelian and Non-Abelian)
- Rings
- Fields
- Modules
- Vector Spaces
§Examples
§Modular Arithmetic
use cova_algebra::{algebras::boolean::Boolean, modular, rings::Field};
// Create a type for numbers modulo 7
modular!(Mod7, u32, 7);
let a = Mod7::new(3);
let b = Mod7::new(5);
let sum = a + b; // 8 ≡ 1 (mod 7)§Vector Spaces
use cova_algebra::{algebras::boolean::Boolean, rings::Field, tensors::fixed::FixedVector};
let v1 = FixedVector::<3, f64>([1.0, 2.0, 3.0]);
let v2 = FixedVector::<3, f64>([4.0, 5.0, 6.0]);
let sum = v1 + v2;Re-exports§
pub use crate::arithmetic::Additive;pub use crate::arithmetic::Multiplicative;
Modules§
- algebras
- Implementation of an
Algebrainterface and various algebras - arithmetic
- Basic arithmetic traits and operations.
- category
- Category Theory Primitives
- groups
- Group theory abstractions and implementations.
- modules
- Module theory abstractions and implementations.
- prelude
- Prelude Module
- rings
- Ring theory abstractions and implementations.
- tensors
- Tensors Module
Macros§
- impl_
mul_ scalar_ clifford - A macro that implements scalar multiplication for Clifford algebra elements.
- modular
- A macro for creating custom modular number types.
- prime_
field - A macro for creating prime field types.
Traits§
- Add
- The addition operator
+. - AddAssign
- The addition assignment operator
+=. - Div
- The division operator
/. - DivAssign
- The division assignment operator
/=. - Mul
- The multiplication operator
*. - MulAssign
- The multiplication assignment operator
*=. - Neg
- The unary negation operator
-. - One
- Defines a multiplicative identity element for
Self. - Sub
- The subtraction operator
-. - SubAssign
- The subtraction assignment operator
-=. - Zero
- Defines an additive identity element for
Self.