code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Nabashima, ISSAC 2007, example F7
# integral function coefficients
r = Ring.new( "IntFunc(a, b) (z,y,x) G" );
puts "Ring: " + str(r);
puts;
ps = """
(
( x^3 - { a } ),
( y^4 - { b } ),
( x + y - { a } z )
)
""";
#startLog();
f = r.paramideal( ps );... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: squarefree: characteristic 0
#r = PolyRing.new(PolyRing.new(QQ(),"u,v",PolyRing.lex),"x, y",PolyRing.lex)
#r = PolyRing.new(PolyRing.new(ZZ(),"u,v",PolyRing.lex),"x, y",PolyRing.lex)
r = PolyRing.new(PolyRing.new(GF(7),"u,v",PolyRing.... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Quantum plane example
rsan = """
AN[ (i) (i^2 + 1) ] (Y,X,x,y) G
RelationTable
(
( y ), ( x ), ( {i} x y )
( X ), ( Y ), ( {i} Y X )
)
""";
rsc = """
C(Y,X,x,y) G |2|
#C(Y,X,x,y) G
RelationTable
(
( y ), ( x ), ( 0i1 x y )
( X ), ( Y ), ( 0i1 Y X )
... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: factorization over Q(i)
#r = Ring( "AN[ (i) (i^2 + 1) ] (x) L" );
#r = Ring( "AN[ (a) (4 a^2 + 1) ] (x) L" );
#r = Ring( "AN[ (a) (a^4 + 2 a^2 - 4 a + 2) ] (x) L" );
#puts "Ring: " + str(r);
#puts;
Qr = PolyRing.new(QQ(),"i",PolyRin... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# trinks 7 example
r = Ring.new( "Rat(B,S,T,Z,P,W) L" );
puts "Ring: " + str(r);
puts;
ps = """
(
( 45 P + 35 S - 165 B - 36 ),
( 35 P + 40 Z + 25 T - 27 S ),
( 15 W + 25 S P + 30 Z - 18 T - 165 B**2 ),
( - 9 W + 15 T P + 20 S Z ),
( P W + 2 T Z ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: squarefree: characteristic 0
r = PolyRing.new(QQ(),"x, y, z",PolyRing.lex)
puts "Ring: " + str(r);
puts;
one,x,y,z = r.gens();
a = r.random(k=2,l=3);
b = r.random(k=2,l=3);
c = r.random(k=1,l=3);
if a.isZERO()
a = x;
end
if b.i... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# trinks 7 example
r = PolyRing.new( QQ(), "B,S,T,Z,P,W", PolyRing.lex); # or PolyRing.grad
puts "Ring: " + str(r);
puts;
ps = """
(
( 45 P + 35 S - 165 B - 36 ),
( 35 P + 40 Z + 25 T - 27 S ),
( 15 W + 25 S P + 30 Z - 18 T - 165 B**2 ),
( - 9 W + ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Boolean coefficient boolean GB
# see S. Inoue and A. Nagai "On the Implementation of Boolean Groebner Bases" in ASCM 2009
# Z_2 regular ring coefficent example
r = PolyRing.new(RR(ZM(2),3),"x,y",PolyRing.lex);
puts "r = " + str(r);
#puts len(r.gens())
... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: complex roots over Q for zero dimensional ideal `cyclic5'
r = PolyRing.new(QQ(),"a,b,c,d,e",PolyRing.lex);
puts "Ring: " + str(r);
puts;
#one,q,w,s,x = r.gens();
f1 = a + b + c + d + e;
f2 = a*b + b*c + c*d + d*e + e*a;
f3 = a*b*c +... | Ruby |
# $Id$
=begin rdoc
jruby interface to JAS.
=end
module JAS
module_function
require "java"
require "rational"
require "mathn"
include_class "java.lang.System"
include_class "java.io.StringReader"
include_class "java.util.ArrayList"
include_class "java.util.Collections"
#require "../lib/log4j.jar"
include_class "... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: gcd
#r = PolyRing.new( ZM(1152921504606846883), "(x,y,z)", PolyRing.lex );
r = PolyRing.new( QQ(), "(x,y,z)", PolyRing.lex );
#r = PolyRing.new( CC(), "(x,y,z)", PolyRing.lex );
#r = PolyRing.new( ZZ(), "(x,y,z)", PolyRing.lex );
put... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Nabashima, ISSAC 2007, example Ex-4.3
# integral function coefficients
r = Ring.new( "IntFunc(a, b) (y,x) L" );
puts "Ring: " + str(r);
puts;
ps = """
(
( x y + x ),
( { a } x^2 + y + 2 ),
( { b } x y + y )
)
""";
#startLog();
f = r.paramideal( ps... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# example from rose (modified)
#r = Ring.new( "Mod 19 (U3,U4,A46) L" );
#r = Ring.new( "Mod 1152921504606846883 (U3,U4,A46) L" ); # 2^60-93
#r = Ring.new( "Quat(U3,U4,A46) L" );
#r = Ring.new( "Z(U3,U4,A46) L" );
#r = Ring.new( "C(U3,U4,A46) L" );
r = Ring... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# ideal intersection example
#r = Ring.new( "Rat(x,y,z) L" );
r = PolyRing.new( QQ(), "(x,y,z)", PolyRing.lex );
puts "Ring: " + str(r);
puts;
ps1 = """
(
( x - 1 ),
( y - 1 ),
( z - 1 )
)
""";
ps2 = """
(
( x - 2 ),
( y - 3 ),
( z - 3 )
)
""";
F1 ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# ideal elimination example
r = PolyRing.new( QQ(), "(x,y,z)", PolyRing.grad );
puts "Ring: " + str(r);
puts;
ps1 = """
(
( x^2 - 2 ),
( y^2 - 3 ),
( z^3 - x * y )
)
""";
F1 = r.ideal( ps1 );
puts "Ideal: " + str(F1);
puts;
e = PolyRing.new( QQ(), "(x... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Nabashima, ISSAC 2007, example F3
# integral function coefficients
r = Ring.new( "IntFunc(c, b, a, d) (x) L" );
puts "Ring: " + str(r);
puts;
ps = """
(
( { a } x^4 + { c } x^2 + { b } ),
( { b } x^3 + x^2 + 2 ),
( { c } x^2 + { d } x )
)
""";
#star... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Raksanyi & Walter example
# rational function coefficients
#r = Ring.new( "RatFunc(a1, a2, a3, a4) (x1, x2, x3, x4) G" );
r = PolyRing.new( RF(PolyRing.new(ZZ(),"a1, a2, a3, a4",PolyRing.lex)), "x1, x2, x3, x4", PolyRing.grad );
puts "Ring: " + str(r);
pu... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: ideal radical decomposition, inseparable case, 0-dim
cr = PolyRing.new(ZM(5),"c",PolyRing.lex);
puts "coefficient Ring: " + str(cr);
rf = RF(cr);
puts "coefficient quotient Ring: " + str(rf);
r = PolyRing.new(rf,"x,y,z",PolyRing.lex)... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# mark, d-gb diplom example, due to kandri-rody 1984
#
# The MAS DIIPEGB implementation contains an error because the output e-GB
# is not correct. Also the cited result from k-r contains this error.
# The polynomial
#
# ( 2 x * y^2 - x^13 + 2 x^11 - x^9 ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# WA_32 solvable polynomial example
p = PolyRing.new(QQ(),"a,b,e1,e2,e3");
#is automatic: [one,a,b,e1,e2,e3] = p.gens();
relations = [e3, e1, e1*e3 - e1,
e3, e2, e2*e3 - e2];
puts "relations: =" + relations.join(", ") { |r| r.to_s };
puts;
... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: ideal prime decomposition
# TRANSACTIONS OF THE AMERICAN MATHEMATICAL SOCIETY
# Volume 296, Number 2. August 1986
# ON THE DEPTH OF THE SYMMETRIC ALGEBRA
# J. HERZOG M. E. ROSSI AND G. VALLA
#r = PolyRing.new(QQ(),"x,t,z,y",PolyRing.l... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# example for rational and complex numbers
#
#
zn = ZZ(7);
puts "zn: " + str(zn);
puts "zn^2: " + str(zn*zn);
puts;
x = 10000000000000000000000000000000000000000000000000;
rn = QQ(2*x,4*x);
puts "rn: " + str(rn);
puts "rn^2: " + str(rn*rn);
puts;
rn =... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: complex roots over Q
r = PolyRing.new(CR(QQ()),"x",PolyRing.lex);
puts "Ring: " + str(r);
puts;
one,I,x = r.gens();
puts "one = " + one.to_s;
puts "I = " + I.to_s;
puts "x = " + x.to_s;
puts;
f1 = x**3 - 2;
f2 = ( x - I ) * (... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: ideal radical decomposition, example 8.16 in GB book, base field with p-th root
# noThreads(); # must be called very early
prime = 5;
cf = ZM(prime);
#cf = QQ();
ca = PolyRing.new(cf,"t",PolyRing.lex);
puts "ca = " + str(ca);
ea,ta ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
#startLog();
# polynomial examples: factorization over Z
r = PolyRing.new( ZZ(), "x", PolyRing.lex );
puts "Ring: " + str(r);
puts;
one,x = r.gens();
#f = x**15 - 1;
#f = x * ( x + 1 )**2 * ( x**2 + x + 1 )**3;
#f = x**6 - 3 * x**5 + x**4 - 3 * x**3 - x... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# U(sl_2_e) example
rs = """
# solvable polynomials, U(sl_2_e):
Rat(e,h) G
RelationTable
(
( h ), ( e ), ( e h + 2 e )
)
""";
r = SolvableRing.new( rs );
puts "SolvableRing: " + str(r);
puts;
ps = """
(
( e^2 + h^3 )
)
""";
f = SolvableIdeal.new( r, p... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
#startLog();
# polynomial examples: prime / primary decomposition in Q[w2,x,wx,y,z]
Q = PolyRing.new(QQ(),"w2,x,wx,y,z",PolyRing.lex);
puts "Q = " + str(Q);
e,w2,x,wx,y,z = Q.gens();
puts "e = " + str(e);
puts "w2 = " + str(w2);
puts "x = " ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
#startLog();
# polynomial examples: factorization
cr = PolyRing.new( QQ(), "x", PolyRing.lex );
puts "Ring: " + str(cr);
r = PolyRing.new( cr, "y,z", PolyRing.lex );
puts "Ring: " + str(r);
puts
one,x,y,z = r.gens();
#f = z * ( y + 1 )**2 * ( x**2 + x ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
#startLog();
# elementary integration
r = PolyRing.new( QQ(), "x", PolyRing.lex );
puts "Ring: " + str(r);
puts
rf = RF(r);
puts "Ring: " + str(rf.factory());
puts
one,x = rf.gens();
#f = 1 / ( 1 + x**2 );
#f = x**2 / ( x**2 + 1 );
#f = 1 / ( x**2 - 2... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Montes JSC 2002, 33, 183-208, example 5.1
# integral function coefficients
r = PolyRing.new( PolyRing.new(QQ(),"a, b",PolyRing.lex), "u,z,y,x", PolyRing.lex );
puts "Ring: " + str(r);
puts;
one,a,b,u,z,y,x = r.gens();
puts "gens: " + r.gens().each{ |f| s... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Nabashima, ISSAC 2007, example F6
# integral function coefficients
r = Ring.new( "IntFunc(a, b,c, d) (x) G" );
puts "Ring: " + str(r);
puts;
ps = """
(
( x^4 + { a } x^3 + { b } x^2 + { c } x + { d } ),
( 4 x^3 + { 3 a } x^2 + { 2 b } x + { c } )
)
""... | Ruby |
#
# jruby examples for jas.
# $Id$
require "examples/jas"
include_class "edu.jas.gb.Katsura";
# katsura examples
knum = 4;
tnum = 2;
#r = Ring( "Mod 19 (B,S,T,Z,P,W) L" );
#r = Ring( "Mod 1152921504606846883 (B,S,T,Z,P,W) L" ); # 2^60-93
#r = Ring( "Quat(B,S,T,Z,P,W) L" );
#r = Ring( "Z(B,S,T,Z,P,W) L" );
#r = Rin... | Ruby |
#
# jruby examples for jas.
# $Id$
#
# CLO2, p370
# 4 A + 5 B + C = 37
# 2 A + 3 B + D = 20
#
# max: 11 A + 15 B
#
require "examples/jas"
r = Ring.new( "Rat(w1,w2,w3,w4,z1,z2) W( (0,0,0,0,1,1),(1,1,2,2,0,0) )" );
puts "Ring: " + str(r);
puts;
ps = """
(
( z1^4 z2^2 - w1 ),
( z1^5 z2^3 - w2 ),
( z1 - w3 ),
( z2... | Ruby |
#
# jruby examples for jas.
# $Id$
require "examples/jas"
# Legendre polynomial example
# P(0) = 1
# P(1) = x
# P(n) = 1/n [ (2n-1) * x * P(n-1) - (n-1) * P(n-2) ]
r = Ring.new( "Q(x) L" );
#r = Ring.new( "C(x) L" );
puts "Ring: " + str(r);
puts;
# sage like: with generators for the polynomial ring
one,x = r.gens()... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# 2 univariate polynomials of degree 2 example for comprehensive GB
# integral/rational function coefficients
r = PolyRing.new( PolyRing.new(QQ(),"a",PolyRing.lex),"x,y,z", PolyRing.lex );
puts "Ring: " + str(r);
puts;
#puts "gens: " + str(r.gens());
f1 =... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# output gb of rose
#r = Ring.new( "Mod 19 (U3,U4,A46) L" );
#r = Ring.new( "Mod 1152921504606846883 (U3,U4,A46) L" ); # 2^60-93
#r = Ring.new( "Quat(U3,U4,A46) L" );
#r = Ring.new( "Z(U3,U4,A46) L" );
#r = Ring.new( "C(U3,U4,A46) L" );
#r = Ring.new( "Rat... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: ideal radical decomposition, modified from example 8.16 in GB book
# noThreads(); # must be called very early
prime = 5;
cf = ZM(prime);
#cf = QQ();
ca = PolyRing.new(cf,"a",PolyRing.lex);
#puts "ca = " + str(ca);
ea,aa = ca.gens();... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Boolean coefficient boolean GB
# see S. Inoue and A. Nagai "On the Implementation of Boolean Groebner Bases" in ASCM 2009
# Z_2 regular ring coefficent example
r = PolyRing.new(RR(ZM(2),3),"a,x,y",PolyRing.lex);
puts "r = " + str(r);
#puts len(r.gens())... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Nabashima, ISSAC 2007, example F4
# integral function coefficients
r = Ring.new( "IntFunc(a, b, c, d) (y, x) L" );
puts "Ring: " + str(r);
puts;
ps = """
(
( { a } x^3 y + { c } x y^2 ),
( x^4 y + { 3 d } y ),
( { c } x^2 + { b } x y ),
( x^2 y^2 + {... | Ruby |
#
# jruby examples for jas.
# $Id$
#
## \begin{PossoExample}
## \Name{Hawes2}
## \Parameters{a;b;c}
## \Variables{x;y[2];z[2]}
## \begin{Equations}
## x+2y_1z_1+3ay_1^2+5y_1^4+2cy_1 \&
## x+2y_2z_2+3ay_2^2+5y_2^4+2cy_2 \&
## 2 z_2+6ay_2+20 y_2^3+2c \&
## 3 z_1^2+y_1^2+b \&
## 3z_2^2+y_2^2+b \&
## \end{Equations}
## \en... | Ruby |
#
# jruby examples for jas.
# $Id$
#
#load "examples/jas.rb"
require "examples/jas"
puts "------- ZZ = BigInteger ------------";
z1 = ZZ(12345678901234567890);
puts "z1 = " + str(z1);
z2 = z1**2 + 12345678901234567890;
puts "z2 = " + str(z2);
puts;
puts "------- QQ = BigRational ------------";
r1 = QQ(1,1234567890... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: absolute factorization over Q
r = Ring.new( "Q(x) L" );
puts "Ring: " + str(r);
puts;
one,x = r.gens();
#f = x**5 - 1;
#f = x**6 - 1;
f = x**3 - 2;
f = f*f;
#f = x**7 - 1;
#f = x**15 - 1;
#f = x * ( x + 1 )**2 * ( x**2 + x + 1 )**3;... | Ruby |
#
# jruby examples for jas.
# $Id$
#
#load "examples/jas.rb"
require "examples/jas"
# non-commutative polynomial examples: simple test
r = WordPolyRing.new(QQ(),"x,y");
puts "WordPolyRing: " + str(r);
puts;
one,x,y = r.gens();
puts "one = " + str(one);
puts "x = " + str(x);
puts "y = " + str(y);
puts;
f1 = x*y - 1... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Raksanyi & Walter example
# rational function coefficients
r = Ring.new( "IntFunc(a1, a2, a3, a4) (x1, x2, x3, x4) L" );
puts "Ring: " + str(r);
puts;
ps = """
(
( x4 - { a4 - a2 } ),
( x1 + x2 + x3 + x4 - { a1 + a3 + a4 } ),
( x1 x3 + x1 x4 + x2 x3 +... | Ruby |
#
# jruby examples for jas.
# $Id$
#
#load "examples/jas.rb"
require "examples/jas"
# test auto defined generators
startLog();
r = PolyRing.new( CC(), "(b,s,t,z,p,w)", PolyRing.lex );
puts "Ring: " + r.to_s;
puts;
puts "1 = " + str(r.one);
puts "I = " + str(r.I);
puts "b = " + str(r.b);
puts "s = " + str(r.s);
pu... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
#startLog();
# polynomial examples: ideal prime decomposition
r = PolyRing.new(QQ(),"x,y,z",PolyRing.lex);
puts "Ring: " + str(r);
puts;
one,x,y,z = r.gens();
f1 = (x**2 - 5)**2;
f2 = y**3 - x;
f3 = z**2 - y * x;
puts "f1 = " + str(f1);
puts "f2 = " + ... | Ruby |
#
# jruby examples for jas.
# $Id: $
#
require "examples/jas"
#startLog();
# ? example
#r = Ring.new( "Rat(t,x,y,z) L" );
#r = Ring.new( "Z(t,x,y,z) L" );
#r = Ring.new( "Mod 11(t,x,y,z) L" );
r = Ring.new( "Rat(t,x,y) L" );
puts "Ring: " + str(r);
puts;
ps = """
(
( t - x - 2 y ),
( x^4 + 4 ),
( y^4 + 4 )
)
... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: complex roots over Q
r = PolyRing.new(QQ(),"I,x,y,z",PolyRing.lex);
puts "Ring: " + str(r);
puts;
one,I,x,y,z = r.gens();
f1 = z - x - y * I;
f2 = I**2 + 1;
#f3 = z**3 - 2;
f3 = z**3 - 2*I;
puts "f1 = " + str(f1);
puts "f2 = " + s... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: ideal radical decomposition
#r = Ring.new( "Rat(x) L" );
#r = Ring.new( "Q(x) L" );
r = PolyRing.new(QQ(),"x,y,z",PolyRing.lex);
puts "Ring: " + str(r);
puts;
one,x,y,z = r.gens();
f1 = (x**2 - 5)**2;
f2 = (y**2 - 3)**3 * (y**2 - 5... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# 2 univariate polynomials of degree 2 example for comprehensive GB
# integral/rational function coefficients
#r = Ring.new( "IntFunc(a2, a1, a0, b2, b1, b0) (x) L" );
r = PolyRing.new( PolyRing.new(ZZ(),"(a2, a1, a0, b2, b1, b0)",PolyRing.lex),"(x)", PolyR... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: zero dimensional ideals prime and primary decomposition
r = PolyRing.new(QQ(),"x,y,z",PolyRing.lex);
puts "Ring: " + str(r);
puts;
one,x,y,z = r.gens();
f1 = (x**2 - 5)**2;
f2 = y**2 - 5;
f3 = z**3 - y * x ;
puts "f1 = " + str(f1)... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
#startLog();
# example: Algebraic Statistics
# Drton, Sturmfels, Sullivant, example 2.1.3
r = PolyRing.new(RF(PolyRing.new(QQ(),"u0,u1,u2,u12",PolyRing.lex)),"l1,l2",PolyRing.grad);
puts "Ring: " + str(r);
puts;
puts one, u0, u1, u2, u12, l1 ,l2;
puts;
... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: real roots over Q for zero dimensional ideal `cyclic5'
r = PolyRing.new(QQ(),"a,b,c,d,e",PolyRing.lex);
puts "Ring: " + str(r);
puts;
#one,q,w,s,x = r.gens();
f1 = a + b + c + d + e;
f2 = a*b + b*c + c*d + d*e + e*a;
f3 = a*b*c + b*... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# pppj 2006 paper examples
r = PolyRing.new( ZZ(), "x1,x2,x3", PolyRing.lex );
puts "Ring: " + str(r);
puts;
f = 3 * x1**2 * x3**4 + 7 * x2**5 - 61;
puts "f = " + str(f);
puts;
id = r.ideal( "", list=[f] );
puts "Ideal: " + str(id);
puts;
ri = r.ring;
... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# sicora, e-gb example
r = PolyRing.new(ZZ(),"t",PolyRing.lex)
puts "Ring: " + str(r);
puts;
one,x = r.gens();
f1 = 2 * t + 1;
f2 = t**2 + 1;
ff = r.ideal( "", [f1,f2] );
puts "ideal: " + str(ff);
puts;
#t = System.currentTimeMillis();
gg = ff.eGB();
#t... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: gcd
#r = Ring( "Mod 1152921504606846883 (x,y,z) L" );
#r = Ring( "Rat(x,y,z) L" );
#r = Ring( "C(x,y,z) L" );
r = Ring.new( "Z(x,y,z) L" );
puts "Ring: " + str(r);
puts;
one,x,y,z = r.gens();
puts "one = " + str(one);
puts "x = " +... | Ruby |
#
# jruby examples for jas.
# $Id$
#
## \begin{PossoExample}
## \Name{Hawes2}
## \Parameters{a;b;c}
## \Variables{x;y[2];z[2]}
## \begin{Equations}
## x+2y_1z_1+3ay_1^2+5y_1^4+2cy_1 \&
## x+2y_2z_2+3ay_2^2+5y_2^4+2cy_2 \&
## 2 z_2+6ay_2+20 y_2^3+2c \&
## 3 z_1^2+y_1^2+b \&
## 3z_2^2+y_2^2+b \&
## \end{Equations}
## \en... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# U(sl_3) example
rs = """
# solvable polynomials, U(sl_3):
Rat(Xa,Xb,Xc,Ya,Yb,Yc,Ha,Hb) G
RelationTable
(
( Xb ), ( Xa ), ( Xa Xb - Xc ),
( Ya ), ( Xa ), ( Xa Ya - Ha ),
( Yc ), ( Xa ), ( Xa Yc + Yb ),
( Ha ), ( Xa ), ( Xa Ha + 2 Xa ),
( Hb ), ( Xa ),... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples:
Yr = EF.new(QQ()).extend("x,y").extend("z","z^2 + x^2 + y^2 - 1").build();
#puts "Yr = " + str(Yr);
#puts
one,x,y,z = Yr.gens();
puts "one = " + str(one);
puts "x = " + str(x);
puts "y = " + str(y);
puts "z = " + st... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# ? example
rs = """
Rat(a,b,e1,e2,e3) L
RelationTable
(
( e3 ), ( e1 ), ( e1 e3 - e1 ),
( e3 ), ( e2 ), ( e2 e3 - e2 )
)
""";
r = SolvableRing.new( rs );
puts "SolvableRing: " + str(r);
puts;
ps = """
(
( e1 e3^3 + e2^1... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Montes JSC 2002, 33, 183-208, example 11.3
# integral function coefficients
R = PolyRing.new( PolyRing.new(QQ(),"r, l, z",PolyRing.lex), "c1, c2, s1, s2", PolyRing.lex );
puts "Ring: " + str(R);
puts;
one,r,l,z,c1,c2,s1,s2 = R.gens();
puts "gens: " + r.g... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: zero dimensional ideals radical decomposition
r = PolyRing.new(QQ(),"x,y,z",PolyRing.lex);
puts "Ring: " + str(r);
puts;
one,x,y,z = r.gens();
f1 = (x**2 - 5)**2;
f2 = (y**2 - 3)**3 * (y**2 - 5);
f3 = z**3 - x * y;
puts "f1 = " + ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: squarefree: characteristic p, finite
#r = PolyRing.new(QQ(),"x, y, z",PolyRing.lex)
r = PolyRing.new(ZM(5,field=true),"x, y, z",PolyRing.lex)
puts "Ring: " + str(r);
puts;
one,x,y,z = r.gens();
a = r.random(k=2,l=3);
b = r.random(k... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: ideal radical decomposition, dim > 0, char p separable
#r = Ring.new( "Rat(x) L" );
#r = Ring.new( "Q(x) L" );
r = PolyRing.new(ZM(5),"x,y,z",PolyRing.lex);
puts "Ring: " + str(r);
puts;
one,x,y,z = r.gens();
#f1 = (x**2 - 5)**2;
#... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# 2 univariate polynomials of degree 2 example for comprehensive GB
# integral/rational function coefficients
#r = Ring.new( "IntFunc(a3, b3, a2, b2, a1, b1, a0, b0) (x) L" );
r = PolyRing.new( PolyRing.new(ZZ(),"(a3, b3, a2, b2, a1, b1, a0, b0)",PolyRing.l... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# e-gb and d-gb example to compare with hermit normal form
r = PolyRing.new( ZZ(), "x4,x3,x2,x1", PolyRing.lex );
puts "Ring: " + str(r);
puts;
one,x4,x3,x2,x1 = r.gens();
f1 = x1 + 2 * x2 + 3 * x3 + 4 * x4 + 3;
f2 = 3 * x2 + 2 * x3 + x4 + 2;
f3 ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: zero dimensional ideals prime and primary decomposition
r = PolyRing.new(QQ(),"x,y,z",PolyRing.lex);
puts "Ring: " + str(r);
puts;
one,x,y,z = r.gens();
f1 = (x**2 - 5)**2;
f2 = y**3 - x;
f3 = z**2 - y * x;
puts "f1 = " + str(f1);... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: absolute factorization over Q
r = Ring.new( "Q(x,y) L" );
puts "Ring: " + str(r);
puts;
one,x,y = r.gens();
f1 = x**2 + y**2;
f2 = x**3 + y**2;
f3 = x**4 + 4;
f = f1**3 * f2**1 * f3**2;
puts "f = " + str(f);
puts;
startLog();
t ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Suzuki and Sato, ISSAC 2006, example 1
# integral function coefficients
#r = PolyRing.new( QQ(),"b,a,z,y,x", PolyRing.lex );
#r = PolyRing.new( RF( PolyRing.new(QQ(),"a, b",PolyRing.lex) ), "z,y,x", PolyRing.lex );
r = PolyRing.new( PolyRing.new(QQ(),"b,... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# tuzun, e-gb example
r = PolyRing.new(ZZ(),"t",PolyRing.lex)
puts "Ring: " + str(r);
puts;
one,x = r.gens();
f1 = 2 * t + 1;
f2 = t**2 + 1;
ff = r.ideal( "", [f1,f2] );
puts "ideal: " + str(ff);
puts;
#t = System.currentTimeMillis();
gg = ff.eGB();
#t ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: complex roots over Q
r = PolyRing.new(QQ(),"I,x,y,z",PolyRing.lex);
puts "Ring: " + str(r);
puts;
one,I,x,y,z = r.gens();
f1 = z - x - y * I;
f2 = I**2 + 1;
#f3 = z**3 - 2;
f3 = z**3 - 2*I;
puts "f1 = " + str(f1);
puts "f2 = " + s... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# chebyshev polynomial example
# T(0) = 1
# T(1) = x
# T(n) = 2 * x * T(n-1) - T(n-2)
r = Ring.new( "Z(x) L" );
puts "Ring: " + str(r);
puts;
# sage like: with generators for the polynomial ring
one,x = r.gens();
x2 = 2 * x;
N = 10;
T = [one,x];
for n in... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: factorization over Q(i)(sqrt2)
Q = PolyRing.new(QQ(),"i",PolyRing.lex);
puts "Q = " + str(Q);
e,a = Q.gens();
puts "e = " + str(e);
puts "a = " + str(a);
imag = a**2 + 1;
puts "imag = " + str(imag);
Qi = AN(imag,true);
pu... | Ruby |
#
# jruby examples for jas.
# $Id$
#
## \begin{PossoExample}
## \Name{Hawes2}
## \Parameters{a;b;c}
## \Variables{x;y[2];z[2]}
## \begin{Equations}
## x+2y_1z_1+3ay_1^2+5y_1^4+2cy_1 \&
## x+2y_2z_2+3ay_2^2+5y_2^4+2cy_2 \&
## 2 z_2+6ay_2+20 y_2^3+2c \&
## 3 z_1^2+y_1^2+b \&
## 3z_2^2+y_2^2+b \&
## \end{Equations}
## \en... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
#startLog();
# polynomial examples: factorization over Z_p
#r = Ring( "Mod 1152921504606846883 (x) L" );
#r = Ring( "Mod 19 (x) L" );
#r = Ring( "Mod 19 (x) L" );
r = PolyRing.new( GF(19), "x", PolyRing.lex );
puts "Ring: " + str(r);
puts
#one,x = r.gens... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
#startLog();
# polynomial examples: factorization
r = PolyRing.new( ZZ(), "x,y,z", PolyRing.lex );
puts "Ring: " + str(r);
puts
#one,x,y,z = r.gens();
#f = z * ( y + 1 )**2 * ( x**2 + x + 1 )**3;
#f = z * ( y + 1 ) * ( x**2 + x + 1 );
#f = ( y + 1 ) * (... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: real roots over Q
r = PolyRing.new(QQ(),"x",PolyRing.lex);
puts "Ring: " + str(r);
puts;
one,x = r.gens();
f1 = x * ( x - 1 ) * ( x - 2 ) * ( x - 3 ) * ( x - 4 ) * ( x - 5 ) * ( x - 6 ) * ( x - 7 ) ;
f2 = ( x - 1/2 ) * ( x - 1/3 ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: ideal prime decomposition in char p > 0, inseparable cases
cr = PolyRing.new(ZM(5),"c",PolyRing.lex);
puts "coefficient Ring: " + str(cr);
rf = RF(cr);
puts "coefficient quotient Ring: " + str(rf.ring);
r = PolyRing.new(rf,"x,y,z",Po... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# WA_32 solvable polynomial example
rs = """
# solvable polynomials, Weyl algebra A_3,2:
Rat(a,b,e1,e2,e3) G|3|
RelationTable
(
( e3 ), ( e1 ), ( e1 e3 - e1 ),
( e3 ), ( e2 ), ( e2 e3 - e2 )
)
""";
r = SolvableRing.new( rs );
puts "SolvableRing: " + str(... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
#startLog();
# polynomial examples: prime / primary decomposition in Q(sqrt(2))(x)(sqrt(x))[y,z]
Q = PolyRing.new(QQ(),"w2",PolyRing.lex);
puts "Q = " + str(Q);
e,a = Q.gens();
#puts "e = " + str(e);
puts "a = " + str(a);
root = a**2 - 2;
puts... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Montes JSC 2002, 33, 183-208, example 11.2
# integral function coefficients
r = PolyRing.new( PolyRing.new(QQ(),"f, e, d, c, b, a",PolyRing.lex), "y,x", PolyRing.lex );
#r = PolyRing.new( PolyRing.new(QQ(),"f, e, d, c, b, a",PolyRing.grad), "y,x", PolyRin... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# elementary integration atan examples
r = PolyRing.new(QQ(),"x",PolyRing.lex);
puts "r = " + str(r);
rf = RF(r);
puts "rf = " + str(rf.factory());
one,x = rf.gens();
puts "one = " + str(one);
puts "x = " + str(x);
puts;
#f = 1 / ( 1 + x**2 );
#f = ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# ? example
r = Ring.new( "Rat(x,y,z) L" );
puts "Ring: " + str(r);
puts;
ps = """
(
( z^3 - y ),
( y z - x ),
( y^3 - x^2 z ),
( x z^2 - y^2 )
)
""";
f = SimIdeal.new( r, ps );
puts "Ideal: " + str(f);
puts;
rg = f.GB();
puts "seq Output:" + str(r... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
#startLog();
# polynomial examples: factorization over Q(sqrt(2))(x)(sqrt(x))[y]
Yr = EF.new(QQ()).extend("w2","w2^2 - 2").extend("x").extend("wx","wx^2 - x").polynomial("y").build();
puts "Yr = " + str(Yr);
puts
one,w2,x,wx,y = Yr.gens();
puts "one ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# logic example from Kreutzer JdM 2008
#r = Ring.new( "Mod 2 (a,f,p,u) G" );
r = PolyRing.new( ZM(2), "(a,f,p,u)", PolyRing.grad );
puts "Ring: " + str(r);
puts;
ks = """
(
( a^2 - a ),
( f^2 - f ),
( p^2 - p ),
( u^2 - u )
)
""";
ps = """
(
( p f + ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
#startLog();
# example: Algebraic Statistics
# Drton, Sturmfels, Sullivant, example 2.1.3
#r = PolyRing(QQ(),"l1,l2",PolyRing.grad);
r = PolyRing.new(QQ(),"l1,l2",PolyRing.lex);
puts "Ring: " + r.to_s;
puts;
puts "gens: " + one.to_s + "," + l1.to_s + ", ... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Quantum plane example
rsan = """
AN[ (i) (i^2 + 1) ] (Y,X,x,y) G
RelationTable
(
( y ), ( x ), ( {i} x y )
( X ), ( Y ), ( {i} Y X )
)
""";
rsc = """
#not supported C(Y,X,x,y) G |2|
C(Y,X,x,y) G
RelationTable
(
( y ), ( x ), ( 0i1 x y )
( X ), ( Y )... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# sparse polynomial powers
#r = Ring( "Mod 1152921504606846883 (x,y,z) G" );
#r = Ring( "Rat(x,y,z) G" );
#r = Ring( "C(x,y,z) G" );
r = PolyRing.new( ZZ(), "(x,y,z)", PolyRing.lex );
puts "Ring: " + str(r);
puts;
one,x,y,z = r.gens();
puts "one = " + str... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Nabashima, ISSAC 2007, example Ex-Fig-2
# integral function coefficients
r = Ring.new( "IntFunc(a, b, c) (x) L" );
puts "Ring: " + str(r);
puts;
ps = """
(
( { a } x^3 ),
( { b } x^2 ),
( { c } x )
)
""";
#startLog();
f = r.paramideal( ps );
puts "... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# ? example
r = Ring.new( "Rat(x,y,z) L" );
print "Ring: " + str(r);
print;
ps = """
(
( z^3 - y ),
( y z - x ),
( y^3 - x^2 z ),
( x z^2 - y^2 )
)
""";
f = SimIdeal.new( r, ps );
print "Ideal: " + str(f);
print;
include_class "edu.jas.gbmod.Syzyg... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: absolute factorization over Q(i)
Qr = PolyRing.new(QQ(),"i",PolyRing.lex);
puts "Qr = " + str(Qr);
e,a = Qr.gens();
puts "e = " + str(e);
puts "a = " + str(a);
imag = a**2 + 1;
puts "imag = " + str(imag);
Qi = AN(imag,true... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# exterior calculus example
# Hartley and Tuckey, 1993,
# GB in Clifford and Grassmann algebras
rs = """
# exterior calculus example:
Rat(a,b,c,f,g,h,u,v,w,x,y,z) L
RelationTable
(
( b ), ( a ), ( - a b ),
( c ), ( a ), ( - a c ),
( f ), ( a ), ( - a f )... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# Raksanyi & Walter example
# integral/rational function coefficients
r = PolyRing.new(PolyRing.new(QQ(),"a1,a2,a3,a4",PolyRing.grad),"x1,x2,x3,x4",PolyRing.lex);
puts "r = " + str(r);
one,a1,a2,a3,a4,x1,x2,x3,x4 = r.gens();
puts "one = " + str(one);
put... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: real roots over Q for zero dimensional ideals
r = PolyRing.new(QQ(),"q,w,s,x",PolyRing.lex);
puts "Ring: " + str(r);
puts;
one,q,w,s,x = r.gens();
# EF.new(QQ()).realExtend("q","q^3 - 3", "[1,2]").realExtend("w", "w^2 - q", "[1,2]")... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# example from CLO(UAG), 4.4
#R = PolyRing( ZM(32003), "x,y,z" );
R = PolyRing.new( QQ(), "x,y,z" );
puts "Ring: " + str(R);
puts;
one,x,y,z = R.gens();
f1 = x**5 - x * y**6 - z**7;
f2 = x * y + y**3 + z**3;
f3 = x**2 + y**2 - z**2;
L = [f1,f2,f3];
#puts... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
#startLog();
# polynomial examples: factorization over Q
r = PolyRing.new( QQ(), "x", PolyRing.lex );
puts "Ring: " + str(r);
puts
one,x = r.gens();
#f = x**15 - 1;
#f = x * ( x + 1 )**2 * ( x**2 + x + 1 )**3;
#f = x**6 - 3 * x**5 + x**4 - 3 * x**3 - x**... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: real roots tower over Q
r = EF.new(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();
puts "Ring: " + str(r);
puts;
one,q,w,s,x = r.gens();
f =... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: squarefree: characteristic p, finite algebraic
ar = PolyRing.new(ZM(7,field=true),"i",PolyRing.lex)
one,i = ar.gens();
# irred for 7, 11, 19
r = PolyRing.new(AN(i**2+1,field=true),"x, y, z",PolyRing.lex)
puts "Ring: " + str(r);
puts;... | Ruby |
#
# jruby examples for jas.
# $Id$
#
require "examples/jas"
# polynomial examples: real roots over Q for zero dimensional ideals
r = PolyRing.new(QQ(),"x,y,z",PolyRing.lex);
puts "Ring: " + str(r);
puts;
one,x,y,z = r.gens();
f1 = (x**2 - 5)*(x**2 - 3)**2;
f2 = y**2 - 3;
f3 = z**3 - x * y;
puts "f1 = " + str(f1)... | Ruby |
#
# jruby examples for jas.
# $Id$
#
#load "examples/jas.rb"
require "examples/jas"
# non-commutative polynomial examples: solvable polynomials example
#r = WordPolyRing.new(QQ(),"a,b,e1,e2,e3");
r = WordPolyRing.new(QQ(),"a,b,e,f,g");
puts "WordPolyRing: " + str(r);
puts;
one,a,b,e,f,g = r.gens();
puts "one = " + ... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.