Ask Your Question

geo909's profile - activity

2019-10-16 19:18:07 +0200 received badge  Famous Question (source)
2017-10-08 22:24:36 +0200 received badge  Notable Question (source)
2017-04-27 10:10:49 +0200 received badge  Famous Question (source)
2016-07-07 07:16:00 +0200 received badge  Popular Question (source)
2016-07-07 07:16:00 +0200 received badge  Notable Question (source)
2016-06-08 18:07:56 +0200 received badge  Popular Question (source)
2014-02-18 19:05:35 +0200 commented answer Save and retrieving my data

From a first look, it seems that this is probably what I was asking for in the first place.

2014-02-18 18:56:31 +0200 commented answer Save and retrieving my data

@kcrisman Thanks, but I have the same problem with that; I'd have to save each variable seperately, I may have 100 of them and would like to save the data for the whole worksheet lazily..

2014-02-16 12:59:16 +0200 commented answer Save and retrieving my data

Thanks, that's probably what I'd have to go with. However, I was wondering if there is a way to save all the data of a specific worksheet without having to explicitely save every variable to a file. I may have too many of them. Isn't that what the data files were supposed to do?

2014-02-15 17:36:12 +0200 asked a question Save and retrieving my data

I often compute things that take a lot of time. When I stop working, I have to turn off my laptop. When I resume my work later, I'd like to be able to retrieve the previous data, computations, etc. For instance, I have computed a big list and stored it to the variable x. I would like to be able to save my data including the contents of this variable, then when I resume my work, I'd like to be able to have x back.

I tried to save my data to a file mydata.dat via the Data -->Upload or create file menu. Then, I quit sage, ran it again, and tried to link the data file back via the same menu. I got the following:

The data filename already exists in other worksheet Delete the file in the other worksheet before creating a link.

I don't really understand what that means. Then, I tried all of the following:

DATA+'mydata.dat'
open(DATA+'mydata.dat')
DATA=DATA+'mydata.dat'

but in any case, if I type x, I get

NameError: name 'x' is not defined

Could somebody tell me how I should achieve what I'm trying?

2013-11-07 19:25:37 +0200 marked best answer Roots of polynomials over a non-prime finite field in a given extension

Notice that

sage: h.change_ring(G)
a*b^3 + b^2

i.e. the polynomial variable x is sent to the generator of G, rather than to the generator of G['x'].

Unfortunately, root finding is not implemented for G:

sage: _.<y> = F[]
sage: h1 = y^4 + y^3 + (a+1)*y^2 + a
sage: h1.roots(ring=G)
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
...

You can work around this with the newly added coercions in lattices of Conway polynomials (this is limited to small finite fields, like the ones in your example).

sage: F.<a2> = GF(4, conway=True, prefix='a')
sage: F
Finite Field in a2 of size 2^2
sage: G = GF(4^4, conway=True, prefix='a')
sage: K.<x> = G[]
sage: f = x^4 + (a2 + 1)*x^3 + a2*x^2 + a2
sage: f.roots()
[(a8^6 + a8^5 + a8^4 + 1, 1),
 (a8^6 + a8^5 + a8^4 + a8^2 + a8, 1),
 (a8^6 + a8^5 + a8^4 + a8^3 + a8, 1),
 (a8^7 + a8^5 + a8^3 + a8, 1)]
sage: b = f.roots()[0][0]
sage: h = x^4 + x^3 + (a2+1)*x^2 + a2
sage: h.roots()
[(a8^3 + a8^2 + a8, 1),
 (a8^6 + a8^4 + a8^3, 1),
 (a8^7 + a8^4 + a8^2 + a8 + 1, 1),
 (a8^7 + a8^6, 1)]

Now you can express the roots of h in terms of powers of b by linear algebra.

sage: r = h.roots()[0][0]
sage: M = matrix([vector(b^i) for i in range(8)])
sage: v = M.solve_left(vector(r)); v
(0, 0, 0, 1, 0, 0, 1, 1)
sage: v*vector([b^i for i in range(8)]) == r
True

There is some development happening on finite field extensions, so hopefully this will be easier in a couple of releases from now.

2013-11-07 19:25:37 +0200 received badge  Scholar (source)
2013-11-07 15:40:22 +0200 commented answer Roots of polynomials over a non-prime finite field in a given extension

@Luca I see where the a2 came from, but I still don't understand where the a8 comes from.. Also, I still get an error message: F. \< a2 \> = GF(4, conway=True, prefix='a') Traceback (click to the left of this block for traceback) ... TypeError: __init__() got an unexpected keyword argument 'prefix' Is that what @ppruka's tickets refer to? I'm a bit of a new user and I can't understand 100% what the tickets imply for my case.. EDIT: have no idea how to make the first line appear correct.. It's F.<a2>

2013-11-06 20:54:37 +0200 commented answer Roots of polynomials over a non-prime finite field in a given extension

@Luca Actually.. It doesn't work for me (Sage version 5.5): F = GF(4, conway=True, prefix='a') Traceback (click to the left of this block for traceback) ... TypeError: you must specify the generator name.

2013-11-06 20:53:57 +0200 commented answer Roots of polynomials over a non-prime finite field in a given extension

@Luca Thank you very much for the quick reply. Though there are a couple of things that I do not get. For one, you use prefix='a' for both F and G? And what is the a8 that appears in the roots of f and h?

2013-11-06 20:40:36 +0200 commented question Roots of polynomials over a non-prime finite field in a given extension

@tmonteil Yes, it's of degree 4 over F4, so it has a root in F_{4^4} from finite field theory

2013-11-06 18:50:47 +0200 received badge  Editor (source)
2013-11-06 18:48:49 +0200 asked a question Roots of polynomials over a non-prime finite field in a given extension

I am trying to find the roots of a primitive polynomial over a non-prime finite field, in a desired extension. Here is an example of what I'm trying to do:

First, I define my non-prime finite field (GF(4)), and a primitive polynomial f.

sage: F.<a>=GF(4)                                                              
sage: K.<x>=F[]
sage: F 
Finite Field in a of size 2^2
sage: K
Univariate Polynomial Ring in x over Finite Field in a of size 2^2
sage: f=x^4 + (a + 1)*x^3 + a*x^2 + a       
sage: f.is_primitive()
True

Now, I define an extension field G where f has its roots

 sage: G=f.root_field('b')
 sage: G
 Univariate Quotient Polynomial Ring in b over Finite Field in a of size 2^2 with modulus x^4 + (a + 1)*x^3 + a*x^2 + a

I assume that b is a root of f, by definition (correct me if I'm wrong). Now, I take a new primitive polynomial h.

 sage: h=x^4 + x^3 + (a + 1)*x^2 + a
 sage: h.is_primitive()
 True

But when I try to find the roots of h in G, I get nothing.

 sage: h.roots(ring=G)
 []

Could somebody tell me how I could get the roots of h in G with respect to b?