Ask Your Question

tzeentch's profile - activity

2024-02-15 15:02:00 +0100 received badge  Notable Question (source)
2024-02-15 15:02:00 +0100 received badge  Popular Question (source)
2023-10-02 11:52:50 +0100 received badge  Notable Question (source)
2023-08-28 23:54:28 +0100 received badge  Famous Question (source)
2023-03-26 22:09:33 +0100 asked a question How to solve for coefficients in a Quotient ring?

How to solve for coefficients in a Quotient ring? I'm finding that the solve function doesn't take into account the quot

2023-02-14 20:51:44 +0100 received badge  Notable Question (source)
2023-02-14 20:51:44 +0100 received badge  Popular Question (source)
2022-10-14 19:07:35 +0100 received badge  Notable Question (source)
2022-05-16 04:42:07 +0100 received badge  Famous Question (source)
2022-01-01 12:20:49 +0100 received badge  Popular Question (source)
2021-09-14 06:49:48 +0100 asked a question How to access magma interface within sage when path is broken?

How to access magma interface within sage when path is broken? I am trying to call magma from within sage, and am not ab

2021-06-29 15:16:51 +0100 received badge  Popular Question (source)
2021-04-26 08:26:25 +0100 received badge  Self-Learner (source)
2021-04-26 08:26:25 +0100 received badge  Teacher (source)
2021-04-26 00:48:13 +0100 edited answer How to express the coefficients of an iterated group action on a basis as a matrix?

Just in case this is helpful for anyone else, here is the functional code answering my original question: R.<y1, y2

2021-04-26 00:41:09 +0100 answered a question How to express the coefficients of an iterated group action on a basis as a matrix?

Just in case this is helpful for anyone else, here is the functional code answering my original question: R.<y1, y2

2021-04-26 00:23:14 +0100 marked best answer How to express the coefficients of an iterated group action on a basis as a matrix?

I have a basis $(b_i)_{i \in I} = (1, y_1, y_2, y_1^2, y_1y_2, y_2^2, y_1^2y_2, y_1y_2^2, y_1^2y_2^2)$, and a group action $g$ on that basis, where $g$ acts by:

$g(y_1) = y_1+1$, and $g(y_2) = y_2-y_1^2-y_1$.

For each basis element $b_i$, I want the array $(b_i, g(b_i), g^2(b_i), ..., g^8(b_i))$. I want to see the dimension of the vector space spanned by those values.

My first and foremost question is as follows: How can I get sage to put the coefficients of the array of polynomials (in a quotient ring) into columns of a matrix?

I can't seem to get sage to spit out the coefficients at all! I tried S(b_i).coefficients() and S(b_i).list(), and I got AttributeError: 'QuotientRing_generic_with_category.element_class' object has no attribute 'coefficients'

Here is my code for context:

R.<y1, y2> = PowerSeriesRing(GF(3), default_prec = 5)
I = R.ideal(y1^3, y2^3)
S = R.quotient_ring(I)
#defining the group action
g(y1) = y1 + 1
h(y2) = y2 - y1^2 - y1

#defining the basis
b1(y1,y2)= y1
b2(y1,y2)= y1^2
b3(y1,y2)= y1*y2
b4(y1,y2)= y2
b5(y1,y2)= y2^2
b6(y1,y2)= y1^2*y2
b7(y1,y2)= y1*y2^2
b8(y1,y2)= y1^2*y2^2

Secondly, how can I more concisely run the iteration itself? Here is how I implemented an iterated group action on a basis element. I list only the $b_4$ example for readability, the others are the same but with $b_i$

g1b4(y1, y2) = b4(g(y1), h(y2)).expand()
g2b4(y1, y2) = g1b4(g(y1), h(y2)).expand()
g3b4(y1, y2) = g2b4(g(y1), h(y2)).expand()
g4b4(y1, y2) = g3b4(g(y1), h(y2)).expand()
g5b4(y1, y2) = g4b4(g(y1), h(y2)).expand()
g6b4(y1, y2) = g5b4(g(y1), h(y2)).expand()
g7b4(y1, y2) = g6b4(g(y1), h(y2)).expand()
g8b4(y1, y2) = g7b4(g(y1), h(y2)).expand()
g9b4(y1, y2) = g8b4(g(y1), h(y2)).expand()
print(S(g1b4))
print(S(g2b4))
print(S(g3b4))
print(S(g4b4))
print(S(g5b4))
print(S(g6b4))
print(S(g7b4))
print(S(g8b4))
print(S(g9b4))

