pub struct QadicRing { /* private fields */ }Expand description
The fixed-cap Witt ring W(F_q) / p^N.
The complete residue-field presentation and the absolute precision cap are
context identity. Elements use FLINT’s qadic_t backend but are restricted
to nonnegative valuation, so every power-basis coefficient has a fixed
N-digit p-adic storage bound.
Implementations§
Source§impl QadicRing
impl QadicRing
Sourcepub fn coefficient_frobenius(&self, exponent: u64) -> QadicRingFrobenius
pub fn coefficient_frobenius(&self, exponent: u64) -> QadicRingFrobenius
Checked lift of residue-field Frobenius on this Witt-ring presentation.
Source§impl QadicRing
impl QadicRing
Sourcepub fn precision_restriction(
&self,
target_absolute_precision: u64,
) -> Result<QadicRingRestriction, QadicRestrictionError>
pub fn precision_restriction( &self, target_absolute_precision: u64, ) -> Result<QadicRingRestriction, QadicRestrictionError>
Construct a first-class restriction to a coarser fixed-cap Witt ring.
Sourcepub fn divide_uniformizer_exact(
&self,
value: &QadicElement,
exponent: u64,
) -> Result<QadicElement, QadicUniformizerDivisionError>
pub fn divide_uniformizer_exact( &self, value: &QadicElement, exponent: u64, ) -> Result<QadicElement, QadicUniformizerDivisionError>
Divide by p^exponent, requiring the quotient to remain integral.
Source§impl QadicRing
impl QadicRing
Sourcepub fn new(
residue_field: FiniteField,
absolute_precision: u64,
) -> Result<Self, QadicContextError>
pub fn new( residue_field: FiniteField, absolute_precision: u64, ) -> Result<Self, QadicContextError>
Construct W(residue_field) / p^N from a verified finite-field
presentation.
Sourcepub fn residue_field(&self) -> &FiniteField
pub fn residue_field(&self) -> &FiniteField
Residue field F_q, including its normalized defining presentation.
Sourcepub fn residue_degree(&self) -> usize
pub fn residue_degree(&self) -> usize
Residue degree [F_q : F_p].
Sourcepub fn coefficient_ring(&self) -> &PadicRing
pub fn coefficient_ring(&self) -> &PadicRing
Base p-adic integer ring supplying the power-basis coefficients.
Sourcepub fn absolute_precision(&self) -> u64
pub fn absolute_precision(&self) -> u64
Immutable absolute precision cap N.
Sourcepub fn cardinality(&self) -> Integer
pub fn cardinality(&self) -> Integer
Exact cardinality q^N of the truncated Witt ring.
Sourcepub fn element<T: Into<Integer>>(&self, value: T) -> QadicElement
pub fn element<T: Into<Integer>>(&self, value: T) -> QadicElement
Embed an integer through Z_p -> W(F_q).
Sourcepub fn element_from_coefficients(
&self,
coefficients: &[PadicElement],
) -> Result<QadicElement, InvalidQadicCoordinatesError>
pub fn element_from_coefficients( &self, coefficients: &[PadicElement], ) -> Result<QadicElement, InvalidQadicCoordinatesError>
Construct an element from ascending Z_p coordinates in the declared
q-adic power basis.
Missing high coordinates are zero, and at most residue_degree
coordinates may be supplied. Every coordinate must belong to this
context’s exact coefficient ring.
Sourcepub fn to_json(&self) -> Result<String, NoetherError>
pub fn to_json(&self) -> Result<String, NoetherError>
Serialize the residue-field presentation and absolute precision as typed JSON.
Sourcepub fn from_json(value: &str) -> Result<Self, NoetherError>
pub fn from_json(value: &str) -> Result<Self, NoetherError>
Deserialize and revalidate a fixed-precision Witt-ring context.
Sourcepub fn residue(
&self,
value: &QadicElement,
) -> Result<FiniteFieldElement, ContextMismatchError>
pub fn residue( &self, value: &QadicElement, ) -> Result<FiniteFieldElement, ContextMismatchError>
Reduce an integral q-adic value to F_q.
Sourcepub fn teichmuller(
&self,
value: &FiniteFieldElement,
) -> Result<QadicElement, ContextMismatchError>
pub fn teichmuller( &self, value: &FiniteFieldElement, ) -> Result<QadicElement, ContextMismatchError>
Lift a residue-field value to its Teichmüller representative.
Sourcepub fn generator(&self) -> QadicElement
pub fn generator(&self) -> QadicElement
Distinguished Teichmüller lift of the residue-field power-basis generator.
Sourcepub fn restrict(
&self,
value: &QadicElement,
absolute_precision: u64,
) -> Result<QadicElement, QadicRestrictionError>
pub fn restrict( &self, value: &QadicElement, absolute_precision: u64, ) -> Result<QadicElement, QadicRestrictionError>
Explicitly discard high p-adic digits.
Trait Implementations§
Source§impl CoefficientFrobeniusContext for QadicRing
impl CoefficientFrobeniusContext for QadicRing
Source§type Frobenius = QadicRingFrobenius
type Frobenius = QadicRingFrobenius
Source§fn coefficient_frobenius(&self, exponent: u64) -> Self::Frobenius
fn coefficient_frobenius(&self, exponent: u64) -> Self::Frobenius
Source§fn residue_characteristic(&self) -> &Integer
fn residue_characteristic(&self) -> &Integer
Source§impl<'de> Deserialize<'de> for QadicRing
impl<'de> Deserialize<'de> for QadicRing
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl PrecisionContext for QadicRing
impl PrecisionContext for QadicRing
Source§impl Ring for QadicRing
impl Ring for QadicRing
Source§type Element = QadicElement
type Element = QadicElement
Source§fn contains(&self, value: &Self::Element) -> bool
fn contains(&self, value: &Self::Element) -> bool
Source§fn add(
&self,
a: &Self::Element,
b: &Self::Element,
) -> Result<Self::Element, ContextMismatchError>
fn add( &self, a: &Self::Element, b: &Self::Element, ) -> Result<Self::Element, ContextMismatchError>
Source§fn sub(
&self,
a: &Self::Element,
b: &Self::Element,
) -> Result<Self::Element, ContextMismatchError>
fn sub( &self, a: &Self::Element, b: &Self::Element, ) -> Result<Self::Element, ContextMismatchError>
Source§fn mul(
&self,
a: &Self::Element,
b: &Self::Element,
) -> Result<Self::Element, ContextMismatchError>
fn mul( &self, a: &Self::Element, b: &Self::Element, ) -> Result<Self::Element, ContextMismatchError>
Source§fn neg(
&self,
value: &Self::Element,
) -> Result<Self::Element, ContextMismatchError>
fn neg( &self, value: &Self::Element, ) -> Result<Self::Element, ContextMismatchError>
Source§fn is_zero(&self, value: &Self::Element) -> bool
fn is_zero(&self, value: &Self::Element) -> bool
Source§fn sum_products(
&self,
products: &[(&Self::Element, &Self::Element)],
) -> Result<Self::Element, ContextMismatchError>
fn sum_products( &self, products: &[(&Self::Element, &Self::Element)], ) -> Result<Self::Element, ContextMismatchError>
Source§impl SemanticType for QadicRing
impl SemanticType for QadicRing
Source§const TYPE_ID: &'static str = "noether/numthy/QadicRing@1"
const TYPE_ID: &'static str = "noether/numthy/QadicRing@1"
Source§fn canonical_bytes(&self) -> Result<Vec<u8>, NoetherError>
fn canonical_bytes(&self) -> Result<Vec<u8>, NoetherError>
Source§fn describe() -> &'static TypeDescription
fn describe() -> &'static TypeDescription
Source§impl UnitInversion for QadicRing
impl UnitInversion for QadicRing
Source§impl ValuedRing for QadicRing
impl ValuedRing for QadicRing
Source§fn uniformizer(&self) -> Self::Element
fn uniformizer(&self) -> Self::Element
impl CommutativeRing for QadicRing
impl Eq for QadicRing
Auto Trait Implementations§
impl Freeze for QadicRing
impl RefUnwindSafe for QadicRing
impl Send for QadicRing
impl Sync for QadicRing
impl Unpin for QadicRing
impl UnwindSafe for QadicRing
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more