| Home | Trees | Indices | Help |
|---|
|
|
Univariate Polynomial Rings
SAGE implements sparse and dense polynomials over commutative and
non-commutative rings. In the non-commutative case, the polynomial
variable commutes with the elements of the base ring.
AUTHOR:
-- William Stein
-- Kiran Kedlaya (2006-02-13): added macaulay2 option
-- Martin Albrecht (2006-08-25): removed it again as it isn't needed anymore
EXAMPLES:
Creating a polynomial ring injects the variable into the interpreter namespace:
sage: z = QQ['z'].0
sage: (z^3 + z - 1)^3
z^9 + 3*z^7 - 3*z^6 + 3*z^5 - 6*z^4 + 4*z^3 - 3*z^2 + 3*z - 1
Saving and loading of polynomial rings works:
sage: loads(dumps(QQ['x'])) == QQ['x']
True
sage: k = PolynomialRing(QQ['x'],'y'); loads(dumps(k))==k
True
sage: k = PolynomialRing(ZZ,'y'); loads(dumps(k)) == k
True
sage: k = PolynomialRing(ZZ,'y', sparse=True); loads(dumps(k))
Sparse Univariate Polynomial Ring in y over Integer Ring
The rings of sparse and dense polynomials in the same variable are
canonically isomorphic:
sage: PolynomialRing(ZZ,'y', sparse=True) == PolynomialRing(ZZ,'y')
True
sage: QQ['y'] < QQ['x']
False
sage: QQ['y'] < QQ['z']
True
We create a polynomial ring over a quaternion algebra:
sage: A.<i,j,k> = QuaternionAlgebra(QQ, -1,-1)
sage: R.<w> = PolynomialRing(A,sparse=True)
sage: f = w^3 + (i+j)*w + 1
sage: f
w^3 + (i + j)*w + 1
sage: f^2
w^6 + (2*i + 2*j)*w^4 + 2*w^3 + (-2)*w^2 + (2*i + 2*j)*w + 1
sage: f = w + i ; g = w + j
sage: f * g
w^2 + (i + j)*w + k
sage: g * f
w^2 + (i + j)*w + -k
TESTS:
sage: K.<x>=FractionField(QQ['x'])
sage: V.<z> = K[]
sage: x+z
z + x
|
|||
|
|||
|
|||
|
|||
|
|||
ZZ_sage =
|
|||
|
|||
Return True if x is a *univariate* polynomial ring (and not a sparse multivariate
polynomial ring in one variable).
EXAMPLES:
sage: is_PolynomialRing(2)
False
This polynomial ring is not univariate.
sage: is_PolynomialRing(ZZ['x,y,z'])
False
sage: is_MPolynomialRing(ZZ['x,y,z'])
True
sage: is_PolynomialRing(ZZ['w'])
True
Univariate means not only in one variable, but is a specific data
type. There is a multivariate (sparse) polynomial ring data type,
which supports a single variable as a special case.
sage: is_PolynomialRing(PolynomialRing(ZZ,1,'w'))
False
sage: R = PolynomialRing(ZZ,1,'w'); R
Multivariate Polynomial Ring in w over Integer Ring
sage: is_PolynomialRing(R)
False
sage: type(R)
<class 'sage.rings.polynomial.multi_polynomial_ring.MPolynomialRing_polydict_domain'>
|
Return a polynomial indeterminate.
INPUT:
* polygen(base_ring, name="x")
* polygen(ring_element, name="x")
If the first input is a ring, return a polynomial generator
over that ring. If it is a ring element, return a polynomial
generator over the parent of the element.
EXAMPLES:
sage: z = polygen(QQ,'z')
sage: z^3 + z +1
z^3 + z + 1
sage: parent(z)
Univariate Polynomial Ring in z over Rational Field
NOTE: If you give a list or comma separated string to polygen, you'll
get a tuple of indeterminates, exactly as if you called polygens.
|
Return indeterminates over the given base ring with the given names.
EXAMPLES:
sage: x,y,z = polygens(QQ,'x,y,z')
sage: (x+y+z)^2
x^2 + 2*x*y + y^2 + 2*x*z + 2*y*z + z^2
sage: parent(x)
Multivariate Polynomial Ring in x, y, z over Rational Field
sage: t = polygens(QQ,['x','yz','abc'])
sage: t
(x, yz, abc)
|
|
|||
ZZ_sage
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0beta1 on Thu Jul 17 04:23:28 2008 | http://epydoc.sourceforge.net |