Edit: I also realized that for $b_3$, the output of iteration has $y_1^3$ in it, even though we are considering its image in the quotient ring. How could this be happening?

2021-04-24 23:39:51 +0100 edited question How to express the coefficients of an iterated group action on a basis as a matrix?

How to express the coefficients of an iterated group action on a basis as a matrix? I have a basis $(b_i)_{i \in I} = (1

2021-04-24 23:39:47 +0100 edited question How to express the coefficients of an iterated group action on a basis as a matrix?

How to express the coefficients of an iterated group action on a basis as a matrix? I have a basis $(b_i)_{i \in I} = (1

2021-04-24 23:33:18 +0100 commented answer How to express the coefficients of an iterated group action on a basis as a matrix?

If I understand correctly, your code outputs one matrix: (g(e)) for each e in E, that is: (g(1), g(y1), g(y1^2), ...., g

2021-04-24 23:30:29 +0100 commented answer How to express the coefficients of an iterated group action on a basis as a matrix?

If I understand correctly, your code outputs (g(e)) for each e in E, that is: (g(1), g(y1), g(y1^2), ...., g(y1^2y2^2)),

2021-04-24 22:16:43 +0100 edited question How to express the coefficients of an iterated group action on a basis as a matrix?

How to express the coefficients of an iterated group action on a basis as a matrix? I have a basis $(b_i)_{i \in I} = (1

2021-04-24 22:16:30 +0100 edited question How to express the coefficients of an iterated group action on a basis as a matrix?

How to express the coefficients of an iterated group action on a basis as a matrix? I have a basis $(b_i)_{i \in I} = (1

2021-04-24 22:13:36 +0100 marked best answer Why am I getting a type error when I attempt to take the projective closure of this intersection?

I am attempting to take the projective closure of the intersection of the following affine polynomials (not the intersection of the closure!):

$$y^3-y-x^2= 0 $$ $$w^3-w+y^7-y^5-x^4y^3+x^4y = 0.$$

This affine intersection is a curve of dimension one. Unfortunately, I haven't been able to enter this lovely affine curve defined by this intersection into sage. When I attempt as follows:

A.<x,y,w> = AffineSpace(QQ, 3)
P.<u,v,t,s>=ProjectiveSpace(QQ,3)
C = Curve([y^3-y-x^2, w^3-w+y^7-y^5-x^4*y^3+x^4*y], A)
D=C.projective_closure(1,P)

I get an error at the definition of C due to the second polynomial:

TypeError:  F (=[-x^4*y^3 + y^7 + x^4*y - y^5 + w^3 - w]) must be a list or tuple of polynomials of the coordinate ring of A (=Affine Space of dimension 3 over Finite Field of size 3)

I am so confused because this is absolutely in the coordinate ring of $A$. Why am I getting this type error? How can I enter this affine intersection into sage, so that I may take its closure?


As an aside, I can enter the intersection of the closure, which is not what I want, as follows:

x,y,z,w = GF(3)['x,y,z,w'].gens()
C = Curve([y^3-y*z^2-x^2*z, w^3*z^4-w*z^6+y^7-y^5*z^2-x^4*y^3+x^4*y*z^2]); C

The intersection of the closure has an extra irreducible component $[x: 0: w: 0]$,

2021-04-24 21:56:38 +0100 asked a question How to express the coefficients of an iterated group action on a basis as a matrix?

How to express the coefficients of an iterated group action on a basis as a matrix? I have a basis $(b_i)_{i \in I} = (1

2021-04-24 21:20:29 +0100 received badge  Popular Question (source)
2021-04-01 05:08:59 +0100 asked a question Why am I getting a type error when I attempt to take the projective closure of this intersection?

Why am I getting a type error when I attempt to take the projective closure of this intersection? I am attempting to tak

2021-02-07 20:01:27 +0100 marked best answer How can I compose 2 power series in one variable with their compositional inverse get a power series in two variables?

I would like to compose a power series $\ell$ defined in $x$ to get a power series $\ell^{-1}(\ell(x) + \ell(y))$ as a power series $f(x, y)$ in two variables, $x$ and $y$. In the code below I call l := $\ell$, and e := $\ell^{-1}$.

PREC = 20    
R.<x, y> = PowerSeriesRing( QQ, default_prec=PREC )
f = exp( 1/3 * log( 1-x^3 ) )
print f
w = 1/f
l = w.integral(x)
e = l.reverse() 
g = e(l(x) + l(y)) ??

I find immediately the following issue, let alone the issue of composing:

e = l.reverse()
AttributeError: 'MPowerSeriesRing_generic_with_category.element_class' object has no attribute 'reverse'

Once I have this two variable power series $f(x, y)$, I would like to output $f(x, (f(x, ..., f(x,x)))$, composed with itself $n$-times for a natural number $n$.

2021-02-07 20:01:18 +0100 received badge  Popular Question (source)
2021-02-07 20:00:38 +0100 commented answer Dedekind Zeta function of cyclotomic field wrongly evaluating to zero on -1?

So the value of KL(-1) is indeed zero. This is very troubling! Thank you.

2021-02-06 23:44:49 +0100 asked a question Dedekind Zeta function of cyclotomic field wrongly evaluating to zero on -1?

Let $K := \mathbb{Q}(\zeta)$ be the pth cyclotomic extension of $\mathbb{Q}$. I would like to verify the results of a paper which states the quotient of their Dedekind zeta functions have particular values. Below Z is the Riemann zeta function (Dedekind zeta function of $\mathbb{Q}$).

x = var('x')
K = NumberField(x**2 + x + 1,'a')
L = K.zeta_function(algorithm='gp')
Z = Dokchitser(conductor=1, gammaV=[0], weight=1, eps=1, poles=[1], residues=[-1], init='1')

The expected values are nonzero! For example. (L/Z)(-1) is expected to be 1.333333333 (i.e. 4/3).

L(-1) returns 0.000000000000000, as does L(-1)/Z(-1).

Z(-1) returns -0.0833333333333333. L/Z returns a type error, as does L(x)/Z(x).

Here is my first question: Have I incorrectly implemented the Dedekind Zeta function of a cyclotomic number field? Why is L(-1) = 0?

Here is my second question: How do I implement the evaluation of the L-series after I've taken their quotient? That is, A = L/Z, A(-1); instead of L(-1)/Z(-1).

2020-12-09 13:37:42 +0100 received badge  Notable Question (source)
2020-09-14 03:46:36 +0100 asked a question How to implement Hensel's Lemma recursion?

I am trying to automate a Hensellian lift calculation.

S.u> = PolynomialRing(GF(5))
L.<x> = PolynomialRing(S)
f = x^5 + u*x^2 - u*x
a0 = 2
k = 50
for n in range (0, k):
 **a(n+1) = f(an).truncate(n+1)**
Name = "a" + str(k)
print eval(Name)

In particular, I am stuck on implementing the ** step in a for-loop, or plugging a function into itself, as eval doesn't work to type change from string to integer when you are using it to define a variable. Does anyone know how to get around this or have a suggestion?

I tried to instead use a seperate function, but the same issue arises.

def henselstep(step, input):
  return (step+1, f(input).truncate(n+1))

for n in range (0, 2):
  astr = "a" + str(n)
  avar = eval(astr)
  henselstep(n, avar)
  henselstep(henselstep(n, avar)) ???

But again, it isn't quite right, ack! I don't know how to handle the recursion and I'm banging my head on the wall, it must be simple but I keep getting it slightly wrong. Thank you very much for your time.

2020-04-24 03:03:07 +0100 marked best answer How to truncate a power series in two variables?

I would like to truncate power-series by setting $y$ to 0, in order to express $y = x^3 - xy^2$ as a power series in $x$ by recursively plugging in the equation for $y$, then truncating.

R.<x, y> = PowerSeriesRing(QQ, default_prec = 20)
f = x^3 + x*y^2
j = f(x, f(x, f(x, f(x, f(x,y))))).expand()
j + O(y)
---------------------------------------------------------------------------
ArithmeticError                           Traceback (most recent call last)
<ipython-input-20-fe9380f2a091> in <module>()
----> 1 j + O(y)

/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/big_oh.py in O(*x, **kwds)
    154     elif hasattr(x, 'O'):
    155         return x.O(**kwds)
--> 156     raise ArithmeticError("O(%s) not defined" % (x,))

ArithmeticError: O(y) not defined

I have found that other variants, such asj + O(x, y)^{31}, j.truncate(31), and j + R.O(31) also do not work.

2020-04-24 03:00:38 +0100 asked a question How to base change from a PolynomialRing to that Ring with one variable evaluated, i.e., from Q[x,y] to Q[x,y]/(x=0) = Q[y]?

I am trying to base change a Laurent series ring element from its base ring, Q[u1, u2, u3], to a quotient of its base ring, Q[u2, u3], but I am quite confused in forming this quotient. My setting is this:

S.<u1,u2,u3> = QQ[]
L.<z> = LaurentSeriesRing(S);
f = -4*z - 4/5*u1*z^5 + (-4/9*u1^2 - 8/9*u2)*z^9 + (-4/13*u1^3 - 24/13*u1*u2 - 12/13*u3)*z^13 + (-4/17*u1^4 - 48/17*u1^2*u2 - 24/17*u2^2 - 48/17*u1*u3 + 16/17*u1 + 16/17*u2 + 16/17*u3 + 16/17)*z^17 + O(z^20)

In other words, I wish to set u1 = 0, and look at f over that ring. I tried the following two things, which spit out f unchanged.

f.change_ring(S.quo(u1))

R = S.quotient(u1)
f.change_ring(R)

I also tried the following which gives an attribute error:

f.reduce(u1)

I am completely stuck and would deeply appreciate any help. I would also like to eventually set u2 = 0 and look at f over that ring, which I mention at the off chance that this changes the answer at all.

2020-04-20 01:34:51 +0100 received badge  Notable Question (source)
2020-04-19 20:54:05 +0100 commented answer Why is sage not recognizing symmetric polynomials as symmetric?

Ah! Thank you very much.

2020-04-19 05:36:04 +0100 asked a question Why is sage not recognizing symmetric polynomials as symmetric?

I am trying to decompose symmetric polynomials into polynomial combinations of elementary symmetric polynomials. It has been driving me absolutely up the wall, and I would be very grateful for any help.

It works perfectly with 2 variables.

S.<x0,x1>=QQ[]
f = (x0-x1)*(x1-x0)
Sym = SymmetricFunctions(QQ)
g = Sym.from_polynomial(f)
print g

For 3 variables it fails. Sage throws a type error and says the polynomial f is not symmetric, even though it is certainly invariant under the action of the symmetric group of order 3.

S.<x0,x1,x2>=QQ[]
f = (x0-x1)*(x1-x2)*(x2-x0)
Sym = SymmetricFunctions(QQ)
g = Sym.from_polynomial(f)
print g

The type error is as folliows:

/sage/combinat/sf/sf.pyc in from_polynomial(self, f)
   1372             ValueError: x0 + 2*x1 + x2 is not a symmetric polynomial
   1373         """
-> 1374         return self.m().from_polynomial(f)
   1375 
   1376     def register_isomorphism(self, morphism, only_conversion=False):

However, the following does not throw a type error, perhaps because it is a linear combination of the elementary basis rather than a polynomial one. I don't understand what is going on. Why is this type error being triggered for a valid symmetric polynomial? Thank you very much for your time.

S.<x0,x1,x2>=QQ[]
f = (x0+x1)*(x1+x2)*(x2+x0)
Sym = SymmetricFunctions(QQ)
g = Sym.from_polynomial(f)