Skip to main content

Embedding

Struct Embedding 

Source
pub struct Embedding<S: BinaryField, T: BinaryField> { /* private fields */ }
Expand description

A prepared, explicitly selected field inclusion of S into T.

The embedding is the canonical one through the frozen reference ladder: the source’s canonical map into the reference of its degree, the frozen consecutive inclusions up to the target’s degree, and the inverse of the target’s canonical map. Equal presentation descriptions therefore embed identically, and inclusions commute as triangles.

Construction verifies the composed map on valid descriptions (unit, inverse round trips, basis-pair multiplicativity, and Frobenius-fixed images); a failed verification is a crate defect and panics. Descriptor invalidity is the descriptions’ own use-time validation, not an error here.

The prepared state is fixed arrays; construction and every method are allocation-free. Repeated application never reruns root construction.

Implementations§

Source§

impl<S: BinaryField, T: BinaryField> Embedding<S, T>

Source

pub fn new() -> Result<Self, EmbeddingError>

Prepare the canonical embedding of S into T.

§Errors

Returns EmbeddingError::IncompatibleDegree when S::DEGREE does not divide T::DEGREE; no other pair is rejected.

§Panics

Panics when verification of the composed map fails on otherwise valid descriptions. That is a crate defect, not an input condition.

Source

pub fn embed(&self, value: Elem<S>) -> Elem<T>

Map value into the target field.

§Panics

Panics only on a crate defect: a prepared image that fails target coordinate conversion, which construction verified impossible.

Source

pub fn contains(&self, value: Elem<T>) -> bool

Whether value lies in the image of this embedding.

Membership is the fixed points of the relative Frobenius.

Source

pub fn restrict(&self, value: Elem<T>) -> Option<Elem<S>>

The inverse of embed on the image, or None.

§Panics

Panics only on a crate defect: a restricted word that fails source coordinate conversion, which construction verified impossible.

Source

pub fn frobenius(&self, value: Elem<T>) -> Elem<T>

The relative Frobenius x^(2^m) of the extension.

Computed by m repeated squarings, so no exponent is ever shifted into or out of a 64-bit word.

Source

pub fn trace(&self, value: Elem<T>) -> Elem<S>

The relative trace: the sum of the conjugates under the relative Frobenius, restricted to the source.

Equal degrees reduce to restriction. Embedding<Binary<1, Polynomial<3>>, T> supplies the absolute trace.

§Panics

Panics only on a crate defect: a conjugate sum outside the verified embedding image.

Source

pub fn norm(&self, value: Elem<T>) -> Elem<S>

The relative norm: the product of the conjugates under the relative Frobenius, restricted to the source.

Equal degrees reduce to restriction. Embedding<Binary<1, Polynomial<3>>, T> supplies the absolute norm.

§Panics

Panics only on a crate defect: a conjugate product outside the verified embedding image.

Trait Implementations§

Source§

impl<S: BinaryField, T: BinaryField> Clone for Embedding<S, T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S: BinaryField, T: BinaryField> Copy for Embedding<S, T>

Source§

impl<S: BinaryField, T: BinaryField> Debug for Embedding<S, T>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S, T> Freeze for Embedding<S, T>
where PhantomData<fn() -> (S, T)>: Freeze,

§

impl<S, T> RefUnwindSafe for Embedding<S, T>

§

impl<S, T> Send for Embedding<S, T>
where PhantomData<fn() -> (S, T)>: Send,

§

impl<S, T> Sync for Embedding<S, T>
where PhantomData<fn() -> (S, T)>: Sync,

§

impl<S, T> Unpin for Embedding<S, T>
where PhantomData<fn() -> (S, T)>: Unpin,

§

impl<S, T> UnsafeUnpin for Embedding<S, T>

§

impl<S, T> UnwindSafe for Embedding<S, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.