<Section Label="sec-matrix-ops">
<Heading>Some operations for matrices</Heading>
<ManSection>
<Oper Name="DirectSumDecompositionMatrices"
Arg="M" />
<Description>
In June 2023 Hongyi Zhao asked in the Forum for a function to implement
matrix decomposition into blocks.
Such a function was then provided by Pedro García-Sánchez.
Hongyi Zhao then requested that the function be added to
<Package>Utils</Package>.
What is provided here is a revised version of the original solution,
returning a list of decompositions.
<P/>
This function is a partial inverse to the undocumented library operation
<C>DirectSumMat</C>.
So if <M>L</M> is the list of diagonal decompositions of a matrix <M>M</M>
then each entry in <M>L</M> is a list of matrices, and the direct sum of
each of these lists is equal to the original <M>M</M>.
<P/>
In the following examples, <M>M_6</M> is an obvious direct sum
with <M>3</M> blocks.
<M>M_4</M> is an example with three decompositions,
while <M>M_8 = M_4 \oplus M_4</M> has <M>16</M> decompositions (not listed).
<P/>
</Description>
</ManSection>
<Example>
<![CDATA[
gap> M6 := [ [1,2,0,0,0,0], [3,4,0,0,0,0], [5,6,0,0,0,0],
> [0,0,9,0,0,0], [0,0,0,1,2,3], [0,0,0,4,5,6] ];;
gap> Display( M6 );
[ [ 1, 2, 0, 0, 0, 0 ],
[ 3, 4, 0, 0, 0, 0 ],
[ 5, 6, 0, 0, 0, 0 ],
[ 0, 0, 9, 0, 0, 0 ],
[ 0, 0, 0, 1, 2, 3 ],
[ 0, 0, 0, 4, 5, 6 ] ]
gap> L6 := DirectSumDecompositionMatrices( M6 );
[ [ [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ], [ [ 9 ] ], [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
] ]
The current method does not, however, catch all possible decompositions.
In the following example the matrix <M>M_5</M> has its third row
and third column extirely zero, and the only decomposition found
has a <M>[0]</M> factor.
There are clearly two <M>2</M>-factor decompositions with a
<M>2</M>-by-<M>3</M> and a <M>3</M>-by-<M>2</M> factor,
but these are not found at present.
<P/>
<Example>
<![CDATA[
gap> M5 := [ [1,2,0,0,0], [3,4,0,0,0], [0,0,0,0,0],
> [0,0,0,6,7], [0,0,0,8,9] ];;
gap> Display(M5);
[ [ 1, 2, 0, 0, 0 ],
[ 3, 4, 0, 0, 0 ],
[ 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 6, 7 ],
[ 0, 0, 0, 8, 9 ] ]
gap> L5 := DirectSumDecompositionMatrices( M5 );
[ [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 0 ] ], [ [ 6, 7 ], [ 8, 9 ] ] ] ]
]]>
</Example>
</Section>
</Chapter>
¤ Dauer der Verarbeitung: 0.26 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.