Example #1
0
#
# jython examples for jas.
# $Id$
#

import sys

from java.lang import System

from jas import Ring, PolyRing, QQ, DD, EF
from jas import terminate, startLog

# polynomial examples: real root tower over Q

r = EF(QQ()).realExtend("q", "q^3 - 3", "[1,2]").realExtend(
    "w", "w^2 - q", "[1,2]").realExtend("s", "s^5 - 2",
                                        "[1,2]").polynomial("x").build()

print "Ring: " + str(r)
print

#automatic: [one,q,w,s,x] = r.gens();
print "one   = " + str(one)
print "q     = " + str(q)
print "w     = " + str(w)
print "s     = " + str(s)
print "x     = " + str(x)
print

f = x**2 - w * s
Example #2
0
import sys

from java.lang import System
from java.lang import Integer

from jas import Ring
from jas import PolyRing
from jas import Ideal
from jas import QQ, AN, RF, EF
from jas import terminate
from jas import startLog

# polynomial examples: factorization over Q(sqrt(2))(x)(sqrt(x))[y]

Yr = EF(QQ()).extend("w2","w2^2 - 2").extend("x").extend("wx","wx^2 - x").polynomial("y").build();
#print "Yr    = " + str(Yr);
#print

[one,w2,x,wx,y] = Yr.gens();
print "one   = " + str(one);
print "w2    = " + str(w2);
print "x     = " + str(x);
print "wx    = " + str(wx);
print "y     = " + str(y);
print;


f = ( y**2 - x ) * ( y**2 - 2 );
#f = ( y**2 - x )**2 * ( y**2 - 2 )**3;
#f = ( y**4 - x * 2 );
import sys

from java.lang import System
from java.lang import Integer

from jas import Ring
from jas import PolyRing
from jas import Ideal
from jas import QQ, AN, RF, EF
from jas import terminate
from jas import startLog

# polynomial examples:

Yr = EF(QQ()).extend("x,y").extend("z", "z^2 + x^2 + y^2 - 1").build()
# print "Yr    = " + str(Yr);
# print

[one, x, y, z] = Yr.gens()
print "one   = " + str(one)
print "x     = " + str(x)
print "y     = " + str(y)
print "z     = " + str(z)
print

f = (1 + z) * (1 - z)
# / ( x**2 + y**2 );
print "f     = " + str(f)
print
Example #4
0
#
# jython examples for jas.
# $Id$
#

import sys;

from java.lang import System

from jas import Ring, PolyRing, QQ, DD, EF
from jas import terminate, startLog

# polynomial examples: real root tower over Q

r = EF(QQ()).realExtend("q","q^3 - 3", "[1,2]").realExtend("w", "w^2 - q", "[1,2]").realExtend("s", "s^5 - 2", "[1,2]").polynomial("x").build();

print "Ring: " + str(r);
print;

#automatic: [one,q,w,s,x] = r.gens();
print "one   = " + str(one);
print "q     = " + str(q);
print "w     = " + str(w);
print "s     = " + str(s);
print "x     = " + str(x);
print;

f = x**2 - w * s;

print "f = ", f;
print;
#
# jython examples for jas.
# $Id$
#

import sys

from java.lang import System

from jas import QQ, AN, RF, EF, Ring, PolyRing
from jas import terminate, startLog

# polynomial examples: factorization over Q(sqrt(2))(x)(sqrt(x))[y]

Yr = EF(QQ()).extend("w2","w2^2 - 2").extend("x").extend("wx","wx^2 - x").polynomial("y").build();
print "Yr    = " + str(Yr);
print

#is automatic: [one,w2,x,wx,y] = Yr.gens();
print "one   = " + str(one);
print "w2    = " + str(w2);
print "x     = " + str(x);
print "wx    = " + str(wx);
print "y     = " + str(y);
print;


f = ( y**2 - x ) * ( y**2 - 2 );
#f = ( y**2 - x )**2 * ( y**2 - 2 )**3;
#f = ( y**4 - x * 2 );
#f = ( y**7 - x * 2 );
Example #6
0
#

import sys;

from java.lang import System
from java.lang import Integer

from jas import Ring, PolyRing
from jas import QQ, DD, EF
from jas import terminate
from jas import startLog


# polynomial examples: real root tower over Q

r = EF(QQ()).realExtend("q","q^3 - 3", "[1,2]").realExtend("w", "w^2 - q", "[1,2]").realExtend("s", "s^5 - 2", "[1,2]").polynomial("x").build();

print "Ring: " + str(r);
print;

[one,q,w,s,x] = r.gens();
print "one   = " + str(one);
print "q     = " + str(q);
print "w     = " + str(w);
print "s     = " + str(s);
print "x     = " + str(x);
print;

f = x**2 - w * s;

Example #7
0
#
# jython examples for jas.
# $Id$
#

import sys;

from jas import PolyRing, Ideal, QQ, ZZ, EF, Mat

# matrix and polynomial examples:
# conditions for (non) commuting matrices

r = EF(QQ()).polynomial("a,b,c,d,e,f,g,h").build();
print "r = " + str(r);

#one, a, b, c, d, e, f, g, h = r.gens();
print "h = " + str(h);
print

x = Mat(r,2,2,[[a,b],[c,d]])
y = Mat(r,2,2,[[e,f],[g,h]])
print "x = " + str(x) + ", y = " + str(y) #+ ", x y = " + str(x*y)
print

com = x*y - y*x
print "commutator = " + str(com)
print

ff = r.ideal("", [ com[0][0], com[0][1], com[1][0], com[1][1] ] )
print "ff = " + str(ff)
print
Example #8
0
import sys

from java.lang import System
from java.lang import Integer

from jas import Ring
from jas import PolyRing
from jas import Ideal
from jas import QQ, AN, RF, EF
from jas import terminate
from jas import startLog

# polynomial examples: 

Yr = EF(QQ()).extend("x,y").extend("z","z^2 + x^2 + y^2 - 1").build();
#print "Yr    = " + str(Yr);
#print

[one,x,y,z] = Yr.gens();
print "one   = " + str(one);
print "x     = " + str(x);
print "y     = " + str(y);
print "z     = " + str(z);
print;

f = (1+z)*(1-z); # / ( x**2 + y**2 );
print "f     = " + str(f);
print;

g = f / (1 - z);