Ask Your Question

Zaubertrank's profile - activity

2021-03-26 06:31:04 +0200 received badge  Notable Question (source)
2017-10-01 21:20:07 +0200 received badge  Famous Question (source)
2017-07-11 00:53:20 +0200 received badge  Famous Question (source)
2016-10-21 17:35:30 +0200 received badge  Popular Question (source)
2016-07-07 07:16:02 +0200 received badge  Notable Question (source)
2016-06-28 17:18:51 +0200 received badge  Notable Question (source)
2016-04-06 14:10:29 +0200 received badge  Famous Question (source)
2015-03-18 00:02:07 +0200 received badge  Famous Question (source)
2014-06-18 20:10:30 +0200 received badge  Popular Question (source)
2014-05-07 02:40:55 +0200 received badge  Popular Question (source)
2013-05-29 19:08:26 +0200 received badge  Notable Question (source)
2013-05-03 11:59:33 +0200 received badge  Notable Question (source)
2013-02-15 20:05:04 +0200 asked a question How does one find solutions to a polynomial over a finite field?

I'm trying to find the solutions to the polynomial $y^2=x^3+1$ over $\mathbb{F}_5$. I have constructed the correct polynomial ring, but I don't know what the analogous function to .roots() is for the two variable case. Thanks

2013-01-10 00:58:50 +0200 received badge  Popular Question (source)
2012-10-21 14:10:03 +0200 marked best answer Trying to display the roots of a polynomial over a finite field

Sage allows you to construct finite fields with a root of any irreducible polynomial as a generator. Thus

sage: PF2.<x> = GF(2)[]
sage: f = x^5 + x^2 + 1
sage: F32.<a> = GF(32, modulus=f)
sage: a.minimal_polynomial()
x^5 + x^2 + 1
sage: PF32.<s> = F32[]
sage: PF32.random_element().roots()
[(a^2 + a + 1, 1), (a^4 + a^3 + a^2, 1)]
2012-10-21 14:10:02 +0200 commented answer Trying to display the roots of a polynomial over a finite field

Thank you!

2012-10-21 00:20:48 +0200 asked a question Trying to display the roots of a polynomial over a finite field

So I'm trying to use the .roots() command on a polynomial over the quotient ring F_2[x]/x^5 + x^2 + 1, which is a field isomorphic to F_32. But it keeps giving me the following error:

NotImplementedError: root finding with multiplicities for this polynomial not implemented (try the multiplicities=False option)

Is there a way to get this to work?


2012-09-12 15:41:39 +0200 received badge  Popular Question (source)
2012-03-12 20:22:32 +0200 commented answer How to save a function in sage

Yes a lambda function was what I had in mind. Could you extrapolate on how to create these python modules and load them into your sage session, I've been unsuccessful so far using the info I've found online.

2012-03-12 15:01:08 +0200 received badge  Editor (source)
2012-03-12 14:54:04 +0200 asked a question How to save a function in sage

I have a function in sage I want to save, but I cannot figure out how. I'm running sage on a mac through the terminal. I'm finding stuff online about save_session, or saving to a document.sage file or something but nothing really seems to be working, is there a straightforward way to do this? Thanks.

Edit: Also while I have your attention, say you have a function f, how do you display the contents of f without actually running it?

2012-03-03 01:13:32 +0200 commented question Aborting a Loop

That works kcrisman, thanks.

2012-03-02 21:24:53 +0200 asked a question Aborting a Loop

Say I have a function which runs a while loop which always evaluates as true and thus keeps running, is there a way to abort this without just closing the terminal all together? Thanks.

2012-01-29 17:56:57 +0200 received badge  Student (source)
2012-01-29 16:49:58 +0200 marked best answer Sage is refusing to simplify an element of the symbolic ring to an integer

Not every method -- i.e. a function which lives inside an object -- has a function form. What I mean is that you can write sqrt(2), because sqrt is a function, and you could also write 2.sqrt(), but not everything is paired up like that.

This holds for simplify too. There is a simplify function, but you can get much tighter control by calling the simplify methods. You can usually look inside an object by hitting TAB. For example:

sage: q = ( sqrt(2) + sqrt(3) ) * ( sqrt(2) - sqrt(3) ) 
sage: q.[HERE I HIT TAB]
q.N                         q.exp_simplify              q.leading_coeff             q.reduce_trig
q.Order                     q.expand                    q.leading_coefficient       q.rename
q.abs                       q.expand_log                q.left                      q.reset_name
q.add                       q.expand_rational           q.left_hand_side            q.rhs
q.add_to_both_sides         q.expand_trig               q.lgamma                    q.right
q.additive_order            q.factor                    q.lhs                       q.right_hand_side

In sage, lots of functionality lives inside objects like this. If you type

sage: q.simp[TAB]
q.simplify            q.simplify_factorial  q.simplify_log        q.simplify_rational   
q.simplify_exp        q.simplify_full       q.simplify_radical    q.simplify_trig

you'll see a bunch of possibilities. If you type

sage: q.simplify_radical?

you can see the docs for it (and two ?? show the code.)

All of that is a long-winded way to bring us here:

sage: q = ( sqrt(2) + sqrt(3) ) * ( sqrt(2) - sqrt(3) ) 
sage: q.simplify_radical()
sage: q.simplify_full()
2012-01-29 16:49:58 +0200 received badge  Scholar (source)
2012-01-29 16:49:55 +0200 received badge  Supporter (source)
2012-01-29 16:49:47 +0200 commented answer Sage is refusing to simplify an element of the symbolic ring to an integer

oh man great answer, I didn't even know about all that functionality, thanks.

2012-01-29 16:03:06 +0200 asked a question Sage is refusing to simplify an element of the symbolic ring to an integer

For example: How can I get sage to simplify ( sqrt(2) + sqrt(3) ) * ( sqrt(2) - sqrt(3) ) to -1? I've tried simplify() but it wont do it. Thanks.