Previous Page Next Page Contents

Dom::MatrixGroup -- the Abelian group of m x n matrices

Introduction

Dom::MatrixGroup(m, n, R) creates the Abelian group of m x n matrices over the component ring R.

Domain

Dom::MatrixGroup(m, n <, R>)

Parameters

m, n - positive integers (matrix dimension)
R - a commutative ring, i.e., a domain of category Cat::CommutativeRing; default is Dom::ExpressionField()

Details

Creating Elements

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)

Parameters

Array - an mxn array
Matrix - an mxn matrix, i.e., an element of a domain of category Cat::Matrix
List - a list of matrix components
ListOfRows - a list of at most m rows; each row is a list of at most n matrix components
f - a function or a functional expression with two parameters (the row and column index)
g - a function or a functional expression with one parameter (the row index)

Options

Diagonal - create a diagonal matrix
Banded - create a banded Toeplitz matrix

Categories

Cat::Matrix(R)

, Cat::AbelianGroup

if R has Cat::Field, then
Cat::VectorSpace(R)

Related Domains

Dom::Matrix, Dom::SquareMatrix

Details

Option: Diagonal

Option: Banded

Entries

one

is only defined if m is equal to n; in that case it defines the n x n identity matrix.

randomDimen

is set to [m, n].

zero

is the m x n zero matrix.

Method evalp: evaluating matrices of polynomials at a certain point

Method identity: identity matrix

Method matdim: matrix dimension

Method random: random matrix generation

Method _concat: horizontally concatenation of matrices

Method _index: matrix indexing

Method concatMatrix: horizontally concatenation of matrices

Method col: extracting a column

Method delCol: deleting a column

Method delRow: deleting a row

Method row: extracting a row

Method stackMatrix: concatenating of matrices vertically

Method convert: conversion into a matrix

Example 1

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 x 4 matrices over the rationals:

>> MatGQ := Dom::MatrixGroup(3, 4, Dom::Rational)
                   Dom::MatrixGroup(3, 4, Dom::Rational)
>> MatGQ::hasProp(Cat::AbelianGroup), MatGQ::hasProp(Cat::Ring)
                                TRUE, FALSE

MatGQ is a commutative group with respect to the addition of matrices. The unit of this group is the 3 x 4 zero matrix:

>> MatGQ::zero
                             +-            -+
                             |  0, 0, 0, 0  |
                             |              |
                             |  0, 0, 0, 0  |
                             |              |
                             |  0, 0, 0, 0  |
                             +-            -+

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 super-domain of MatGQ.

For example, if we define the matrix:

>> A := MatGQ([[1, 2, 1, 2], [-5, 3], [2, 1/3, 0, 1]])
                            +-               -+
                            |   1,  2,  1, 2  |
                            |                 |
                            |  -5,  3,  0, 0  |
                            |                 |
                            |   2, 1/3, 0, 1  |
                            +-               -+

and delete its third column, we get the matrix:

>> MatGQ::delCol(A, 3)
                             +-            -+
                             |   1,  2,  2  |
                             |              |
                             |  -5,  3,  0  |
                             |              |
                             |   2, 1/3, 1  |
                             +-            -+

which is of the domain type:

>> domtype(%)
                        Dom::Matrix(Dom::Rational)

As another example we create the 3 x 3 identity matrix using the method "identity" of our domain:

>> E3 := MatGQ::identity(3)
                               +-         -+
                               |  1, 0, 0  |
                               |           |
                               |  0, 1, 0  |
                               |           |
                               |  0, 0, 1  |
                               +-         -+

This is also a matrix of the domain Dom::Matrix(Dom::Rational):

>> domtype(E3)
                        Dom::Matrix(Dom::Rational)

If we concatenate E3 to the right of the matrix A defined above, we get the 3 x 7 matrix:

>> B := A . E3
                       +-                        -+
                       |   1,  2,  1, 2, 1, 0, 0  |
                       |                          |
                       |  -5,  3,  0, 0, 0, 1, 0  |
                       |                          |
                       |   2, 1/3, 0, 1, 0, 0, 1  |
                       +-                        -+

which is of the domain type Dom::Matrix(Dom::Rational):

>> domtype(B)
                        Dom::Matrix(Dom::Rational)

Example 2

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)
                               +-         -+
                               |  1, 2, 3  |
                               |           |
                               |  2, 4, 6  |
                               +-         -+

To convert A into a matrix of the domain MatC, enter:

>> coerce(A, MatC)
                               +-         -+
                               |  1, 2, 3  |
                               |           |
                               |  2, 4, 6  |
                               +-         -+
>> domtype(%)
                         Dom::Matrix(Dom::Complex)

The conversion is done component-wise. For example, we define the following matrix:

>> B := MatC([[0, 1, 0], [exp(I), 0, 1]])
                            +-              -+
                            |     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)
                                   FAIL

Note: The system function coerce uses the methods "convert" and "convert_to" implemented by any domain created with Dom::MatrixGroup and Dom::Matrix.

Super-Domain

Dom::Matrix

Axioms

if R has Ax::canonicalRep, then
Ax::canonicalRep

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000