Skip to main content

Algebra

Trait Algebra 

Source
pub trait Algebra<F>:
    PrimeCharacteristicRing<Output = Self, Output = Self, Output = Self>
    + From<F>
    + Add<F>
    + AddAssign<F>
    + Sub<F>
    + SubAssign<F>
    + Mul<F>
    + MulAssign<F> {
    // Provided method
    fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Self
       where F: Clone { ... }
}
Expand description

A ring R implements Algebra<F> if there is an injective homomorphism from F into R; in particular only F::ZERO maps to R::ZERO.

For the most part, we will usually expect F to be a field but there are a few cases where it is handy to allow it to just be a ring. In particular, every ring naturally implements Algebra<Self>.

§Mathematical Description

Let x and y denote arbitrary elements of F. Then we require that our map from has the properties:

  • Preserves Identity: from(F::ONE) = R::ONE
  • Commutes with Addition: from(x + y) = from(x) + from(y)
  • Commutes with Multiplication: from(x * y) = from(x) * from(y)

Such maps are known as ring homomorphisms and are injective if the only element which maps to R::ZERO is F::ZERO.

The existence of this map makes R into an F-module and hence an F-algebra. If, additionally, R is a field, then this makes R a field extension of F.

Provided Methods§

Source

fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Self
where F: Clone,

Dot product between algebra elements and base field scalars.

Given arrays a (algebra) and f (scalars), computes:

  result = a[0]*f[0] + a[1]*f[1] + ... + a[N-1]*f[N-1]

Uses a tree-structured summation to minimize dependency chains and maximize throughput on pipelined architectures.

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§

Source§

impl<F> Algebra<SymbolicVariable<F>> for SymbolicExpr<BaseLeaf<F>>
where F: Field,

Source§

impl<F> Algebra<F> for SymbolicExpr<BaseLeaf<F>>
where F: Field,

Source§

impl<F, EF> Algebra<SymbolicExpr<BaseLeaf<F>>> for SymbolicExpr<ExtLeaf<F, EF>>
where F: Field, EF: ExtensionField<F>,

Source§

impl<F, EF> Algebra<SymbolicVariable<F>> for SymbolicExpr<ExtLeaf<F, EF>>
where F: Field, EF: ExtensionField<F>,

Source§

impl<F, EF> Algebra<SymbolicVariableExt<F, EF>> for SymbolicExpr<ExtLeaf<F, EF>>
where F: Field, EF: ExtensionField<F>,

Source§

impl<F, EF> Algebra<F> for SymbolicExpr<ExtLeaf<F, EF>>
where F: Field, EF: ExtensionField<F>,

Source§

impl<F, const D: usize> Algebra<BinomialExtensionField<F, D>> for SymbolicExpr<ExtLeaf<F, BinomialExtensionField<F, D>>>

Concrete Algebra for BinomialExtensionField — avoids overlap with Algebra<F> when EF = F.

Implementors§

Source§

impl<F> Algebra<F> for QuinticTrinomialExtensionField<F>

Source§

impl<F, PF> Algebra<QuinticTrinomialExtensionField<F>> for PackedQuinticTrinomialExtensionField<F, PF>
where F: QuinticTrinomialExtendable, PF: PackedField<Scalar = F>,

Source§

impl<F, PF> Algebra<PF> for PackedQuinticTrinomialExtensionField<F, PF>
where F: QuinticTrinomialExtendable, PF: PackedField<Scalar = F>,

Source§

impl<F, PF, const D: usize> Algebra<BinomialExtensionField<F, D>> for PackedBinomialExtensionField<F, PF, D>
where F: BinomiallyExtendable<D>, PF: PackedField<Scalar = F>,

Source§

impl<F, PF, const D: usize> Algebra<PF> for PackedBinomialExtensionField<F, PF, D>
where F: BinomiallyExtendable<D>, PF: PackedField<Scalar = F>,

Source§

impl<F, const D: usize> Algebra<F> for BinomialExtensionField<F, D>

Source§

impl<F, const N: usize> Algebra<F> for FieldArray<F, N>
where F: Field,

Source§

impl<R> Algebra<R> for R