UserManual | 日本語

ring

The ring module is a module for rings.

Base Classes

There are the following base classes defined.

Ring
The base class of all ring classes.
CommutativeRing
The base class of all commutative ring classes.
Field
The base class of all field classes.
QuotientField
The base classes of all field of quotients classes.

These classes are used to make a derived classes, and thus have no direct instances. There are also classes for elements of them:

They also have no direct instances.

Properties of commutative rings

There are some properties of commutative rings, algorithms should be chosen accordingly. To express such properties, there is a class CommutativeRingProperties. CommutativeRingProperties class treats

Euclidean(Euclidean domain),
PID(Principal Ideal Domain),
UFD(Unique Factorization Domain),
Noetherian(Noetherian ring (domain)),
field(Field)

If one specify a stronger property, then it implies to weaker properties:

>>> prop = CommutativeRingProperties()
>>> prop.setIspid(True)
>>> prop.ispid()
True
>>> prop.isufd()
True

Methods like ispid return three kinds of values;True, False, None. The meanings of True and False are obvious, but None means unknown here. When it is used like:

if prop.ispid():
  do_something()

None means same as False i.e. negative, and do_something is done if the result is clearly True. We don't recommend but it is possible to write a code for each of False and None.

Ideal class

The class represents an ideal of a commutative ring is Ideal*1*2.

Currently, the ideal should be represented by its generator elements. There are, therefore, irrepresentable ideals for non-Noetherian commutative rings. Moreover, ideals defined other than their generators cannot be instanciated without explicit generators.

The class is also used as a base class.

Ring of residue classes

A class defines a ring of residue classes by a ring and an ideal is ResidueClassRing. Its elements are ResidueClass.

Function

getRing(obj)

Return a ring to which 'obj' belongs.
Mainly for python built-in objects such as int or float.
(new in 0.4.1)


*1 Is CommutativeRingIdeal a more appropriate name?
*2 In the future, it should have a caching mechanism.

Last-modified: 2005-12-18 (日) 17:50:23