Valued Point

NonArchimedeanMachineLearning.ValuedFieldPointType
ValuedFieldPoint{P,Prec,S}

A wrapper around valued field elements that encodes the prime P and precision Prec at the type level for compile-time optimization.

Type Parameters

  • P: The prime of the underlying p-adic field (compile-time constant)
  • Prec: The precision of the underlying p-adic field (compile-time constant)
  • S: The type of the underlying field element (e.g., PadicFieldElem)

Fields

  • elem::S: The underlying field element

Example

K = PadicField(2, 20)
x = ValuedFieldPoint(K(5))
prime(x)       # Returns 2
precision(x)   # Returns 20
x + x          # Works like normal arithmetic

Notes

With this wrapper, ValuationPolydisc{ValuedFieldPoint{P,Prec,S},T,N} knows P at compile time, enabling loop optimizations in hot-path functions.

source
NonArchimedeanMachineLearning.ValuedFieldPointMethod
ValuedFieldPoint(x::PadicFieldElem)

Construct a ValuedFieldPoint from a PadicFieldElem, automatically extracting the prime and precision from the parent field.

Example

K = PadicField(2, 20)
x = ValuedFieldPoint(K(5))  # ValuedFieldPoint{2,20,PadicFieldElem}(...)
source
Base.absMethod
Base.abs(x::ValuedFieldPoint{P,Prec,S}) where {P,Prec,S}

Compute the absolute value of a wrapped valued field element.

Uses the type-level prime P for efficiency: |x|_p = P^(-v(x))

source
Base.oneMethod
Oscar.one(::Type{ValuedFieldPoint{P,Prec,S}}, K) where {P,Prec,S}

Return the one element of the valued field K wrapped as a ValuedFieldPoint. Note: requires the field K to be passed since type alone doesn't contain field reference.

source
Base.oneMethod
Base.one(x::ValuedFieldPoint{P,Prec,S}) where {P,Prec,S}

Return the one element in the same field as x.

source
Base.parentMethod
Base.parent(x::ValuedFieldPoint)

Return the parent field of the underlying element.

source
Base.precisionMethod
precision(::Type{ValuedFieldPoint{P,Prec,S}}) where {P,Prec,S}
precision(::ValuedFieldPoint{P,Prec,S}) where {P,Prec,S}

Return the precision of the underlying p-adic field.

This is a compile-time constant available via the type parameter Prec.

source
Base.zeroMethod
Oscar.zero(::Type{ValuedFieldPoint{P,Prec,S}}, K) where {P,Prec,S}

Return the zero element of the valued field K wrapped as a ValuedFieldPoint. Note: requires the field K to be passed since type alone doesn't contain field reference.

source
Base.zeroMethod
Base.zero(x::ValuedFieldPoint{P,Prec,S}) where {P,Prec,S}

Return the zero element in the same field as x.

source
NonArchimedeanMachineLearning.liftMethod
lift(R::ZZRing, x::S) where S<:PadicFieldElem

Lift a plain p-adic field element to the integer ring ZZ. This handles polydiscs with unwrapped PadicFieldElem centers.

Example

K = PadicField(2, 20)
lifted = lift(ZZ, K(5))  # ZZRingElem
source
NonArchimedeanMachineLearning.liftMethod
lift(R::ZZRing, x::ValuedFieldPoint{P,Prec,S})

Lift a ValuedFieldPoint to the integer ring ZZ by delegating to the underlying element. This is used primarily by canonical_center for polydisc hashing.

Example

K = PadicField(2, 20)
x = ValuedFieldPoint{2,20,PadicFieldElem}(K(5))
lifted = lift(ZZ, x)  # ZZRingElem
source
NonArchimedeanMachineLearning.liftMethod
lift(x::ValuedFieldPoint{P,Prec,S})

Scalar lift for ValuedFieldPoint (delegates to underlying element). Provided for consistency with Oscar's lift interface.

source
NonArchimedeanMachineLearning.liftMethod
lift(v::Vector{S}) where S<:PadicFieldElem

Lift a vector of p-adic field elements to ValuedFieldPoint wrappers. All elements must come from the same field.

Example

K = PadicField(2, 20)
v = [K(1), K(2), K(3)]
lifted = lift(v)  # Vector{ValuedFieldPoint{2,20,PadicFieldElem}}
source
NonArchimedeanMachineLearning.primeMethod
prime(::Type{ValuedFieldPoint{P,Prec,S}}) where {P,Prec,S}
prime(::ValuedFieldPoint{P,Prec,S}) where {P,Prec,S}

Return the prime of the underlying p-adic field.

This is a compile-time constant available via the type parameter P.

source
NonArchimedeanMachineLearning.unitMethod
unit(x::ValuedFieldPoint)

Extract the unit part of a wrapped valued field element.

For a p-adic number $a = p^v \cdot u$ where $u$ is a p-adic unit, returns the unit $u$.

Delegates to the underlying element's unit part.

source
NonArchimedeanMachineLearning.unwrapMethod
unwrap(x::ValuedFieldPoint)

Extract the underlying field element from a ValuedFieldPoint.

Example

K = PadicField(2, 20)
x = ValuedFieldPoint(K(5))
unwrap(x)  # Returns the PadicFieldElem
source