comodules/comodule/
traits.rs1use std::sync::Arc;
2
3use crate::linalg::{graded::BasisElement, grading::Grading};
4
5pub trait Comodule<G: Grading>: Sized {
6 type Element: BasisElement;
7 type Coalgebra;
8 type Morphism: ComoduleMorphism<G, Self>;
9
10 fn zero_comodule(coalgebra: Arc<Self::Coalgebra>) -> Self;
11
12 fn get_generators(&self) -> Vec<(usize, G, Option<String>)>;
14
15 fn fp_comodule(coalgebra: Arc<Self::Coalgebra>) -> Self;
16
17 fn direct_sum(&mut self, other: &mut Self);
18
19 fn cofree_comodule(coalgebra: Arc<Self::Coalgebra>, index: usize, grade: G, limit: G) -> Self;
20}
21
22pub trait ComoduleMorphism<G: Grading, M: Comodule<G>> {
23 fn cokernel(&self) -> Self;
24 fn inject_codomain_to_cofree(&self, limit: G) -> Self; fn zero_morphism(comodule: Arc<M>) -> Self;
27
28 fn compose(l: Self, r: Self) -> Self;
30
31 fn get_codomain(&self) -> Arc<M>;
32
33 fn get_structure_lines(&self) -> Vec<(usize, usize, usize, String)>;
38}
39
40pub trait Tensor<G: Grading> {
41 fn tensor_to_base();
42 fn base_to_tensor();
43
44 fn get_dimension(&self, grading: &G) -> usize;
45}