Package sage :: Package algebras :: Package old :: Module quatalg :: Class Algebra
[show private | hide private]
[frames | no frames]

Class Algebra

Gens --+
       |
Ring --+
       |
      Algebra

Known Subclasses:
Algebra_QQ

Method Summary
  __init__(self, K, a, b, gens)
Create the quaternion algebra over the field K with generators i and j and relations i^2 = a, j^2 = b, and i*j=-j*i.
  __call__(self, x)
Coerce x into the ring.
  __cmp__(self, other)
  __contains__(self, x)
  __repr__(self)
  assign_names(self, s)
  base_field(self)
  base_ring(self)
  basis(self)
  characteristic(self)
  constants(self)
  gen(self, i)
  is_atomic_repr(self)
True if the elements have atomic string representations, in the sense that they print if they print at s, then -s means the negative of s.
  is_field(self)
  name(self)
  names(self)
  ngens(self)
  random(self, bound)
  set_gens(self, g)
Changes the chosen generators of self.
  vector_space(self)
    Inherited from Ring
  __hash__(self)
  type(self)
    Inherited from Gens
  __getattr__(self, attrname)
  __getitem__(self, n)
  __getslice__(self, n, m)
  gens(self)
  list(self)

Method Details

__init__(self, K, a, b, gens=None)
(Constructor)

Create the quaternion algebra over the field K with generators i and j and relations i^2 = a, j^2 = b, and i*j=-j*i. A third generator is set to k = i*j.

Both a and b must be nonzero.

EXAMPLES:
Overrides:
sage.rings.ring.Ring.__init__

__call__(self, x)
(Call operator)

Coerce x into the ring.
Overrides:
sage.rings.ring.Ring.__call__ (inherited documentation)

is_atomic_repr(self)

True if the elements have atomic string representations, in the sense that they print if they print at s, then -s means the negative of s. For example, integers are atomic but polynomials are not.
Overrides:
sage.rings.ring.Ring.is_atomic_repr (inherited documentation)

set_gens(self, g)

Changes the chosen generators of self.

This function is mainly used by other easier-to-use constructors
of quaternion algebras.

INPUT:
    g -- list of three elements of self, such that the
         K-vector space spanned by 1, g[0], g[1], g[2] is of
         dimension 4.
          
OUTPUT:
    This function changes self by making the elements of g the
    generators.  Elements are printed in terms of the gi.  The
    names used to represent the gi are same as were used
    before calling set_gens.  To change them, use the
    assign_names function.

EXAMPLES:
    >>> A = QuaternionAlgebra(RationalField(), -1,-7)
    >>> i,j,k = A.gens()
    >>> i
    i
    >>> j**2
    -7
    >>> (k+i)**2
    -8

The underlying vector that represents j:
    >>> j.vector()
    (0 0 1 0)

Now if we change generators by swapping i and j,
then the 0th generator will have square -7, since it
is really what we called j above.
    >>> A.set_gens([j,i,k+i])
    >>> i
    j

It's a good idea to either assign the gens to the your
variables, or change the names of your variables.
    >>> i,j,k = A.gens()
    >>> i**2
    -7
    >>> i
    i
    >>> i*j
    j - k
    >>> k**2
    -8

The underlying vector does not change:
    >>> i.vector()
    (0 0 1 0)
    
The difference is that now A.gen(0) is j, A.gen(1) is i,
and elements are printed in terms of these generators.

Generated by Epydoc 2.1 on Fri May 20 19:41:04 2005 http://epydoc.sf.net