p-adic valuation can be naturally computed for integer factorization objects, but this functionality is currently missing in Sage.
Proposed Solution
I did not check the actual data structure, but if factorization f were a dict mapping primes to their exponents, then valuation(f,p) could be done as f.get(p,0). This further extends to m-adic valuations for not necessary prime m as min( f.get(p,0)//k for p,k in factor(m) ) or alike. It can further extended to non-integer factorization objects.
Alternatives Considered
It is possible to compute valuation( f.value(), p ) but getting the factorization product value is slow and should be avoided whenever possible (which is the case for valuations).
Additional Information
No response
Is there an existing issue for this?
[X] I have searched the existing issues for a bug report that matches the one I want to file, without success.
Problem Description
p
-adic valuation can be naturally computed for integer factorization objects, but this functionality is currently missing in Sage.Proposed Solution
I did not check the actual data structure, but if factorization
f
were adict
mapping primes to their exponents, thenvaluation(f,p)
could be done asf.get(p,0)
. This further extends tom
-adic valuations for not necessary primem
asmin( f.get(p,0)//k for p,k in factor(m) )
or alike. It can further extended to non-integer factorization objects.Alternatives Considered
It is possible to compute
valuation( f.value(), p )
but getting the factorization product value is slow and should be avoided whenever possible (which is the case for valuations).Additional Information
No response
Is there an existing issue for this?