[sage-support] Question About Primitive Element

2011-09-29 Thread Maarten Derickx
Phi(z) since by in your example the reduction of z will be primitive by 
definition. 

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Minimal set of Generators(basis) for an ideal/module

2011-09-29 Thread VInay Wagh
I am working in a multi-variable polynomial ring over a field (e.g. QQ
or CC). How do I get the minimal set of generators for an ideal I (or
module M)?

I am here referring to something I can do in Singular with the command
minbase.
(http://www.singular.uni-kl.de/Manual/latest/sing_266.htm)

Thanks in advance

-- VInay

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Minimal set of Generators(basis) for an ideal/module

2011-09-29 Thread Volker Braun
I don't know if this particular function is wrapped in Sage. But this 
Singular function requires the ideal to be homogeneous or the ring to be 
local. You don't mention this in your email, so I just wanted to point it 
out.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Minimal set of Generators(basis) for an ideal/module

2011-09-29 Thread Martin Albrecht
On 29 September 2011 09:44, Volker Braun vbraun.n...@gmail.com wrote:
 I don't know if this particular function is wrapped in Sage.

Yes it is, as almost any function in Singular, thanks to the Singular function
interface :)

Using the example from

http://www.singular.uni-kl.de/Manual/latest/sing_266.htm

sage: P.x,y,z = PolynomialRing(GF(181),order='neglex')
sage: I = Ideal(x^2+x*y*z,y^2-z^3*y,z^3+y^5*x*z)
sage: from sage.libs.singular.function_factory import singular_function
sage: maxideal = singular_function('maxideal')
sage: J = maxideal(3,ring=P)+I
sage: minbase = singular_function('minbase')
sage: minbase(J)
[x^2, x*y*z, x*z^2, y^2, y*z^2, z^3]

Cheers,
Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://www.informatik.uni-bremen.de/~malb
_jab: martinralbre...@jabber.ccc.de

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Question about congruence

2011-09-29 Thread juaninf
How do a(x) congruence b(x)R(x) mod (g(x)) in sage?

thanks by your answers

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Question about congruence

2011-09-29 Thread juaninf
g(x) is prime polynomial

On 29 sep, 07:28, juaninf juan...@gmail.com wrote:
 How do a(x) congruence b(x)R(x) mod (g(x)) in sage?

 thanks by your answers

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Using sagenb

2011-09-29 Thread Vince
Hi all,

I'm teaching a new cohort of students this year and was hoping to give
them a quick SAGE tutorial. Our IT guys have not been able to setup a
SAGE server in time so I was wondering how stable sagenb is. Is it
realistic to run a 90 minute lab session (tops) with about 40 odd
students each logged in to sagenb?

Thanks,
Vince

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Question about congruence

2011-09-29 Thread juaninf
in the paper that I reading say use Euclides Algorithm, but I dont
know how

On 29 sep, 07:29, juaninf juan...@gmail.com wrote:
 g(x) is prime polynomial

 On 29 sep, 07:28, juaninf juan...@gmail.com wrote:







  How do a(x) congruence b(x)R(x) mod (g(x)) in sage?

  thanks by your answers

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Bug in Graph.is_chordal

2011-09-29 Thread Nathann Cohen
Hello Jan !

I am trying to write the patch corresponding to your modifications,
but the file has changed much since and I have some trouble dealing
with your diff file... Could you copy/paste the totality of the code ?
:-)

Thaanks !

Nathann

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Minimal set of Generators(basis) for an ideal/module

2011-09-29 Thread Vinay Wagh
@Volker Thanks for pointing that out... I had forgotten to mention
that in my post. BY the way any idea, why such a restriction? Can we
get away with that in sage (of course for that now we cant use
Martin's code...)

@Martin Thanks for the code.
Actually I wanted to do this without going back and forth Singular.
(i.e. defining the object as Singular objects.) This is one more
trick I have learnt today wherein I can avoid going to Singular and
do almost everything I could have done there :-)

Thanks once again...
-- VInay

On 29 September 2011 14:53, Martin Albrecht
martinralbre...@googlemail.com wrote:
 On 29 September 2011 09:44, Volker Braun vbraun.n...@gmail.com wrote:
 I don't know if this particular function is wrapped in Sage.

 Yes it is, as almost any function in Singular, thanks to the Singular function
 interface :)

 Using the example from

 http://www.singular.uni-kl.de/Manual/latest/sing_266.htm

 sage: P.x,y,z = PolynomialRing(GF(181),order='neglex')
 sage: I = Ideal(x^2+x*y*z,y^2-z^3*y,z^3+y^5*x*z)
 sage: from sage.libs.singular.function_factory import singular_function
 sage: maxideal = singular_function('maxideal')
 sage: J = maxideal(3,ring=P)+I
 sage: minbase = singular_function('minbase')
 sage: minbase(J)
 [x^2, x*y*z, x*z^2, y^2, y*z^2, z^3]

 Cheers,
 Martin

 --
 name: Martin Albrecht
 _pgp: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99
 _otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
 _www: http://www.informatik.uni-bremen.de/~malb
 _jab: martinralbre...@jabber.ccc.de

 --
 To post to this group, send email to sage-support@googlegroups.com
 To unsubscribe from this group, send email to 
 sage-support+unsubscr...@googlegroups.com
 For more options, visit this group at 
 http://groups.google.com/group/sage-support
 URL: http://www.sagemath.org


