Home | Trees | Index | Help |
|
---|
Package sage :: Package algebras :: Module quatalg :: Class Algebra |
|
Gens
--+ |Ring
--+ | Algebra
Algebra_QQ
Method Summary | |
---|---|
Returns the quaternion algebra over the field K with generators i and j and the following relations: i^2 = a (!= 0) j^2 = b (!= 0) i*j + j*i = c A third generator is set to k = i*j. | |
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)
| |
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)
| |
Changes the chosen generators of self. | |
vector_space(self)
| |
Inherited from Ring | |
| |
| |
Inherited from Gens | |
| |
| |
| |
| |
|
Method Details |
---|
__init__(self,
K,
a,
b,
c=0,
gens=None)
|
__call__(self,
x)
Coerce x into the ring.
|
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.
|
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. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon May 9 17:57:02 2005 | http://epydoc.sf.net |