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)
> > f = F([omega])
> > TypeError: images do not define a valid homomorphism
> > 
> > Does anyone see another way to do this?
> 
> Have you tried using CyclotomicField(m) ? I think that uses specialized
> code, which should handle high degrees much better than generic number
> field code:

unfortunately that's not the case for the OP, see:

https://groups.google.com/forum/#!searchin/sage-devel/QuotientRing|
sort:date/sage-devel/qxGMiYDF4eQ/zDcTmXWJH9UJ
 
> sage: K=CyclotomicField(3*5*7*11)
> sage: K.coerce_embedding()
> Generic morphism:
>   From: Cyclotomic Field of order 1155 and degree 480
>   To:   Complex Lazy Field
>   Defn: zeta1155 -> 0.852033056930? + 0.00543996044764063?*I
> 
> Alternatively, if you really want to use an explicit quotient ring
> construction:
> 
> f = F([omega],check=False)
> 
> The error you run into otherwise is:
> 
> sage: sage.rings.morphism.RingHomomorphism_im_gens(H,[omega])
> ValueError: relations do not all (canonically) map to 0 under map
> determined by images of generators.
> 
> i.e., the cyclotomic polynomial evaluated at omega doesn't return an exact
> zero, because CC uses float arithmetic.

Cheers,
Martin

signature.asc
Description: This is a digitally signed message part.