-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Using sagenb

2011-09-29 Thread Berkin Malkoc
 I'm teaching a new cohort of students this year and was hoping to give
 them a quick SAGE tutorial. Our IT guys have not been able to setup a
 SAGE server in time so I was wondering how stable sagenb is. Is it
 realistic to run a 90 minute lab session (tops) with about 40 odd
 students each logged in to sagenb?

AFAIK, sagenb would most probably (if not certainly) not support that
many people -administrators of sagenb would of course be more
knowledgeable. Actually, your situation is a recurring issue on this
list and people are always advised to set up their own server. You can
do a quick search in the archives for various tips.

I personally had set up a server following these instructions within an hour:
http://wiki.sagemath.org/SageServer
Another approach:
http://wiki.sagemath.org/DanDrake/JustEnoughSageServer

Most important hardware concern is about RAM: A single instance of
Sage worksheet seems to occupy ~90MB (version 4.7.1); so, assuming
that each student work on his/her own worksheet, you would need about
5GB of RAM for 40 people. Also security may be another important
concern, as you would likely want the server to be reachable. See
also:
http://www.sagemath.org/doc/reference/sagenb/notebook/notebook_object.html

Regards,
Berkin

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Using sagenb

2011-09-29 Thread Jason Grout

On 9/29/11 8:00 AM, Berkin Malkoc wrote:

AFAIK, sagenb would most probably (if not certainly) not support that
many people -administrators of sagenb would of course be more
knowledgeable. Actually, your situation is a recurring issue on this
list and people are always advised to set up their own server. You can
do a quick search in the archives for various tips.


That used to be the case, but I think since the major upgrade in July, 
sagenb.org can probably handle this (no guarantees, of course).


I don't know of a way to check this, though---I don't know if there is a 
log of simultaneous users of just sagenb.org.  Here is a graph of 
simultaneous users of all of the *.sagenb.org servers, though:


http://www.sagenb.org/home/pub/3257/

Thanks,

Jason


--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Using sagenb

2011-09-29 Thread kcrisman
 That used to be the case, but I think since the major upgrade in July,
 sagenb.org can probably handle this (no guarantees, of course).

But one could use all the various sub-nbs like demo, demo1, alpha,
etc.?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Strange behaviour in a simple function

2011-09-29 Thread m m
Hi
I have written very simple function, which code I paste below. The
thing is that it produces completely unexpected results. I paste them
below. Please let me know if this is a bug or I just do something
completely wrong. I change in tests only the modulus M.

def MLCG_S(B,M,N,x0):
x = x0
L = []
for i in range(1,N):
x = Mod(B*x, M) #MLCG(B,M,x)
print x==B
print (B-M)
print (x-M)
print M-B
print M-x
return L;
2^31-1
Invocation: LCG_16807 = MLCG_S(16807,2^31-1,2,1);
Result:
True
-2147466840
16807
2147466840
2147466840
___2^20-1
Invocation:LCG_16807 = MLCG_S(16807,2^20-1,2,1);
Result:
True
-1031768
16807
1031768
1031768
___2^10-1
Invocation:LCG_16807 = MLCG_S(16807,2^10-1,2,1);
Result:
True
15784
439
-15784
584

Above, not only the first two differences are different, but also the
last two differences are different!

Cheers

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Strange behaviour in a simple function

2011-09-29 Thread Maarten Derickx
Mod(B*x, M) doesn't return an integer but an element of Integers(M) = the ring 
of integers modulo M. So the differences you see are because B is a normal 
integer so the subtractions involving B and M are just integer subtractions, 
but the substractions involing x and M are substractions in  Integers(M)

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Strange behaviour in a simple function

2011-09-29 Thread John H Palmieri
 Note that 439+584 = 1023 = 2^10-1, so -439 and 584 are congruent mod 
M=2^10-1.  (While B, M, and N are integers, x is element of Z/MZ, so 
comparisons like x==B are done mod M.  Any printing of numbers involving x 
are done mod M.)

-- 
John

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Question about xgcd method

2011-09-29 Thread juaninf
Hi everybody,

I want implement a modified extend Euclidean Algorithm, (egcd
function), but this give wrong results, below my egcd, please help me
to fix ...
def egcd(p1,p2):
if p2 == PR(0):
return (p1,1,0)
else:
(q1, r1) = (p1).quo_rem(p2)
(d,s1,t1) = egcd(p2, r1)
return (d,t1,(s1 - q1 * t1))
m = 4
F.x = GF(2)
Phi.x = GF(2^m);
PR = PolynomialRing(Phi,'z');
N = 2^m - 1;
X = PolynomialRing(Phi,repr('z')).gen();
g = X^4+X^3+X^2+1+x^2; # goppa polynomial
R = (x^3 + x^2 + 1)*X^3 + (x^3 + x^2 + x)*X^2 + (x^2 + 1)*X + x^3 + x
(a11,b11,c11) = egcd(g,R)
print 'testing',((c11.mod(g)*(R))).mod(g)
(a11,b11,c11) = xgcd(g,R)
print 'testing',((c11.mod(g)*(R))).mod(g)

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org