Ask Your Question

Zaubertrank's profile - activity

2017-10-01 14:20:07 -0500 received badge  Famous Question (source)
2017-07-10 17:53:20 -0500 received badge  Famous Question (source)
2016-10-21 10:35:30 -0500 received badge  Popular Question (source)
2016-07-07 00:16:02 -0500 received badge  Notable Question (source)
2016-06-28 10:18:51 -0500 received badge  Notable Question (source)
2016-04-06 07:10:29 -0500 received badge  Famous Question (source)
2015-03-17 18:02:07 -0500 received badge  Famous Question (source)
2014-06-18 13:10:30 -0500 received badge  Popular Question (source)
2014-05-06 19:40:55 -0500 received badge  Popular Question (source)
2013-05-29 12:08:26 -0500 received badge  Notable Question (source)
2013-05-03 04:59:33 -0500 received badge  Notable Question (source)
2013-02-15 13:05:04 -0500 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-09 17:58:50 -0500 received badge  Popular Question (source)
2012-10-21 07:10:03 -0500 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 07:10:02 -0500 commented answer Trying to display the roots of a polynomial over a finite field

Thank you!

2012-10-20 17:20:48 -0500 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?

Thanks

2012-09-12 08:41:39 -0500 received badge  Popular Question (source)
2012-03-12 14:22:32 -0500 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 09:01:08 -0500 received badge  Editor (source)
2012-03-12 08:54:04 -0500 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-02 18:13:32 -0500 commented question Aborting a Loop

That works kcrisman, thanks.

2012-03-02 14:24:53 -0500 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 10:56:57 -0500 received badge  Student (source)
2012-01-29 09:49:58 -0500 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
[etc..]

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()
-1
sage: q.simplify_full()
-1
2012-01-29 09:49:58 -0500 received badge  Scholar (source)
2012-01-29 09:49:55 -0500 received badge  Supporter (source)
2012-01-29 09:49:47 -0500 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 09:03:06 -0500 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.