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>
impl<S: BinaryField, T: BinaryField> Embedding<S, T>
Sourcepub fn new() -> Result<Self, EmbeddingError>
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.
Sourcepub fn embed(&self, value: Elem<S>) -> Elem<T>
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.
Sourcepub fn contains(&self, value: Elem<T>) -> bool
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.
Sourcepub fn frobenius(&self, value: Elem<T>) -> Elem<T>
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.
Sourcepub fn trace(&self, value: Elem<T>) -> Elem<S>
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.
Sourcepub fn norm(&self, value: Elem<T>) -> Elem<S>
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.