Algebra

Trait Algebra 

Source
pub trait Algebra:
    Display
    + Send
    + Sync
    + 'static {
Show 13 methods // Required methods fn prime(&self) -> ValidPrime; fn compute_basis(&self, degree: i32); fn dimension(&self, degree: i32) -> usize; fn multiply_basis_elements( &self, result: FpSliceMut<'_>, coeff: u32, r_degree: i32, r_idx: usize, s_degree: i32, s_idx: usize, ); fn basis_element_to_string(&self, degree: i32, idx: usize) -> String; fn basis_element_from_string(&self, elt: &str) -> Option<(i32, usize)>; // Provided methods fn prefix(&self) -> &str { ... } fn magic(&self) -> u32 { ... } fn multiply_basis_element_by_element( &self, result: FpSliceMut<'_>, coeff: u32, r_degree: i32, r_idx: usize, s_degree: i32, s: FpSlice<'_>, ) { ... } fn multiply_element_by_basis_element( &self, result: FpSliceMut<'_>, coeff: u32, r_degree: i32, r: FpSlice<'_>, s_degree: i32, s_idx: usize, ) { ... } fn multiply_element_by_element( &self, result: FpSliceMut<'_>, coeff: u32, r_degree: i32, r: FpSlice<'_>, s_degree: i32, s: FpSlice<'_>, ) { ... } fn default_filtration_one_products(&self) -> Vec<(String, i32, usize)> { ... } fn element_to_string(&self, degree: i32, element: FpSlice<'_>) -> String { ... }
}
Expand description

A graded algebra over $\mathbb{F}_p$.

Each degree is finite dimensional, and equipped with a distinguished ordered basis. Basis elements are referred to by their signed degree and unsigned index, while a general element of a given degree is denoted by an FpVector given in terms of that degree’s basis.

These algebras are frequently infinite-dimensional, so we must construct the representation lazily. The function Algebra::compute_basis() will request that book-keeping information be updated to perform computations up to the given degree; users must make sure to call this function before performing other operations at that degree.

Algebras may have a distinguished set of generators; see GeneratedAlgebra.

Required Methods§

Source

fn prime(&self) -> ValidPrime

Returns the prime the algebra is over.

Source

fn compute_basis(&self, degree: i32)

Computes basis elements up to and including degree.

This function must be called by users before other functions that will involve operations at degree, so it should be used to update internal data structure in perparation for such operations.

This function must be idempotent and cheap to call again with the same argument.

Source

fn dimension(&self, degree: i32) -> usize

Returns the dimension of the algebra in degree degree.

Source

fn multiply_basis_elements( &self, result: FpSliceMut<'_>, coeff: u32, r_degree: i32, r_idx: usize, s_degree: i32, s_idx: usize, )

Computes the product r * s of two basis elements, and adds the result to result.

result is not required to be aligned.

Source

fn basis_element_to_string(&self, degree: i32, idx: usize) -> String

Converts a basis element into a string for display.

Source

fn basis_element_from_string(&self, elt: &str) -> Option<(i32, usize)>

Converts a string to a basis element. This must be a one-sided inverse inverse to both basis_element_to_string and generator_to_string (if GeneratedAlgebra is implemented).

If the input is invalid, the function is allowed to return None or nonsense (since it is only required to be a one-sided inverse).

Provided Methods§

Source

fn prefix(&self) -> &str

A name for the algebra to use in serialization operations. This defaults to “” for algebras that don’t care about this problem.

Source

fn magic(&self) -> u32

A magic constant used to identify the algebra in save files. When working with the Milnor algebra, it is easy to forget to specify the algebra and load Milnor save files with the Adem basis. If we somehow manage to resume computation, this can have disasterous consequences. So we store the magic in the save files.

This defaults to 0 for other kinds of algebra that don’t care about this problem.

Source

fn multiply_basis_element_by_element( &self, result: FpSliceMut<'_>, coeff: u32, r_degree: i32, r_idx: usize, s_degree: i32, s: FpSlice<'_>, )

Computes the product r * s of a basis element r and a general element s, and adds the result to result.

Neither result nor s must be aligned.

Source

fn multiply_element_by_basis_element( &self, result: FpSliceMut<'_>, coeff: u32, r_degree: i32, r: FpSlice<'_>, s_degree: i32, s_idx: usize, )

Computes the product r * s of a general element r and a basis element s, and adds the result to result.

Neither result nor r must be aligned.

Source

fn multiply_element_by_element( &self, result: FpSliceMut<'_>, coeff: u32, r_degree: i32, r: FpSlice<'_>, s_degree: i32, s: FpSlice<'_>, )

Computes the product r * s of two general elements, and adds the result to result.

Neither result, s, nor r must be aligned.

Source

fn default_filtration_one_products(&self) -> Vec<(String, i32, usize)>

Returns a list of filtration-one elements in $Ext(k, k)$.

These are the same as indecomposable elements of the algebra.

This function returns a default list of such elements in the format (name, degree, index) for which we want to compute products with in the resolutions.

Source

fn element_to_string(&self, degree: i32, element: FpSlice<'_>) -> String

Converts a general element into a string for display.

Implementors§