Valued Point
NonArchimedeanMachineLearning.ValuedFieldPoint — Type
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 arithmeticNotes
With this wrapper, ValuationPolydisc{ValuedFieldPoint{P,Prec,S},T,N} knows P at compile time, enabling loop optimizations in hot-path functions.
NonArchimedeanMachineLearning.ValuedFieldPoint — Method
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}(...)NonArchimedeanMachineLearning.ValuedFieldPoint — Method
ValuedFieldPoint{P,Prec}(x::S) where {P,Prec,S}Construct a ValuedFieldPoint with explicit type parameters. Useful when you already know P and Prec.
Base.parent — Method
Base.parent(x::ValuedFieldPoint)Return the parent field of the underlying element.
Base.precision — Method
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.
NonArchimedeanMachineLearning.lift — Method
lift(t::NTuple{N,S}) where {N,S<:PadicFieldElem}Lift a tuple of p-adic field elements to ValuedFieldPoint wrappers.
NonArchimedeanMachineLearning.lift — Method
lift(R::ZZRing, x::S) where S<:PadicFieldElemLift 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)) # ZZRingElemNonArchimedeanMachineLearning.lift — Method
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) # ZZRingElemNonArchimedeanMachineLearning.lift — Method
lift(x::ValuedFieldPoint{P,Prec,S})Scalar lift for ValuedFieldPoint (delegates to underlying element). Provided for consistency with Oscar's lift interface.
NonArchimedeanMachineLearning.lift — Method
lift(v::Vector{S}) where S<:PadicFieldElemLift 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}}NonArchimedeanMachineLearning.prime — Method
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.
NonArchimedeanMachineLearning.unit — Method
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.
NonArchimedeanMachineLearning.unwrap — Method
unwrap(x::ValuedFieldPoint)Extract the underlying field element from a ValuedFieldPoint.
Example
K = PadicField(2, 20)
x = ValuedFieldPoint(K(5))
unwrap(x) # Returns the PadicFieldElemNonArchimedeanMachineLearning.unwrap — Method
unwrap(v::Vector{<:ValuedFieldPoint})Unwrap a vector of ValuedFieldPoints into a vector of underlying elements.
NonArchimedeanMachineLearning.unwrap — Method
unwrap(v::NTuple{N,<:ValuedFieldPoint}) where NUnwrap a tuple of ValuedFieldPoints into a tuple of underlying elements.
NonArchimedeanMachineLearning.valuation — Method
valuation(x::ValuedFieldPoint)Compute the valuation of a wrapped valued field element. Delegates to the underlying element's valuation.