Package sage :: Package rings :: Module fraction_field
[hide private]
[frames] | no frames]

Module fraction_field

source code


Fraction Field of Integral Domains

AUTHOR: William Stein (with input from David Joyner, David Kohel, and
        Joe Wetherell)

EXAMPLES:
Quotienting is a constructor for an element of the fraction field:
    sage: R.<x> = QQ[]
    sage: (x^2-1)/(x+1)
    x - 1
    sage: parent((x^2-1)/(x+1))
    Fraction Field of Univariate Polynomial Ring in x over Rational Field
    

The GCD is not taken (since it doesn't converge sometimes) in the inexact case.
    sage: Z.<z> = CC[]
    sage: I = CC.gen()
    sage: (1+I+z)/(z+0.1*I)
    (1.00000000000000*z + 1.00000000000000 + 1.00000000000000*I)/(1.00000000000000*z + 0.100000000000000*I)
    sage: (1+I*z)/(z+1.1)
    (1.00000000000000*I*z + 1.00000000000000)/(1.00000000000000*z + 1.10000000000000)
    
    
TESTS:
    sage: F = FractionField(IntegerRing())
    sage: F == loads(dumps(F))
    True
    
    sage: F = FractionField(PolynomialRing(RationalField(),'x'))
    sage: F == loads(dumps(F))
    True
    
    sage: F = FractionField(PolynomialRing(IntegerRing(),'x'))
    sage: F == loads(dumps(F))
    True

    sage: F = FractionField(PolynomialRing(RationalField(),2,'x'))
    sage: F == loads(dumps(F))
    True



Classes [hide private]
  FractionField_generic
The fraction field of an integral domain.
Functions [hide private]
 
FractionField(R, names=['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atlas-3.8.1', 'a...)
Create the fraction field of the integral domain R.
source code
 
is_FractionField(x) source code
Function Details [hide private]

FractionField(R, names=['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atlas-3.8.1', 'a...)

source code 

Create the fraction field of the integral domain R.

INPUT:
    R -- an integral domain
    names -- ignored

EXAMPLES:
We create some example fraction fields.
    sage: FractionField(IntegerRing())
    Rational Field
    sage: FractionField(PolynomialRing(RationalField(),'x'))
    Fraction Field of Univariate Polynomial Ring in x over Rational Field
    sage: FractionField(PolynomialRing(IntegerRing(),'x'))
    Fraction Field of Univariate Polynomial Ring in x over Integer Ring
    sage: FractionField(PolynomialRing(RationalField(),2,'x'))
    Fraction Field of Multivariate Polynomial Ring in x0, x1 over Rational Field

Dividing elements often implicitly creates elements of the fraction field.
    sage: x = PolynomialRing(RationalField(), 'x').gen()
    sage: f = x/(x+1)
    sage: g = x**3/(x+1)
    sage: f/g
    1/x^2
    sage: g/f
    x^2

The input must be an integral domain.
    sage: Frac(Integers(4))
    Traceback (most recent call last):
    ...
    TypeError: R must be an integral domain.