Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/utils/doc/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 11.8.2025 mit Größe 8 kB image not shown  

Quelle  chap6.html   Sprache: HTML

 
 products/Sources/formale Sprachen/GAP/pkg/utils/doc/chap6.html


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (Utils) - Chapter 6: Matrices</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap6"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chap12.html">12</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a>   <a href="chap0.html#contents">[Contents]</a>    <a href="chap5.html">[Previous Chapter]</a>    <a href="chap7.html">[Next Chapter]</a>   </div>

<p id="mathjaxlink" class="pcenter"><a href="chap6_mj.html">[MathJax on]</a></p>
<p><a id="X812CCAB278643A59" name="X812CCAB278643A59"></a></p>
<div class="ChapSects"><a href="chap6.html#X812CCAB278643A59">6 <span class="Heading">Matrices</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6.html#X802118FB7C94D6BA">6.1 <span class="Heading">Some operations for matrices</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6.html#X787B89237E1398B6">6.1-1 DirectSumDecompositionMatrices</a></span>
</div></div>
</div>

<h3>6 <span class="Heading">Matrices</span></h3>

<p><a id="X802118FB7C94D6BA" name="X802118FB7C94D6BA"></a></p>

<h4>6.1 <span class="Heading">Some operations for matrices</span></h4>

<p><a id="X787B89237E1398B6" name="X787B89237E1398B6"></a></p>

<h5>6.1-1 DirectSumDecompositionMatrices</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DirectSumDecompositionMatrices</code>( <var class="Arg">M</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>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 <strong class="pkg">Utils</strong>. What is provided here is a revised version of the original solution, returning a list of decompositions.</p>

<p>This function is a partial inverse to the undocumented library operation <code class="code">DirectSumMat</code>. So if <span class="SimpleMath">L</span> is the list of diagonal decompositions of a matrix <span class="SimpleMath">M</span> then each entry in <span class="SimpleMath">L</spanis a list of matrices, and the direct sum of each of these lists is equal to the original <span class="SimpleMath">M</span>.</p>

<p>In the following examples, <span class="SimpleMath">M_6</span> is an obvious direct sum with <span class="SimpleMath">3</span> blocks. <span class="SimpleMath">M_4</span> is an example with three decompositions, while <span class="SimpleMath">M_8 = M_4 ⊕ M_4</span> has <span class="SimpleMath">16</span> decompositions (not listed).</p>


<div class="example"><pre>

<span class="GAPprompt">gap></span> <span class="GAPinput">M6 := [ [1,2,0,0,0,0], [3,4,0,0,0,0], [5,6,0,0,0,0],                       </span>
<span class="GAPprompt">></span> <span class="GAPinput">           [0,0,9,0,0,0], [0,0,0,1,2,3], [0,0,0,4,5,6] ];;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">Display( M6 );</span>
[ [  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 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">L6 := DirectSumDecompositionMatrices( M6 );</span>
[ [ [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ], [ [ 9 ] ], [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] 
     ] ]

<span class="GAPprompt">gap></span> <span class="GAPinput">M4 := [ [0,3,0,0], [0,0,0,0], [0,0,0,0], [0,0,4,0] ];;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">Display( M4 );</span>
[ [  0,  3,  0,  0 ],
  [  0,  0,  0,  0 ],
  [  0,  0,  0,  0 ],
  [  0,  0,  4,  0 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">L4 := DirectSumDecompositionMatrices( M4 );</span>
[ [ [ [ 0, 3 ] ], [ [ 0, 0 ], [ 0, 0 ], [ 4, 0 ] ] ], 
  [ [ [ 0, 3 ], [ 0, 0 ] ], [ [ 0, 0 ], [ 4, 0 ] ] ], 
  [ [ [ 0, 3 ], [ 0, 0 ], [ 0, 0 ] ], [ [ 4, 0 ] ] ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">for L in L4 do </span>
<span class="GAPprompt">></span> <span class="GAPinput">       A := DirectSumMat( L );; </span>
<span class="GAPprompt">></span> <span class="GAPinput">       if ( A = M4 ) then Print( "yes, A = M4\n" ); fi; </span>
<span class="GAPprompt">></span> <span class="GAPinput">   od;</span>
yes, A = M4
yes, A = M4
yes, A = M4

<span class="GAPprompt">gap></span> <span class="GAPinput">M8 := DirectSumMat( M4, M4 );; </span>
<span class="GAPprompt">gap></span> <span class="GAPinput">Display( M8 );</span>
[ [  0,  3,  0,  0,  0,  0,  0,  0 ],
  [  0,  0,  0,  0,  0,  0,  0,  0 ],
  [  0,  0,  0,  0,  0,  0,  0,  0 ],
  [  0,  0,  4,  0,  0,  0,  0,  0 ],
  [  0,  0,  0,  0,  0,  3,  0,  0 ],
  [  0,  0,  0,  0,  0,  0,  0,  0 ],
  [  0,  0,  0,  0,  0,  0,  0,  0 ],
  [  0,  0,  0,  0,  0,  0,  4,  0 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">L8 := DirectSumDecompositionMatrices( M8 );;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">Length( L8 ); </span>
16

</pre></div>

<p>The current method does not, however, catch all possible decompositions. In the following example the matrix <span class="SimpleMath">M_5</span> has its third row and third column extirely zero, and the only decomposition found has a <span class="SimpleMath">[0]</span> factor. There are clearly two <span class="SimpleMath">2</span>-factor decompositions with a <span class="SimpleMath">2</span>-by-<span class="SimpleMath">3</span> and a <span class="SimpleMath">3</span>-by-<span class="SimpleMath">2</span> factor, but these are not found at present.</p>


<div class="example"><pre>

<span class="GAPprompt">gap></span> <span class="GAPinput">M5 := [ [1,2,0,0,0], [3,4,0,0,0], [0,0,0,0,0],</span>
<span class="GAPprompt">></span> <span class="GAPinput">           [0,0,0,6,7], [0,0,0,8,9] ];;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">Display(M5);</span>
[ [  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 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">L5 := DirectSumDecompositionMatrices( M5 ); </span>
[ [ [ [ 1, 2 ], [ 3, 4 ] ], [ [ 0 ] ], [ [ 6, 7 ], [ 8, 9 ] ] ] ]

</pre></div>


<div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a>   <a href="chap0.html#contents">[Contents]</a>    <a href="chap5.html">[Previous Chapter]</a>    <a href="chap7.html">[Next Chapter]</a>   </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chap12.html">12</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>

95%


¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.