[sage-support] global name is not defined

2014-05-07 Thread Apurva Sachan
My code is like dis: class KeyGen(Pk): def __init__(self,rho,eta,gam,Theta,tau,pkRecrypt=None,*args,**kwargs): t=cputime(subprocesses=True) super(KeyGen,self).__init__(rho,eta,gam,tau,*args,**kwargs) self.y=randnum(self.gam,self.tau,self.rho) self.ri=[None for

[sage-support] Re: global name is not defined

2014-05-07 Thread Harald Schilly
inside your for loop, the last two lines, you need to prepend a "self." to both variables on the left ... just like you did with self.rho and the others on the right. harald -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from

Re: [sage-support] Re: confused about primality of Ideal(1)

2014-05-07 Thread kroeker
upstream report link: http://www.singular.uni-kl.de:8002/trac/ticket/550 Remark: minimal_associated_primes() and almost all routines based on decomposition routines from Singular's 'primdec.lib' are affected, too. Try R. = QQ[] I = Ideal( R(1) ) I.minimal_associated_primes() Am Montag, 27.

Re: [sage-support] Ideal in a number field

2014-05-07 Thread ad14745
I think I have something about the generator thing : sage: N=25 sage: K = CyclotomicField(N) sage: ZK. = K.ring_of_integers() sage: ZK Maximal Order in Cyclotomic Field of order 25 and degree 20 sage: x 1 sage: y = ZK.gen(0) sage: y 1 sage: z = ZK.gen(1) sage: z zeta25 sage: z2 = ZK.gen(2) sage: z

Re: [sage-support] Ideal in a number field

2014-05-07 Thread John Cremona
On 7 May 2014 12:06, wrote: > I think I have something about the generator thing : > > sage: N=25 > sage: K = CyclotomicField(N) > sage: ZK. = K.ring_of_integers() > sage: ZK > Maximal Order in Cyclotomic Field of order 25 and degree 20 > sage: x > 1 > sage: y = ZK.gen(0) > sage: y > 1 > sage: z

[sage-support] Irreducibility of polynomials

2014-05-07 Thread Silke Johler
Hi everyone, I would like to know which test Sage uses to test irreducibility of a polynomial over GF(2). Is it Rabin`s Test? How to compute the first condition? I am not asking for the command, just the technique . Thanks. -- You receive

Re: [sage-support] Irreducibility of polynomials

2014-05-07 Thread Martin Albrecht
Here's how to find out: sage: P. = GF(2)[] sage: f = P.random_element() sage: f.is_irreducible?? if 0 == GF2X_IterIrredTest(self.x): return False else: return True Okay, what's GF2X_IterIrredTest? sage: search_src("GF2X_IterIrredTest") libs/ntl/ntl_GF2X_d

Re: [sage-support] Ideal in a number field

2014-05-07 Thread Jeroen Demeyer
On 2014-05-06 17:24, John Cremona wrote: The ring of integers is computed by the pari library. I don't know if pari checks to see if the field is cyclotomic and uses a short-cut if it is. We should check that, and of not then Sage could put in the shortcut instead; Sage does have a shortcut to

[sage-support] Complex embedding with quotient()

2014-05-07 Thread François Colas
Hello group, I am playing with rings which look like K = Q[X]/ with any large value m. Unfortunately I cannot use NumberField() because it's too long. I get around this by using quotient which is a little bit faster: m = 3*5*7*11 Q. = QQ['x'] Phi_m = cyclotomic_polynomial(m) K. = Q.quotient(Phi

[sage-support] Re: Complex embedding with quotient()

2014-05-07 Thread Nils Bruin
On Wednesday, May 7, 2014 9:58:48 AM UTC-7, François Colas wrote: > > What I want to do is a way to evaluate polynomials of K in a power of a > primitive square root of unity: > > omega = CC(e^(2*I*pi/m)) > F = Hom(K, CC) > f = F([omega]) > TypeError: images do not define a valid homomorphism > >

Re: [sage-support] Re: Complex embedding with quotient()

2014-05-07 Thread Martin Albrecht
Hi Nils, On Wednesday 07 May 2014 16:43:03 Nils Bruin wrote: > On Wednesday, May 7, 2014 9:58:48 AM UTC-7, François Colas wrote: > > What I want to do is a way to evaluate polynomials of K in a power of a > > primitive square root of unity: > > > > omega = CC(e^(2*I*pi/m)) > > F = Hom(K, CC) > >