GAP (GradedRingForHomalg) - Appendix A: The Matrix Tool Operations

Goto Chapter: Top 1 2 3 4 5 6 A B Bib Ind
[Top of Book] [Contents] [Previous Chapter] [Next Chapter]

[MathJax on]

A The Matrix Tool Operations
A.1 The Tool Operations without a Fallback Method
A.2 The Tool Operations with a Fallback Method
A.2-1 MonomialMatrix
A.2-2 RandomMatrixBetweenGradedFreeLeftModules
A.2-3 RandomMatrixBetweenGradedFreeRightModules
A.2-4 Diff

### A The Matrix Tool Operations

The functions listed below are components of the `homalgTable` object stored in the ring. They are only indirectly accessible through standard methods that invoke them.

#### A.1 The Tool Operations without a Fallback Method

There are matrix methods for which homalg needs a `homalgTable` entry for non-internal rings, as it cannot provide a suitable fallback. Below is the list of these `homalgTable` entries.

#### A.2 The Tool Operations with a Fallback Method

These are the methods for which it is recommended for performance reasons to have a `homalgTable` entry for non-internal rings. homalg only provides a generic fallback method.

##### A.2-1 MonomialMatrix

`‣ MonomialMatrix`( d, R ) | ( operation )

Returns: a homalg matrix

The column matrix of d-th monomials of the homalg graded ring R.

    gap> R := HomalgFieldOfRationalsInDefaultCAS( ) * "x,y,z";;
    gap> S := GradedRing( R );;
    gap> m := MonomialMatrix( 2, S );
    <A ? x 1 matrix over a graded ring>
    gap> NrRows( m );
    6
    gap> m;
    <A 6 x 1 matrix over a graded ring>
    gap> Display( m );
    x^2,
    x*y,
    x*z,
    y^2,
    y*z,
    z^2
    (over a graded ring)

##### A.2-2 RandomMatrixBetweenGradedFreeLeftModules

`‣ RandomMatrixBetweenGradedFreeLeftModules`( degreesS, degreesT, R ) | ( operation )

Returns: a homalg matrix

A random r × c-matrix between the graded free left modules R^(-degreesS) -> R^(-degreesT), where r =`Length`(degreesS) and c =`Length`(degreesT).

    gap> R := HomalgFieldOfRationalsInDefaultCAS( ) * "a,b,c";;
    gap> S := GradedRing( R );;
    gap> rand := RandomMatrixBetweenGradedFreeLeftModules( [ 2, 3, 4 ], [ 1, 2 ], S );
    <A 3 x 2 matrix over a graded ring>
    gap> #Display( rand );
    gap> #a-2*b+2*c,                                                2,
    gap> #a^2-a*b+b^2-2*b*c+5*c^2,                                  3*c,
    gap> #2*a^3-3*a^2*b+2*a*b^2+3*a^2*c+a*b*c-2*b^2*c-3*b*c^2-2*c^3,a^2-4*a*b-3*a*c-c^2

##### A.2-3 RandomMatrixBetweenGradedFreeRightModules

`‣ RandomMatrixBetweenGradedFreeRightModules`( degreesT, degreesS, R ) | ( operation )

Returns: a homalg matrix

A random r × c-matrix between the graded free right modules R^(-degreesS) -> R^(-degreesT), where r =`Length`(degreesT) and c =`Length`(degreesS).

    gap> R := HomalgFieldOfRationalsInDefaultCAS( ) * "a,b,c";;
    gap> S := GradedRing( R );;
    gap> rand := RandomMatrixBetweenGradedFreeRightModules( [ 1, 2 ], [ 2, 3, 4 ], S );
    <A 2 x 3 matrix over a graded ring>
    gap> #Display( rand );
    gap> #a-2*b-c,a*b+b^2-b*c,2*a^3-a*b^2-4*b^3+4*a^2*c-3*a*b*c-b^2*c+a*c^2+5*b*c^2-2*c^3,
    gap> #-5,     -2*a+c,     -2*a^2-a*b-2*b^2-3*a*c

##### A.2-4 Diff

`‣ Diff`( D, N ) | ( operation )

Returns: a homalg matrix

If D is a f × p-matrix and N is a g × q-matrix then H=Diff(D,N) is an fg × pq-matrix whose entry H[g*(i-1)+j,q*(k-1)+l] is the result of differentiating N[j,l] by the differential operator corresponding to D[i,k]. (Here we follow the Macaulay2 convention.)

    gap> S := HomalgFieldOfRationalsInDefaultCAS( ) * "a,b,c" * "x,y,z";;
    gap> D := HomalgMatrix( "[ \
    > x,2*y,   \
    > y,a-b^2, \
    > z,y-b    \
    > ]", 3, 2, S );
    <A 3 x 2 matrix over an external ring>
    gap> N := HomalgMatrix( "[ \
    > x^2-a*y^3,x^3-z^2*y,x*y-b,x*z-c, \
    > x,        x*y,      a-b,  x*a*b  \
    > ]", 2, 4, S );
    <A 2 x 4 matrix over an external ring>
    gap> H := Diff( D, N );
    <A 6 x 8 matrix over an external ring>
    gap> Display( H );
    2*x,     3*x^2, y,z,  -6*a*y^2,-2*z^2,2*x,0,
    1,       y,     0,a*b,0,       2*x,   0,  0,
    -3*a*y^2,-z^2,  x,0,  -y^3,    0,     0,  0,
    0,       x,     0,0,  0,       0,     1,  b*x,
    0,       -2*y*z,0,x,  -3*a*y^2,-z^2,  x+1,0,
    0,       0,     0,0,  0,       x,     1,  -a*x

[Top of Book] [Contents] [Previous Chapter] [Next Chapter]
Goto Chapter: Top 1 2 3 4 5 6 A B Bib Ind

generated by GAPDoc2HTML