Skip to main content

BinomiallyExtendableAlgebra

Trait BinomiallyExtendableAlgebra 

pub trait BinomiallyExtendableAlgebra<F, const D: usize>: Algebra<F>
where F: Field,
{ // Provided methods fn binomial_mul(a: &[Self; D], b: &[Self; D], res: &mut [Self; D], w: F) { ... } fn binomial_add(a: &[Self; D], b: &[Self; D]) -> [Self; D] { ... } fn binomial_sub(a: &[Self; D], b: &[Self; D]) -> [Self; D] { ... } fn binomial_base_mul(lhs: [Self; D], rhs: Self) -> [Self; D] { ... } }
Expand description

Trait for algebras which support binomial extensions of the form A[X]/(X^D - W) with W in the base field F.

Provided Methods§

fn binomial_mul(a: &[Self; D], b: &[Self; D], res: &mut [Self; D], w: F)

Multiplication in the algebra extension ring A<X> / (X^D - W).

Some algebras may want to reimplement this with faster methods.

fn binomial_add(a: &[Self; D], b: &[Self; D]) -> [Self; D]

Addition of elements in the algebra extension ring A<X> / (X^D - W).

As addition has no dependence on W so this is equivalent to an algorithm for adding arrays of elements of A.

Some algebras may want to reimplement this with faster methods.

fn binomial_sub(a: &[Self; D], b: &[Self; D]) -> [Self; D]

Subtraction of elements in the algebra extension ring A<X> / (X^D - W).

As subtraction has no dependence on W so this is equivalent to an algorithm for subtracting arrays of elements of A.

Some algebras may want to reimplement this with faster methods.

fn binomial_base_mul(lhs: [Self; D], rhs: Self) -> [Self; D]

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl BinomiallyExtendableAlgebra<Felt, 2> for Felt

§

impl BinomiallyExtendableAlgebra<Felt, 5> for Felt

§

impl BinomiallyExtendableAlgebra<Goldilocks, 2> for Goldilocks

§

impl BinomiallyExtendableAlgebra<Goldilocks, 5> for Goldilocks

§

impl<const WIDTH: usize, FP> BinomiallyExtendableAlgebra<MontyField31<FP>, WIDTH> for MontyField31<FP>
where FP: BinomialExtensionData<WIDTH> + FieldParameters,

§

fn binomial_mul( a: &[MontyField31<FP>; WIDTH], b: &[MontyField31<FP>; WIDTH], res: &mut [MontyField31<FP>; WIDTH], _w: MontyField31<FP>, )

§

fn binomial_add( a: &[MontyField31<FP>; WIDTH], b: &[MontyField31<FP>; WIDTH], ) -> [MontyField31<FP>; WIDTH]

§

fn binomial_sub( a: &[MontyField31<FP>; WIDTH], b: &[MontyField31<FP>; WIDTH], ) -> [MontyField31<FP>; WIDTH]

§

fn binomial_base_mul( lhs: [MontyField31<FP>; WIDTH], rhs: MontyField31<FP>, ) -> [MontyField31<FP>; WIDTH]

Implementors§

§

impl<F> BinomiallyExtendableAlgebra<F, 2> for F
where F: ComplexExtendable,

§

impl<F, const D: usize> BinomiallyExtendableAlgebra<BinomialExtensionField<F, 2>, D> for BinomialExtensionField<F, 2>
where F: HasComplexBinomialExtension<D>,