Ask Your Question

gelatine1's profile - activity

2020-01-27 13:47:54 -0600 received badge  Popular Question (source)
2019-06-08 12:51:35 -0600 received badge  Notable Question (source)
2019-05-28 07:39:33 -0600 received badge  Notable Question (source)
2019-05-04 10:42:38 -0600 asked a question MatrixSpace quotientRings

I'm trying to work with a quotingring of a matrix space. Now I use the following code. But since $n$ is my modulus I expect my second matrix to be equal to $M_1$ in this quotient ring. But it's like its just ignoring the fact that its a quotient ring and it does every computation in MS. What am I doing wrong or is my understanding of quotient rings flawed?

Thanks in advance.

MS = MatrixSpace(ZZ,2,2)

n=MS([[17,19],[11,31]])

R = MS.quotient_ring(MS*n*MS) #or R = MS.quotient_ring(n)
M1 = R([[1,1],[1,1]])

print(M1)

M2 = R(n+M1.lift())

print(M2)

this code gives this as a result

[1 1]
[1 1]

[18 20]
[12 32]
2019-05-04 10:41:57 -0600 asked a question Matrix quotient rings

I'm trying to work with a quotingring of a matrix space. Now I use the following code. But since $n$ is my modulus I expect my second matrix to be equal to $M_1$ in this quotient ring. But it's like its just ignoring the fact that its a quotient ring and it does every computation in MS. What am I doing wrong or is my understanding of quotient rings flawed?

Thanks in advance.

MS = MatrixSpace(ZZ,2,2)

n=MS([[17,19],[11,31]])

R = MS.quotient_ring(MS*n*MS) #or R = MS.quotient_ring(n)
M1 = R([[1,1],[1,1]])

print(M1)

M2 = R(n+M1.lift())

print(M2)
2018-11-29 19:14:27 -0600 received badge  Popular Question (source)
2018-10-19 02:23:40 -0600 received badge  Taxonomist
2018-03-21 09:36:04 -0600 received badge  Popular Question (source)
2017-05-03 09:17:51 -0600 commented question converting linear map to matrix representation

p=5
F.<c>=GF(p^p,modulus=x^p-x-1)
V=[c^i for i in [0..p-1]]
s=c^6+c^3+c^2+1

Now I want to get the coeffecients of s represented to the base V[i], how do i do that

2017-05-02 16:13:58 -0600 asked a question converting linear map to matrix representation

I have a linear map $\alpha$ from $F_{p^n} \longrightarrow F_{p^n}$, where we see $F_{p^n}$ as a vector space over $F_p$ with a $V_i$ as base elements. I want to create the matrix representation for $\alpha$. For that I have to calculate $\alpha(V_i)$ and then write it in the basis $V_i$ to get my values for the matrix. How exactly do I do the last in sage ? For eg. a polynomial ring it's easy because the elements are already written according to its base but in general thats not the case...

2017-04-29 12:39:32 -0600 asked a question field extension not implemented

I'm trying to construct some field extenstions of GF(p), this is what I have

p=5
F=GF(p)
R1.<x> = F['x']
F1.<alpha1> = F.extension(x^p - x - 1)
R2.<x> = F1['x']
F2.<alpha2> = F1.extension(x^p - x - alpha1^(p-1))
R3.<x> = F2['x']
F3.<alpha3> = F2.extension(x^p - x - (alpha1*alpha2)^(p-1))
R4.<x> = F3['x']
F4.<alpha4> = F3.extension(x^p - x - (alpha1*alpha2*alpha3)^(p-1))

It creates F3 like it should but it doesn't create F4. I get a NotImplementedError... What did I do wrong?

2017-04-29 08:43:27 -0600 received badge  Supporter (source)
2017-04-29 08:42:59 -0600 commented answer Chain of fields in sage

I have to construct a chain like that, with 5 different elements. When i use the extend function for the 4th time it gives "NotImplementedError"...

2017-04-28 14:46:46 -0600 asked a question Chain of fields in sage

I would like to construct the field Fp(alpha,beta) where alpha is a root of x^p-x-1 (over Fp[x]) and beta is a root of the polynomial x^p-x-alpha^(p-1) (over Fp(alpha)[x]).

I have tried the following

 F0.<x>=GF(p)['x']
 f1=x^p-x-1
 R1.<alpha1>=F0.quotient(f1)['alpha1']
 F1.<x>=Frac(R1)

 f2=x^p-x-alpha1^(p-1)
 R2.<alpha2>=F1.quotient(f2)['alpha2']
 F2.<x>=Frac(R2)

but I think it creates the field F1 well, but it goes wrong for R2... It also feels like there should be a much more straightforward way to do this in sage. What would be the proper way to do this ?

2014-12-05 09:47:14 -0600 received badge  Student (source)
2014-12-05 09:14:56 -0600 asked a question AttributeError: must give both plot endpoints

I use this piece of code in my project:

print h
print h(3.2)
print parent(h)
plot(h(x) , (-4,4), thickness=2, color='green' )

and this is my output:

2.14250281996159*x + 1.74284059736793
8.59884962124501
Univariate Polynomial Ring in x over Real Field with 53 bits of precision
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_231.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cHJpbnQgaApwcmludCBoKDMuMikKcHJpbnQgcGFyZW50KGgpCnBsb3QoaCh4KSAsICgtNCw0KSwgdGhpY2tuZXNzPTIsIGNvbG9yPSdncmVlbicgKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>

  File "/var/sage/tmp2yTHkg/___code___.py", line 6, in <module>
    exec compile(u"plot(h(x) , (-_sage_const_4 ,_sage_const_4 ), thickness=_sage_const_2 , color='green' )" + '\n', '', 'single')
  File "", line 1, in <module>

  File "/opt/sage/sage-6.3/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 705, in wrapper
    return func(*args, **kwds)
  File "/opt/sage/sage-6.3/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 550, in wrapper
    return func(*args, **options)
  File "/opt/sage/sage-6.3/local/lib/python2.7/site-packages/sage/plot/plot.py", line 1163, in plot
    G = funcs.plot(*args, **original_opts)
  File "polynomial_element.pyx", line 286, in sage.rings.polynomial.polynomial_element.Polynomial.plot (build/cythonized/sage/rings/polynomial/polynomial_element.c:5907)
AttributeError: must give both plot endpoints

Why does this happen ? I have specified my endpoints right? so why is it saying I didn't ? I tried a lot to solve this but i can't get it solved.. anyone who can tell me whats wrong ?

Thanks in advance

2014-11-15 05:08:49 -0600 received badge  Editor (source)
2014-11-15 05:08:18 -0600 asked a question Solving an equation in multiple variables

I have this equation : sqrt((b-a)^2 + (B-A)^2) == A+B and i would like to have it solved to b-a=+- 2 * sqrt(AB) in sage. Right now I have the following code but it doesn't really output what I want. I just get
A^2 - 2AB + B^2 + a^2 - 2ab + b^2 == A^2 + 2AB + B^2
and I don't know how to make sage solve it further.

my code:

var('a,b,c,A,B,C')
eq1 = (sqrt((b-a)^2 + (B-A)^2) == A+B)
(eq1^2).expand()

Thanks in advance