The Abelian group of matrices
Dom::MatrixGroup(m
,n
, <R
>)
Dom::MatrixGroup(m, n, R)(Array
)
Dom::MatrixGroup(m, n, R)(Matrix
)
Dom::MatrixGroup(m, n, R)(<m, n
>)
Dom::MatrixGroup(m, n, R)(<m, n
>,List
)
Dom::MatrixGroup(m, n, R)(<m, n
>,ListOfRows
)
Dom::MatrixGroup(m, n, R)(<m, n
>,f
)
Dom::MatrixGroup(m, n, R)(<m, n
>,List
, <Diagonal>)
Dom::MatrixGroup(m, n, R)(<m, n
>,g
, <Diagonal>)
Dom::MatrixGroup(m, n, R)(<m, n
>,List
, <Banded>)
Dom::MatrixGroup(m, n, R)
creates a domain
which represents the Abelian group of m×n matrices
over the component ring R
, i.e., it is a domain
of category Cat::AbelianGroup
.
The domain Dom::ExpressionField()
is used
as the component ring for the matrices if the optional parameter R
is
not given.
For matrices of a domain created by Dom::MatrixGroup(m,
n, R)
, matrix arithmetic is implemented by overloading the
standard arithmetical operators +, , *, /
and ^
.
All functions of the linalg package dealing with matrices can be
applied.
Dom::MatrixGroup(m, n, R)
has the domain Dom::Matrix(R)
as
its super domain, i.e., it inherits each method which is defined by Dom::Matrix(R)
and
not reimplemented by Dom::MatrixGroup(m, n, R)
.
Methods described below are implemented by Dom::MatrixGroup
.
The domain Dom::Matrix(R)
represents matrices
over R
of arbitrary size, and it therefore does
not have any algebraic structure (except of being a set of
matrices).
The domain Dom::SquareMatrix(n, R)
represents
the ring of n×n matrices
over R.
Dom::MatrixGroup(m, n, R)(Array)
and Dom::MatrixGroup(m,
n, R)(Matrix)
create a new matrix formed by the entries
of Array
and Matrix
, respectively.
The components of Array
and Matrix
,
respectively, are converted into elements of the domain R
.
An error message is issued if one of these conversions fails.
The call Dom::MatrixGroup(m, n, R)( m , n )
returns
the m×n zero
matrix. Note that the m×n zero
matrix can also be found in the entry "zero"
(see
below).
Dom::MatrixGroup(m, n, R)( m , n List)
creates
an m×n matrix
with components taken from the list List
.
This call is only allowed for m×1 or 1
×n matrices, i.e., if
either m
or n
is equal to one.
If the list has too few entries, the remaining components of the matrix are set to zero.
The entries of the list are converted into elements of the domain R
.
An error message is issued if one of these conversions fails.
Dom::MatrixGroup(m, n, R)( m , n ListOfRows)
creates
an m×n matrix
with components taken from the nested list ListOfRows
.
Each inner list corresponds to a row of the matrix.
If an inner list has less than n
entries,
the remaining components in the corresponding row of the matrix are
set to zero. If there are less than m
inner lists,
the remaining lower rows of the matrix are filled with zeroes.
The entries of the inner lists are coerced into elements of
the domain R
. An error message is issued if one
of these conversions fails.
It might be a good idea first to create a twodimensional array from that list before calling Dom::MatrixGroup(m,
n, R)
. This is due to the fact that creating a matrix from
an array is the fastest way one can achieve. However, in this case
the sublists must have the same number of elements.
Dom::MatrixGroup(m, n, R)( m , n f)
returns
the matrix whose (i, j)th
component is the value of the function call f(i, j)
.
The row index i ranges
from 1 to m
and
the column index j from 1 to n
.
The function values are coerced into elements of the domain R
.
An error message is issued if one of these conversions fails.
Dom::Matrix
(R)
If R
has Ax::canonicalRep
, then Ax::canonicalRep
.
A lot of examples can be found on the help page of the domain
constructor Dom::Matrix
, and most of them are also
examples for working with domains created by Dom::MatrixGroup
.
This example only highlights some differences with respect to working
with matrices of the domain Dom::Matrix(R)
.
The following command defines the abelian group of 3 ×4 matrices over the rationals:
MatGQ := Dom::MatrixGroup(3, 4, Dom::Rational)
MatGQ::hasProp(Cat::AbelianGroup), MatGQ::hasProp(Cat::Ring)
MatGQ
is a commutative group with respect
to the addition of matrices. The unit of this group is the 3
×4 zero matrix:
MatGQ::zero
Note that some operations defined by the domain MatGQ
return
matrices which are no longer elements of the matrix group. They return
matrices of the domain Dom::Matrix(Dom::Rational)
,
the superdomain of MatGQ
.
For example, if we define the matrix:
A := MatGQ([[1, 2, 1, 2], [5, 3], [2, 1/3, 0, 1]])
and delete its third column, we get the matrix:
MatGQ::delCol(A, 3)
which is of the domain type:
domtype(%)
As another example we create the 3×3 identity
matrix using the method "identity"
of our domain:
E3 := MatGQ::identity(3)
This is also a matrix of the domain Dom::Matrix(Dom::Rational)
:
domtype(E3)
If we concatenate E3
to the right of the
matrix A
defined above, we get the 3
×7 matrix:
B := A . E3
which is of the domain type Dom::Matrix(Dom::Rational)
:
domtype(B)
We can convert a matrix from a domain created with Dom::MatrixGroup
into
or from another matrix domain, as shown next:
MatGR := Dom::MatrixGroup(2, 3, Dom::Real): MatC := Dom::Matrix(Dom::Complex):
A := MatGR((i, j) > i*j)
To convert A
into a matrix of the domain MatC
,
enter:
coerce(A, MatC)
domtype(%)
The conversion is done componentwise. For example, we define the following matrix:
B := MatC([[0, 1, 0], [exp(I), 0, 1]])
The matrix B has
one complex component and therefore cannot be converted into the domain MatGR
:
coerce(B, MatGR)
Note: The system function coerce
uses the methods "convert"
and "convert_to"
implemented
by any domain created with Dom::MatrixGroup
and Dom::Matrix
.

Positive integers (matrix dimension) 

A commutative ring, i.e., a domain of category 

An m×n array 

An m×n matrix,
i.e., an element of a domain of category 

A list of matrix components 

A list of at most 

A function or a functional expression with two parameters (the row and column index) 

A function or a functional expression with one parameter (the row index) 

Create a diagonal matrix With the option
The entries of
The function values are coerced into elements of the domain 

Create a banded Toeplitz matrix With the option A banded matrix has all entries zero outside the main diagonal and some of the adjacent sub and superdiagonals.
All elements of the main diagonal of the created matrix are
initialized with the middle element of The entries of 
"one"  is only defined if 
"randomDimen"  is set to 
"zero"  is the m×n zero matrix. 