[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
>
> Does anyone see another way to do this?
>
 
Have you tried using CyclotomicField(m) ? I think that uses specialized 
code, which should handle high degrees much better than generic number 
field code:

sage: K=CyclotomicField(3*5*7*11)
sage: K.coerce_embedding()
Generic morphism:
  From: Cyclotomic Field of order 1155 and degree 480
  To:   Complex Lazy Field
  Defn: zeta1155 -> 0.852033056930? + 0.00543996044764063?*I

Alternatively, if you really want to use an explicit quotient ring 
construction:

f = F([omega],check=False)

The error you run into otherwise is:

sage: sage.rings.morphism.RingHomomorphism_im_gens(H,[omega])
ValueError: relations do not all (canonically) map to 0 under map 
determined by images of generators.

i.e., the cyclotomic polynomial evaluated at omega doesn't return an exact 
zero, because CC uses float arithmetic.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[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_m)

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

Does anyone see another way to do this?

Thanks,

François

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


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 compute the ring of integers of a 
cyclotomic field. But PARI computes it very quickly anyway, so there is 
nothing to worry about.


--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


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_decl.pxd:62:long GF2X_IterIrredTest "IterIrredTest" 
(GF2X_c f)

This leads us to NTL's IterIrredTest, searching for it leads to:

http://www.shoup.net/ntl/doc/GF2XFactoring.txt

long IterIrredTest(const GF2X& f);

// performs an iterative deterministic irreducibility test, based on
// DDF.  Fast on average (when f has a small factor).

Gruß,
Martin

On Wednesday 07 May 2014 05:51:11 Silke Johler wrote:
> 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.

signature.asc
Description: This is a digitally signed message part.


[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 received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


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 = ZK.gen(1)
> sage: z
> zeta25
> sage: z2 = ZK.gen(2)
> sage: z2
> zeta25^2
> sage: ZK. = K.ring_of_integers()
> sage: x
> 1
> sage: y
> zeta25
>
>
> It makes more sense because it is a vector space, but that's not really what
> I expect when I ask for a generator of the ring of integers. Moreover, as
> zeta25 has order 25, I don't understand what is zeta0...

I see no zeta0!

>

OK, this explains what is going on.  The ring of integers is (as with
any order in the field) a free Z-module, and its gens are the Z-module
gens.  So having 1 as the first of these is no surprise:

sage: N=25
sage: K = CyclotomicField(N)
sage: ZK. = K.ring_of_integers()
sage: ZK.gens()
[1, zeta25, zeta25^2, zeta25^3, zeta25^4, zeta25^5, zeta25^6,
zeta25^7, zeta25^8, zeta25^9, zeta25^10, zeta25^11, zeta25^12,
zeta25^13, zeta25^14, zeta25^15, zeta25^16, zeta25^17, zeta25^18,
zeta25^19]

As expected since the ring of integers is Z[zeta15] so has a power basis.

>
>
> On Tuesday, 6 May 2014 17:06:10 UTC+1, ad1...@bristol.ac.uk wrote:
>>
>> Tanks for your help. The "lambda: True" thing is really odd but seems to
>> work... I will try to find how PARI and Sage (cyclotomic) ring of integers
>> are implemented.
>>
>> On Tuesday, 6 May 2014 16:24:26 UTC+1, John Cremona wrote:
>>>
>>> On 6 May 2014 16:11,   wrote:
>>> > I'm sorry but I use the notebook / worksheet working on virtual box so
>>> > copy-paste the file is long and painful. So actually I wrote it
>>> > manually,
>>> > that's why there is a mistake on "Fractional". My version is 5.13. I
>>> > know I
>>> > could have use K.ring_of_integers(), but I don't want that : I don't
>>> > want
>>> > sage to compute the ring of integer when I know it.
>>>
>>> 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;  then you would not have to do what you were doing.
>>>
>>> >
>>> > I restarted the notebook, and tried once more to have a complete
>>> > session. I
>>> > admit I was unable to reproduce the factor problem, but there is still
>>> > something odd : x should not be 1.
>>>
>>> Agree, and that is a bug in the way that the syntax ZK. = ... is
>>> interpreted.  Try replacing that line with
>>>
>>> sage: ZK = ZZ[zeta]
>>> sage: x = ZK.gen(0)
>>> sage: x
>>> zeta0
>>>
>>> but even more simply set
>>>
>>> sage: ZK = K.order(zeta)
>>>
>>> (but there may be a delay when Sage first decides that it needs to test
>>> sage: ZK.is_maximal()
>>> True
>>>
>>> though you could try to cheat like this
>>>
>>> sage: ZK=K.order(zeta)
>>> sage: ZK.is_maximal = lambda: True
>>> sage: ZK.is_maximal()
>>> True
>>>
>>> John
>>>
>>> >
>>> > sage: N=25
>>> > sage: K. = CyclotomicField(N)
>>> > sage: n = K.degree()
>>> > sage: ZK. = ZZ[zeta]
>>> > sage: ZK
>>> > Order in Number Field in zeta0 with defining polynomial x^20 + x^15 +
>>> > x^10 +
>>> > x^5 + 1
>>> > sage: x
>>> > 1
>>> > sage: zeta0
>>> > Traceback (most recent call last):
>>> > ...
>>> > NameError: name 'zeta0' is not defined
>>> > sage: x^2-1
>>> > 0
>>> >
>>> >
>>> > On Tuesday, 6 May 2014 15:12:32 UTC+1, John Cremona wrote:
>>> >>
>>> >> The normal way to get at the ring of integers would be to write ZK =
>>> >> K.ring_of_integers().  You have defined two separate algebraic
>>> >> objects, a ring and a field, and it is not clear what the relationship
>>> >> is beteween them.
>>> >>
>>> >> You should have said what version of Sage you are running.  In
>>> >> 6.2.rc2, at least, the word "fractional" is spelled correctly.
>>> >>
>>> >> What you posted cannot be a complete Sage sessions, since you do not
>>> >> define zeta0, and the ideal I you define is not the 20th power of
>>> >> anything.  In future you should post exactly what you have in a
>>> >> complete session.
>>> >>
>>> >> John Cremona
>>> >>
>>> >> On 6 May 2014 14:52,   wrote:
>>> >> >
>>> >> >
>>> >> > Hi.
>>> >> >
>>> >> > I have some issue with ideals in number fields. I wanted to test
>>> >> > something
>>> >> > about cyclotomic polynomials, so I had the following result :
>>> >> >
>>> >> > sage: N = 25
>>> >> > sage: K. = CyclotomicField(N)
>>> >> > sage: n = K.degree()
>>> >> > sage: ZK = ZZ[zeta]
>>> >> > sage: ZK
>>> >> >  Order in Number Field in zeta0 with defining Polynomial
>>> >> > x^20+x^15+x^10+x^5+1
>>> >> >
>>> >> > sage: I=ZK.ideal(5,zeta-1)
>>> >> > sage: I
>>> >> >  Fractionnal ideal (5,zeta0-1)
>>> >> >
>>> >> > sage: I.factor()
>>> >> >  (Fractionnal ideal (5,zeta0-1))^20
>>> >> >
>>> >> > sage: I==I^20
>>> >> >  False
>>> >> >
>>> >> > sage: zeta0
>>> >> >  1
>>> >> >
>>> >> > sage: zeta

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: z2
zeta25^2
sage: ZK. = K.ring_of_integers()
sage: x
1
sage: y
zeta25


It makes more sense because it is a vector space, but that's not really 
what I expect when I ask for a generator of the ring of integers. Moreover, 
as zeta25 has order 25, I don't understand what is zeta0...


On Tuesday, 6 May 2014 17:06:10 UTC+1, ad1...@bristol.ac.uk wrote:
>
> Tanks for your help. The "lambda: True" thing is really odd but seems to 
> work... I will try to find how PARI and Sage (cyclotomic) ring of integers 
> are implemented.
>
> On Tuesday, 6 May 2014 16:24:26 UTC+1, John Cremona wrote:
>>
>> On 6 May 2014 16:11,   wrote: 
>> > I'm sorry but I use the notebook / worksheet working on virtual box so 
>> > copy-paste the file is long and painful. So actually I wrote it 
>> manually, 
>> > that's why there is a mistake on "Fractional". My version is 5.13. I 
>> know I 
>> > could have use K.ring_of_integers(), but I don't want that : I don't 
>> want 
>> > sage to compute the ring of integer when I know it. 
>>
>> 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;  then you would not have to do what you were doing. 
>>
>> > 
>> > I restarted the notebook, and tried once more to have a complete 
>> session. I 
>> > admit I was unable to reproduce the factor problem, but there is still 
>> > something odd : x should not be 1. 
>>
>> Agree, and that is a bug in the way that the syntax ZK. = ... is 
>> interpreted.  Try replacing that line with 
>>
>> sage: ZK = ZZ[zeta] 
>> sage: x = ZK.gen(0) 
>> sage: x 
>> zeta0 
>>
>> but even more simply set 
>>
>> sage: ZK = K.order(zeta) 
>>
>> (but there may be a delay when Sage first decides that it needs to test 
>> sage: ZK.is_maximal() 
>> True 
>>
>> though you could try to cheat like this 
>>
>> sage: ZK=K.order(zeta) 
>> sage: ZK.is_maximal = lambda: True 
>> sage: ZK.is_maximal() 
>> True 
>>
>> John 
>>
>> > 
>> > sage: N=25 
>> > sage: K. = CyclotomicField(N) 
>> > sage: n = K.degree() 
>> > sage: ZK. = ZZ[zeta] 
>> > sage: ZK 
>> > Order in Number Field in zeta0 with defining polynomial x^20 + x^15 + 
>> x^10 + 
>> > x^5 + 1 
>> > sage: x 
>> > 1 
>> > sage: zeta0 
>> > Traceback (most recent call last): 
>> > ... 
>> > NameError: name 'zeta0' is not defined 
>> > sage: x^2-1 
>> > 0 
>> > 
>> > 
>> > On Tuesday, 6 May 2014 15:12:32 UTC+1, John Cremona wrote: 
>> >> 
>> >> The normal way to get at the ring of integers would be to write ZK = 
>> >> K.ring_of_integers().  You have defined two separate algebraic 
>> >> objects, a ring and a field, and it is not clear what the relationship 
>> >> is beteween them. 
>> >> 
>> >> You should have said what version of Sage you are running.  In 
>> >> 6.2.rc2, at least, the word "fractional" is spelled correctly. 
>> >> 
>> >> What you posted cannot be a complete Sage sessions, since you do not 
>> >> define zeta0, and the ideal I you define is not the 20th power of 
>> >> anything.  In future you should post exactly what you have in a 
>> >> complete session. 
>> >> 
>> >> John Cremona 
>> >> 
>> >> On 6 May 2014 14:52,   wrote: 
>> >> > 
>> >> > 
>> >> > Hi. 
>> >> > 
>> >> > I have some issue with ideals in number fields. I wanted to test 
>> >> > something 
>> >> > about cyclotomic polynomials, so I had the following result : 
>> >> > 
>> >> > sage: N = 25 
>> >> > sage: K. = CyclotomicField(N) 
>> >> > sage: n = K.degree() 
>> >> > sage: ZK = ZZ[zeta] 
>> >> > sage: ZK 
>> >> >  Order in Number Field in zeta0 with defining Polynomial 
>> >> > x^20+x^15+x^10+x^5+1 
>> >> > 
>> >> > sage: I=ZK.ideal(5,zeta-1) 
>> >> > sage: I 
>> >> >  Fractionnal ideal (5,zeta0-1) 
>> >> > 
>> >> > sage: I.factor() 
>> >> >  (Fractionnal ideal (5,zeta0-1))^20 
>> >> > 
>> >> > sage: I==I^20 
>> >> >  False 
>> >> > 
>> >> > sage: zeta0 
>> >> >  1 
>> >> > 
>> >> > sage: zeta 
>> >> >  zeta 
>> >> > 
>> >> > I think there is a problem with the zeta0 (actually I tried to 
>> enforce 
>> >> > the 
>> >> > name of the ZK variable by ZK. = ZZ[zeta] or  ZK. = 
>> >> > ZZ[zeta] or  ZK. = ZZ[zeta] but that doesn't work : it gives 
>> the 
>> >> > same 
>> >> > result. 
>> >> > 
>> >> > -- 
>> >> > You received this message because you are subscribed to the Google 
>> >> > Groups 
>> >> > "sage-support" group. 
>> >> > To unsubscribe from this group and stop receiving emails from it, 
>> send 
>> >> > an 
>> >> > email to sage-support...@googlegroups.com. 
>> >> > To post to this group, send email to sage-s...@googlegroups.com. 
>> >> > Visit this group at http://group

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. Januar 2014 15:45:24 UTC+1 schrieb John Cremona:
>
> See http://trac.sagemath.org/ticket/15745 
>
> John 
>
> On 27 January 2014 14:39, John Cremona > 
> wrote: 
> > On 27 January 2014 14:37,  > 
> wrote: 
> >> Ok, I will do the upstream-report (Singular trac at 
> >> http://www.singular.uni-kl.de:8002/trac/newticket) 
> >> 
> >>> John Cremona: [...] which I'm sure has been reported before. 
> >> 
> >> 
> >> I could not find a corresponding ticket in sage trac and cannot 
> >> currently login. Could someone open a that ticket in sage-trac if 
> necessary? 
> > 
> > I will do that (unless Peter has already).   Despite Singular, Sage 
> > can check for the unit ideal in this and related functions. 
> > 
> > John 
> > 
> >> 
> >> 
> >> Jack 
> >> 
> >> Am Montag, 27. Januar 2014 15:15:08 UTC+1 schrieb Peter Bruin: 
> >>> 
> >>> Hello, 
> >>> 
> >>> > I'm a bit confused about Sage's answer if Ideal(1) is prime. 
> >>> > 
> >>> > R.= QQ[] 
> >>> > I = Ideal(R(1)) 
> >>> > I.is_prime() 
> >>> > 
> >>> > Sage (5.11, not only) says yes, 
> >>> > conflicting to the definition, 
> >>> > http://en.wikipedia.org/wiki/Prime_ideal 
> >>> > Has somebody an expanation of this behaviour? 
> >>> 
> >>> The example Singular session below suggests that the problem lies in 
> >>> Singular (I'm not too familiar with Singular, but I think the answers 
> >>> should all be the same, and only primdecSY(J) seems to be correct). 
> >>> 
> >>> Peter 
> >>> 
> >>> 
> >>> $ sage -singular 
> >>>  SINGULAR / 
> >>> Development 
> >>>  A Computer Algebra System for Polynomial Computations   /   
> version 
> >>> 3-1-5 
> >>>0< 
> >>>  by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann \   Jul 
> 2012 
> >>> FB Mathematik der Universitaet, D-67653 Kaiserslautern\ 
> >>> > LIB "primdec.lib" 
> >>> (...) 
> >>> > ring R = 0, (x, y), dp; 
> >>> > ideal I = 1; 
> >>> > primdecSY(I); 
> >>> [1]: 
> >>>[1]: 
> >>>   _[1]=1 
> >>>[2]: 
> >>>   _[1]=1 
> >>> > primdecGTZ(I); 
> >>> [1]: 
> >>>[1]: 
> >>>   _[1]=1 
> >>>[2]: 
> >>>   _[1]=1 
> >>> > ideal J = x, x + 1; 
> >>> > primdecSY(J); 
> >>> empty list 
> >>> > primdecGTZ(J); 
> >>> [1]: 
> >>>[1]: 
> >>>   _[1]=1 
> >>>[2]: 
> >>>   _[1]=1 
> >>> 
> >> -- 
> >> You received this message because you are subscribed to the Google 
> Groups 
> >> "sage-support" group. 
> >> To unsubscribe from this group and stop receiving emails from it, send 
> an 
> >> email to sage-support...@googlegroups.com . 
> >> To post to this group, send email to 
> >> sage-s...@googlegroups.com. 
>
> >> Visit this group at http://groups.google.com/group/sage-support. 
> >> For more options, visit https://groups.google.com/groups/opt_out. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[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 this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[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 i in range(self.tau)]
self.zeti=[None for i in range(self.tau)]
for i in range (self.tau):
ri[i]=ZZ.random_element(-(2^(self.rho))-1,2^(self.rho))
zeti[i]=ZZ.random_element(int(2^(self.lam+self.eta))/self.p)

On running dis code it is giving error that:
Global variable 'ri' is not defined. 

So please anyone help regarding this how to remove the global variable 
error. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.