ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 10 Sep 2019 04:41:54 -0500$p$-adic extension of $n$th root of unity.http://ask.sagemath.org/question/47812/p-adic-extension-of-nth-root-of-unity/I have used the following command to define the 5-adic Unramified extension ring in c defined by the polynomial $x^3 + 3x + 3$:
Sage: R.<c> = zq(125, prec=20)
Now, I want to find all the $n$th root of unity in this ring for $n$ dividing $124$. I dont know, how the $n$-th roots are implemented. Kindly help me with this.
Thank you.GA316Tue, 10 Sep 2019 04:41:54 -0500http://ask.sagemath.org/question/47812/How to define $\mathbb{Q}_p(\sqrt{5})$ and $\mathbb{Q}_p (\sqrt{5} ,\sqrt{3})$ and find their valuation rings for $p=7$?http://ask.sagemath.org/question/45695/how-to-define-mathbbq_psqrt5-and-mathbbq_p-sqrt5-sqrt3-and-find-their-valuation-rings-for-p7/I tried finite extension $\mathbb({Q}_p$ I unable do it. It will also great if help me with how to define the valuation ring of that finite extensionSunil pasupulatiWed, 06 Mar 2019 22:03:29 -0600http://ask.sagemath.org/question/45695/i want to find factorization ideal (3) in integral closure of Z_3 in Q_3(sqrt(2),sqrt(3))http://ask.sagemath.org/question/44067/i-want-to-find-factorization-ideal-3-in-integral-closure-of-z_3-in-q_3sqrt2sqrt3/ my problem is to define Q_3(sqrt(2),sqrt(3))
ii)find factorization of ideal
Sunil pasupulatiThu, 25 Oct 2018 03:48:56 -0500http://ask.sagemath.org/question/44067/Algorithm for finding a defining polynomial for an unramified extension?http://ask.sagemath.org/question/42575/algorithm-for-finding-a-defining-polynomial-for-an-unramified-extension/ I wanted to know by what algorithm sage finds a defining polynomial of an unramified extension of p-adic numbers?mathjainTue, 12 Jun 2018 15:38:01 -0500http://ask.sagemath.org/question/42575/programming of looping to print selected value of mhttp://ask.sagemath.org/question/35264/programming-of-looping-to-print-selected-value-of-m/I have the following code for m=1:
Qp=pAdicField(13)
E=EllipticCurve(Qp,[0,0,0,-3267,45630]); E
P=E([-21,324]);P
p=13;p #because I am working 13-adically
R=12104*1*P;R #m=1
S=-2*P;S
Q=R+S;Q
(12 + 8*13 + 5*13^2 + 10*13^3 + 10*13^4 + O(13^5) : 9 + 3*13 + 6*13^2 + 13^3 + 5*13^4 + 2*13^5 + O(13^5) : 1 + O(13^5))
x=Q[0];x
12 + 8*13 + 5*13^2 + 10*13^3 + 10*13^4 + O(13^5)
y=Q[1];y
9 + 3*13 + 6*13^2 + 13^3 + 5*13^4 + O(13^5)
W=(81*x^16 + 40662*x^15 + 14353281*x^14 - 460241028*x^13 - 644722959186*x^12 + 39379675354740*x^11 + 5212980804862026*x^10 - 415546630058854656*x^9 - 8202010485984353739*x^8 + 1396767997483732402758*x^7 - 27550698906220673513787*x^6 - 1044392234943529703379852*x^5 + 60770398462922893831446348*x^4 - 1284453663719469166478575296*x^3 + 14183844641879715988450074288*x^2 - 81800517874945025246941522368*x + 196162341839727571433321441856)- (3240*x^14 + 456840*x^13 + 188268624*x^12 - 45834271200*x^11 - 2435651997264*x^10 + 682353767281968*x^9 - 7053953405575680*x^8 - 2553415737499629216*x^7 + 98906717445152189544*x^6 + 1348117411901578667784*x^5 - 162666175355778441465360*x^4 + 4276857451171442758058304*x^3 - 54456600108308451946891776*x^2 + 350065581968511893813480064*x - 918312303919436410092339456)*y;W
2 + 4*13 + 3*13^2 + 11*13^3 + 11*13^4 + O(13^5)
D=W[0];D
2
T=kronecker(D,p);T
-1
So in this example I reject m=1 because T=-1. So basically I want to do a loop for m=1,2,...,10, and everytime T=-1 I will reject that value of m and only leave set of numbers of m=[2,..10] that gives T=1. I tried doing the coding to work but it keeps giving error regarding the "m" value. I did something like this
Qp=pAdicField(13)
E=EllipticCurve(Qp,[0,0,0,-3267,45630]); E
P=E([-21,324]);P
p=13;p #because I am working 13-adically
R=12104*m*P;R #I use a general m which I will define later that m=1,2,...,10
S=-2*P;S
Q=R+S;Q
x=Q[0];x
y=Q[1];y
W=(81*x^16 + 40662*x^15 + 14353281*x^14 - 460241028*x^13 - 644722959186*x^12 + 39379675354740*x^11 + 5212980804862026*x^10 - 415546630058854656*x^9 - 8202010485984353739*x^8 + 1396767997483732402758*x^7 - 27550698906220673513787*x^6 - 1044392234943529703379852*x^5 + 60770398462922893831446348*x^4 - 1284453663719469166478575296*x^3 + 14183844641879715988450074288*x^2 - 81800517874945025246941522368*x + 196162341839727571433321441856)- (3240*x^14 + 456840*x^13 + 188268624*x^12 - 45834271200*x^11 - 2435651997264*x^10 + 682353767281968*x^9 - 7053953405575680*x^8 - 2553415737499629216*x^7 + 98906717445152189544*x^6 + 1348117411901578667784*x^5 - 162666175355778441465360*x^4 + 4276857451171442758058304*x^3 - 54456600108308451946891776*x^2 + 350065581968511893813480064*x - 918312303919436410092339456)*y;W
D=W[0];D
T=kronecker(D,p);T
for m in range(10) :
if T == 1:
print(m)
Unfortunately, the programming is not working, keeps giving error for `m`.
By the way, I got the following code working on PARI, but I prefer to use SAGE. Is there a way to get the coding to work on SAGE too.
for(m=1,10,R=12104*m*P;p=13;x=R[1];y=R[2]; W=(81*x^16 + 40662*x^15 + 14353281*x^14 - 460241028*x^13 - 644722959186*x^12 + 39379675354740*x^11 + 5212980804862026*x^10 - 415546630058854656*x^9 - 8202010485984353739*x^8 + 1396767997483732402758*x^7 - 27550698906220673513787*x^6 - 1044392234943529703379852*x^5 + 60770398462922893831446348*x^4 - 1284453663719469166478575296*x^3 + 14183844641879715988450074288*x^2 - 81800517874945025246941522368*x + 196162341839727571433321441856)- (3240*x^14 + 456840*x^13 + 188268624*x^12 - 45834271200*x^11 - 2435651997264*x^10 + 682353767281968*x^9 - 7053953405575680*x^8 - 2553415737499629216*x^7 + 98906717445152189544*x^6 + 1348117411901578667784*x^5 - 162666175355778441465360*x^4 + 4276857451171442758058304*x^3 - 54456600108308451946891776*x^2 + 350065581968511893813480064*x - 918312303919436410092339456)*y;q=lift(W);a=q*(denominator(q))^2;if(kronecker(a,p)<0, print1(m "\t")))ShaThu, 27 Oct 2016 05:10:22 -0500http://ask.sagemath.org/question/35264/change p-adic precision in elliptic curvehttp://ask.sagemath.org/question/35262/change-p-adic-precision-in-elliptic-curve/ I have the following code
Qp=pAdicField(13)
E=EllipticCurve(Qp,[0,0,0,-3267,45630]); E
P=E([-21,324]);P
and I get answer for point P
(5 + 11*13 + 12*13^2 + 12*13^3 + 12*13^4 + 12*13^5 + 12*13^6 + 12*13^7 + 12*13^8 + 12*13^9 + 12*13^10 + 12*13^11 + 12*13^12 + 12*13^13 + 12*13^14 + 12*13^15 + 12*13^16 + 12*13^17 + 12*13^18 + 12*13^19 + O(13^20) : 12 + 11*13 + 13^2 + O(13^20) : 1 + O(13^20))
How to change the precision of the power of 13. I am only interested up to O(13^4)ShaThu, 27 Oct 2016 04:31:26 -0500http://ask.sagemath.org/question/35262/Coding p-adic Newton's method to solve polynomials?http://ask.sagemath.org/question/32608/coding-p-adic-newtons-method-to-solve-polynomials/ I'm confused as to how to code the p-adic Newton's method in order to solve polynomials, and specifying solutions to a specific number of p-adic digits. Any help?veryconfusedSat, 20 Feb 2016 13:54:57 -0600http://ask.sagemath.org/question/32608/Can't construct automorphisms of p-adic fieldshttp://ask.sagemath.org/question/29390/cant-construct-automorphisms-of-p-adic-fields/ I'm trying to construct automorphisms of finite extensions of $\mathbb Q_p$ and getting a funny error. Here's a prototypical example:
Evaluating the cyclotomic polynomial $x^4 + x^3 + x^2 + x + 1$ at $x+1$ gives an Eisenstein polynomial for the prime $p=5$. If $\pi$ is a root of $(x+1)^4 + (x+1)^3 + (x+1)^2 + (x+1) + 1$ then $\pi+1$ will be a primitive 5th root of unity.
K.<pi> = Qp(5).ext(sum((1+x)^i for i in range(5)))
So $K=\mathbb Q_p(\zeta_5)$ with uniformizer $\pi=\zeta_5-1$. Now I want to define the automorphism $\tau:\zeta_5\mapsto\zeta_5^2$. We have $\tau(\pi)=(1+\pi)^2-1=2\pi+\pi^2$. But the following
tau = K.hom([2*pi+pi^2])
results in the error `TypeError: images do not define a valid homomorphism`. What's going on? Are `hom`'s of $p$-adic fields not really implemented yet or am I doing something wrong?siggytmWed, 02 Sep 2015 17:40:36 -0500http://ask.sagemath.org/question/29390/Finding p-adic valuations in high degree cyclotomic fieldshttp://ask.sagemath.org/question/26900/finding-p-adic-valuations-in-high-degree-cyclotomic-fields/I'm looking at a cyclotomic field ${\bf Q}(\mu_{p(p-1)})$ for $p$ a prime around 50 and so this field has fairly large degree. In this field, $p$ has ramification index $p$ and has $p-1$ primes sitting above it.
I'm trying to compute the valuation of an element in this field at any of these primes above $p$. Using commands like "primes_above" won't seem to work as the computer just hangs presumably because this extensions degree is just too big.
Questions:
1) Is there another way to compute $p$-adic valuations in this field?
2) Locally, this is only a $p$-th degree extension of ${\bf Q}_p$. So I created a p-adic field by using pAdicField(p).ext(1+(x+1)+(x+1)^2+...+(x+1)^(p-1)) to create this local p-th degree extension of Q_p. However, I can't find any way to map my global elements in ${\bf Q}(\mu_{p(p-1)})$ to this local field. Any ideas on how to proceed along these lines?
Robert PollackWed, 20 May 2015 08:47:43 -0500http://ask.sagemath.org/question/26900/Echelon form of matrix with coefficients in Zphttp://ask.sagemath.org/question/25142/echelon-form-of-matrix-with-coefficients-in-zp/I was wondering if there was a way to find the echelon form of a matrix with coefficients in Zp with sage? I tried
<pre><code>Matrix(Zp(5), 3, 3, [1..9]).echelon_form()</code></pre>
but this gives a NotImplementedError as echelon_form is not implemented over generic non-exact rings at present. I would also very much like the transformation matrix used to get to echelon form if possible.hypercubeFri, 05 Dec 2014 10:10:06 -0600http://ask.sagemath.org/question/25142/how to a p-adic expansion of a rational function in sage?http://ask.sagemath.org/question/23429/how-to-a-p-adic-expansion-of-a-rational-function-in-sage/http://www.maplesoft.com/support/help/Maple/view.aspx?path=padic/orderp
there are more function about p-adic number than maple,but maple has some about p-adic function field,
why not "copy" it?cjshWed, 16 Jul 2014 01:29:12 -0500http://ask.sagemath.org/question/23429/is multiplicative group of Q5 right?http://ask.sagemath.org/question/10574/is-multiplicative-group-of-q5-right/
K = Qp(5, print_mode='digits')
C1=CartesianProduct(ZZ,Integers(4));C1
Cartesian product of Integer Ring, Ring of integers modulo 4
C2=CartesianProduct(C1,Z5);C2
Cartesian product of Cartesian product of Integer Ring, Ring of integers modulo 4, 5-adic Ring with capped relative precision 20
C2.is_ring();cjshSat, 14 Dec 2013 20:17:36 -0600http://ask.sagemath.org/question/10574/why Z5 in Qp different with Zp(5)http://ask.sagemath.org/question/10832/why-z5-in-qp-different-with-zp5/K = Qp(5, print_mode='digits')
Z5 = K.integer_ring();Z5;Z5;Z5 ==Zp(5)
5-adic Ring with capped relative precision 20
5-adic Ring with capped relative precision 20
FalsecjshSat, 14 Dec 2013 20:12:15 -0600http://ask.sagemath.org/question/10832/Maximal unramified extension of Qphttp://ask.sagemath.org/question/7970/maximal-unramified-extension-of-qp/Hello,
is it possible to deal with the maximal unramified extension of Qp in Sage?
If so, then please post a code example! Thanks!
Bye
Larslars.tennstedtMon, 11 Nov 2013 03:46:00 -0600http://ask.sagemath.org/question/7970/Roots of p-adic polynomialshttp://ask.sagemath.org/question/10695/roots-of-p-adic-polynomials/Hello again,
I want to get the roots of a p-adic polynomial. I wrote the following code:
p = 2
q = 4
K = Qp(p)
L.<omega> = Qq(q)
O_L = L. integer_ring()
pi = L.uniformizer()
q = L.residue_class_degree()
f = X^q + pi*X
f.roots()
This rises following error:
NotImplementedError: root finding for this polynomial not implemented
I still use version 5.10 of Sage. The compile of the latest version 5.12 is ongoing. Do I miss something or is there no way to get the roots in this case?
Will this be implemented in the future or does someone know a workaround?
Thanks for your time again!
Bye
Lars
lars.tennstedtMon, 04 Nov 2013 07:54:57 -0600http://ask.sagemath.org/question/10695/p-adic power serieshttp://ask.sagemath.org/question/10688/p-adic-power-series/Hello,
I am new to Sage and I want to to do some math on p-adic power series. I want to
define such a power series but I did not succeeded. The last line of the
following code rises an exception:
p = 2
q = 4
K = Qp(p)
L.<omega> = Qq(q)
O_L = L.integer_ring()
R.<X> = PowerSeriesRing(O_L)
pi = L.uniformizer()
q = L.residue_class_degree()
f(X) = X^q + pi*X
**TypeError: unsupported operand parent(s) for '*': '2-adic Field with capped
relative precision 20' and 'Symbolic Ring'**
Can someone help me, please? Thanks for your time!
Bye
Larslars.tennstedtSat, 02 Nov 2013 23:23:41 -0500http://ask.sagemath.org/question/10688/Artin decomposition for p-adic numbershttp://ask.sagemath.org/question/10663/artin-decomposition-for-p-adic-numbers/How can I decompose a p-adic number
... d_2 d_1 d_0. d_{-1} ... d_{-k}
into its integer part
d_2 d_1 d_0.
and fractional part
. d_{-1} ... d_{-k} ?
The does not seem to exist a kind of floor function.
Klaus ScheicherSat, 26 Oct 2013 21:06:49 -0500http://ask.sagemath.org/question/10663/what PI and e in p-adic number?http://ask.sagemath.org/question/10631/what-pi-and-e-in-p-adic-number/what PI and e in p-adic number?cjshSat, 19 Oct 2013 21:04:09 -0500http://ask.sagemath.org/question/10631/is there a field name Cp(above bar) in p-adic ?http://ask.sagemath.org/question/10630/is-there-a-field-name-cpabove-bar-in-p-adic/is there a field name Cp(above bar) in p-adic ?cjshSat, 19 Oct 2013 21:00:20 -0500http://ask.sagemath.org/question/10630/Solving polynomial equations over p-adic fieldshttp://ask.sagemath.org/question/9860/solving-polynomial-equations-over-p-adic-fields/Hi - as usual I fear my naiv-IT is coming to the fore here, but I have been going around in circles on this for 3 days and I need help please!!
There are 2 basic questions arising from the same thing:
(1) Is "solve" supposed to be implemented for p-adic numbers at all? I can get solutions to things in finite fields but when I try to "lift" them using O(p^n) etc it all goes wrong.
(2) Quite apart from that, why can I not use "solve" using the "variables" (for which I want solutions) as the indeterminates in a polynomial ring over which the equations are already defined? For example, if I define my polynomial ring via:
sage: R.<X> = Zq(3^4,2);
sage: RAB.< a,b> = R[];
and if I then try
sage: solve([a+b==6,a-b==2],[a,b])
it tells me that "a is not a valid variable".GaryMakWed, 27 Feb 2013 11:56:26 -0600http://ask.sagemath.org/question/9860/p-adic field as a vector space?http://ask.sagemath.org/question/10302/p-adic-field-as-a-vector-space/Hello!
Is there an equivalent of absolute(or relative)_vector_space for p-adic fields?
I couldn't find anything! If not, is there any other way to realize a p-adic field extension as a vector space (over Q, but even over Q_p)?
I'm trying to use linear_dependence in particular.
Actually my main goal is to do something like what algdep does, but that command only seem to work for Q_p and not any extension!
I apologize for being an absolute illiterate with computers which shall show itself sooner or later!bamirSun, 30 Jun 2013 16:27:43 -0500http://ask.sagemath.org/question/10302/extracting digits in p-adic expansionhttp://ask.sagemath.org/question/9335/extracting-digits-in-p-adic-expansion/Here is a maybe naive question.
I am working over an unramified extansion of $\mathbb{Z}_p$ (let say of degree 2), say R.(c) = Zq(7^2) so that every element of R is written as ($a_0$ *c + $b_0$) + ($a_1$ *c + $b_1$) *7 + ($a_2$*c + $b_2$)*7^2 + $\ldots$ .
Is there a command to extract each of the $a_i$ or $b_i$ individually ?A MTue, 15 Jan 2013 03:20:05 -0600http://ask.sagemath.org/question/9335/is_square in p-adicshttp://ask.sagemath.org/question/9648/is_square-in-p-adics/I need to find whether a given (often somewhat complicated) dyadic field contains $i$. I tried to use `is_square` method, but I'm getting error reports.
Consider the following (very simplified) example:
> `Q2 = Qp(2); Q2(-1).is_square()`
As far as good - the answer is `False` as expected. So try a simple extension:
> `F.<a> = Qq(2^3); F(-1).is_square()`
And... I'm getting an error message:
> AttributeError: 'sage.rings.padics.padic_ZZ_pX_CR_element.pAdicZZpXCRElement' object has no attribute 'residue'
Is this a Sage bug or I'm doing something wrong?
pkoprowskiSun, 23 Dec 2012 03:24:53 -0600http://ask.sagemath.org/question/9648/Need correct root finding over the p-adicshttp://ask.sagemath.org/question/8015/need-correct-root-finding-over-the-p-adics/I have a restricted power series $f(t)$ defined over the p-adic integers (*restricted* means that the coefficients converge to 0). In practice when one sets a precision for the p-adics this power series turns into a polynomial. I want to be able to compute the p-adic integer roots of $f(t)$. More precisely I want an algorithm whose output is a set of disjoint p-adic balls $B_i$ with associated multiplicities $m_i$ subject to the following conditions:
1. The power series f has no zeros outside the union of the balls;
2. If a ball $B$ has multiplicity 1, then there exists a single root of f in $B$;
3. If a ball $B$ has multiplicity m>1, then there can be at most m roots of f in $B$;
4. The total area covered by the balls goes to zero as the precision that we choose goes to infinity.
My attempt to solve this problem using Sage was to use the roots() function, however this function does not satisfy condition 2. For example consider:
R = Zp(3)
P.<x> = R['x']
zero = R.zero().add_bigoh(2)
poly = (1+zero)*x**2+(3+zero)*x + zero
poly.roots()
The output is `[(2*3 + O(3^2), 1), (O(3^2), 1)]` and it should have been `[(O(3),2)]`. My question is, is there an easy way to get the described functionality in Sage, or do I have to write everything from scratch?
Thank you for the responses,Tzanko MatevMon, 21 Mar 2011 03:34:32 -0500http://ask.sagemath.org/question/8015/