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

Quelle  chap4_mj.html   Sprache: HTML

 
 products/sources/formale Sprachen/GAP/pkg/ibnp/doc/chap4_mj.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>
<script type="text/javascript"
  src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<title>GAP (IBNP) - Chapter 4: Functions for Noncommutative Monomials</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="chap4"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a>  <a href="chap1_mj.html">1</a>  <a href="chap2_mj.html">2</a>  <a href="chap3_mj.html">3</a>  <a href="chap4_mj.html">4</a>  <a href="chap5_mj.html">5</a>  <a href="chap6_mj.html">6</a>  <a href="chapBib_mj.html">Bib</a>  <a href="chapInd_mj.html">Ind</a>  </div>

<div class="chlinkprevnexttop"> <a href="chap0_mj.html">[Top of Book]</a>   <a href="chap0_mj.html#contents">[Contents]</a>    <a href="chap3_mj.html">[Previous Chapter]</a>    <a href="chap5_mj.html">[Next Chapter]</a>   </div>

<p id="mathjaxlink" class="pcenter"><a href="chap4.html">[MathJax off]</a></p>
<p><a id="X872783907DFA29B7" name="X872783907DFA29B7"></a></p>
<div class="ChapSects"><a href="chap4_mj.html#X872783907DFA29B7">4 <span class="Heading">Functions for Noncommutative Monomials</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap4_mj.html#X846C3B0F79265278">4.1 <span class="Heading">Basic functions for monomials</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4_mj.html#X84F106BB8093FCAE">4.1-1 <span class="Heading">Predefined algebras</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4_mj.html#X7D53D8657AEDFEB2">4.1-2 PrintNM</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4_mj.html#X7AD4CF167E6B7D2E">4.1-3 NM2GM</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4_mj.html#X8719E2857E26325C">4.1-4 GM2NM</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4_mj.html#X7F72641C8441204E">4.1-5 PrefixNM</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4_mj.html#X8046DF397ACA0E5E">4.1-6 SuffixPrefixPosNM</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4_mj.html#X82916CB37D346978">4.1-7 SubwordPosNM</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4_mj.html#X83CF80DD7CD5F166">4.1-8 LeadVarNM</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap4_mj.html#X7CECFE0C86895946">4.1-9 DivNM</a></span>
</div></div>
</div>

<h3>4 <span class="Heading">Functions for Noncommutative Monomials</span></h3>

<p>A monomial, such as <span class="SimpleMath">\(ab^2a\)</span> is represented in <strong class="pkg">GBNP</strong> as the list <span class="SimpleMath">\([1,2,2,1]\)</span>. Polynomials have a more complicated structure, for example <span class="SimpleMath">\(6ab^2a - 7ab + 8ba\)</spanis represented in <strong class="pkg">GBNP</strong> by <span class="SimpleMath">\([ [ [1,2,2,1], [1,2], [2,1] ], [6,-7,8] ]\)</span>, which is a list of monomials followed by the corresponding list of coefficients. Polynomials are dealt with in the following chapter.</p>

<p>As shown in Section <a href="chap2_mj.html#X783C6EC87988B533"><span class="RefLink">2.1</span></a>, <strong class="pkg">GBNP</strong> has functions <code class="code">PrintNP</code> and <code class="code">PrintNPList</code> to print a polynomial and a list of polynomials. Here we provide equivalent functions for monomials.</p>

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

<h4>4.1 <span class="Heading">Basic functions for monomials</span></h4>

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

<h5>4.1-1 <span class="Heading">Predefined algebras</span></h5>

<p>For convenience of use in examples, three algebras over the rationals, <code class="code">AlbebraIBNP</code> and <code class="code">AlgebrakIBNP</code> with <span class="SimpleMath">\(k \in [2,3,4]\)</span>, are predefined in this package.</p>


<div class="example"><pre>

<span class="GAPprompt">gap></span> <span class="GAPinput">GeneratorsOfAlgebra( AlgebraIBNP );</span>
[ (1)*<identity ...>, (1)*a, (1)*b ]
<span class="GAPprompt">gap></span> <span class="GAPinput">Algebra2IBNP = AlgebraIBNP;</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">A3 := Algebra3IBNP;</span>
<algebra-with-one over Rationals, with 3 generators>

</pre></div>

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

<h5>4.1-2 PrintNM</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ PrintNM</code>( <var class="Arg">monomial</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ PrintNMList</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Recall, from <strong class="pkg">GBNP</strong>, that the actual letters printed are controlled by the operation <code class="code">GBNP.ConfigPrint</code>.</p>


<div class="example"><pre>

<span class="GAPprompt">gap></span> <span class="GAPinput">GBNP.ConfigPrint( "a""b""c" );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">mon := [2,1,1,1,3,3,1];;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">PrintNM( mon );</span>
ba^3c^2a
<span class="GAPprompt">gap></span> <span class="GAPinput">L := [ [1,2,2], [3,1,2], [3,3,3], [2], [ ] ];;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">PrintNMList( L );                            </span>
ab^2
cab
c^3
b
1

</pre></div>

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

<h5>4.1-3 NM2GM</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ NM2GM</code>( <var class="Arg">monomial</var>, <var class="Arg">algebra</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ NM2GMList</code>( <var class="Arg">list</var>, <var class="Arg">algebra</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Recall, from <strong class="pkg">GBNP</strong>, that the functions <code class="code">NP2GP</code> and <code class="code">NP2GPList</code> convert a polynomial (or list of polynomials) in NP-format to an element of the algebra. This package provides additional functions <code class="code">NM2GM</code> and <code class="code">NM2GMList</code> which do the equivalent conversion for monomials.</p>


<div class="example"><pre>

<span class="GAPprompt">gap></span> <span class="GAPinput">m := NM2GM( mon, A3 );</span>
(1)*b*a^3*c^2*a
<span class="GAPprompt">gap></span> <span class="GAPinput">NM2GMList( [ mon, Reversed(mon), Concatenation(mon,mon) ], A3 );</span>
[ (1)*b*a^3*c^2*a, (1)*a*c^2*a^3*b, (1)*(b*a^3*c^2*a)^2 ]

</pre></div>

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

<h5>4.1-4 GM2NM</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ GM2NM</code>( <var class="Arg">monomial</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ GM2NMList</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Recall, from <strong class="pkg">GBNP</strong>, that the functions <code class="code">GP2NP</code> and <code class="code">GP2NPList</code> convert a polynomial (or list of polynomials) to the equivalent NP-format. This package provides additional functions <code class="code">GM2NM</code> and <code class="code">GM2NMList</code> which do the equivalent conversion for monomials.</p>


<div class="example"><pre>

<span class="GAPprompt">gap></span> <span class="GAPinput">a:=A3.1;; b:=A3.2;; c:=A3.3;;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">p := (a*b*c)^2;;             </span>
<span class="GAPprompt">gap></span> <span class="GAPinput">GM2NM(p);</span>
[ 1, 2, 3, 1, 2, 3 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">GM2NMList( [ p, p^2, a^3, b^4, c^5 ] );</span>
[ [ 1, 2, 3, 1, 2, 3 ], [ 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3 ], [ 1, 1, 1 ], 
  [ 2, 2, 2, 2 ], [ 3, 3, 3, 3, 3 ] ]

</pre></div>

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

<h5>4.1-5 PrefixNM</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ PrefixNM</code>( <var class="Arg">monomial</var>, <var class="Arg">posint</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ SubwordNM</code>( <var class="Arg">monomial</var>, <var class="Arg">posint</var>, <var class="Arg">posint</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ SuffixNM</code>( <var class="Arg">monomial</var>, <var class="Arg">posint</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>These are the three operations which pick a sublist from a monomial list.</p>


<div class="example"><pre>

<span class="GAPprompt">gap></span> <span class="GAPinput">mon := [2,1,1,1,3,3,1];;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">PrefixNM( mon, 3 );</span>
[ 2, 1, 1 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">SubwordNM( mon, 3, 6 );</span>
[ 1, 1, 3, 3 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">SuffixNM( mon, 3 );</span>
[ 3, 3, 1 ]

</pre></div>

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

<h5>4.1-6 SuffixPrefixPosNM</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ SuffixPrefixPosNM</code>( <var class="Arg">monomial</var>, <var class="Arg">monomial</var>, <var class="Arg">posint</var>, <var class="Arg">posint</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>The operation <code class="code">SuffixPrefixPosNM( left, right, start, limit)</code> looks for overlaps of type <em>suffix of left = prefix of right</em>. The size of the smallest such overlap is returned. The overlaps which are considered are controlled by the third and fourth arguments. We commence by looking at the overlap of size <em>start</em> and go no further than the overlap of size <em>limit</em>. When no overlap exists, <span class="SimpleMath">\(0\)</span> is returned. To test all possibilities, <em>start</em> should be <span class="SimpleMath">\(1\)</span> and <em>limit</em> should be <span class="SimpleMath">\(min(|left|,|right|)-1\)</span>. It is the user's responsibility to make sure that these bounds are correct - no checks are made.




<div class="example"><pre>

<span class="GAPprompt">gap></span> <span class="GAPinput">m1 := [2,1,1,1,2,2,1,1];;           ## m1 = ba^3b^2a^2</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">m2 := [1,1,2,2,1,1];;               ## m2 = a^2b^2a^2</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">SuffixPrefixPosNM( m1, m2, 1, 5 );  ## overlap is a                   </span>
1
<span class="GAPprompt">gap></span> <span class="GAPinput">SuffixPrefixPosNM( m1, m2, 2, 5 );  ## overlap is a^2</span>
2
<span class="GAPprompt">gap></span> <span class="GAPinput">SuffixPrefixPosNM( m1, m2, 3, 5 );  ## no longer an overlap</span>
0
<span class="GAPprompt">gap></span> <span class="GAPinput">SuffixPrefixPosNM( m2, m1, 1, 5 );  ## overlap is ba^2</span>
3

</pre></div>

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

<h5>4.1-7 SubwordPosNM</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ SubwordPosNM</code>( <var class="Arg">monomial</var>, <var class="Arg">monomial</var>, <var class="Arg">posint</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsSubwordNM</code>( <var class="Arg">monomial</var>, <var class="Arg">monomial</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>The operation <code class="code">SubwordPosNM( small, large, start );</code> answers the question for monomials <em>Is small a subword of large?</em>. The value returned is the start position in <em>large</em> of the first subword found. When no subword is found, <span class="SimpleMath">\(0\)</span> is returned. The search commences at position <em>start</em> in <em>large</em> so, to test all possibilities, the third argument should be <span class="SimpleMath">\(1\)</span>.</p>

<p>To just ask whether or not <em>small</em> is a subword of <em>large</em>, use <code class="code">IsSubwordNM( small, large);</code>.</p>


<div class="example"><pre>

<span class="GAPprompt">gap></span> <span class="GAPinput">m3 := [ 1, 1, 2 ];;                 ## m3 = a^2b</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">SubwordPosNM( m3, m1, 1 );</span>
3                                        ## m1 = ba(a^b)ba^2
<span class="GAPprompt">gap></span> <span class="GAPinput">SubwordPosNM( m3, m2, 1 );</span>
1                                        ## m2 = (a^2b)ba^2
<span class="GAPprompt">gap></span> <span class="GAPinput">SubwordPosNM( m3, m2, 2 );</span>
0
<span class="GAPprompt">gap></span> <span class="GAPinput">IsSubwordNM( [ 2, 1, 2 ], m1 );</span>
false

</pre></div>

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

<h5>4.1-8 LeadVarNM</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ LeadVarNM</code>( <var class="Arg">monomial</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ LeadExpNM</code>( <var class="Arg">monomial</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ TailNM</code>( <var class="Arg">monomial</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Given the word <span class="SimpleMath">\(w = b^4a^3c^2\)</span>, represented by <span class="SimpleMath">\([2,2,2,2,1,1,1,3,3]\)</span>, the <em>lead variable</em> is <span class="SimpleMath">\(b\)</span> or <span class="SimpleMath">\(2\)</span>, and the <em>lead exponent</em> is <span class="SimpleMath">\(4\)</span>. Removing <span class="SimpleMath">\(b^4\)</span> from <span class="SimpleMath">\(w\)</span> leaves the <em>tail</em> <span class="SimpleMath">\(a^3c^2\)</span>.</p>


<div class="example"><pre>

<span class="GAPprompt">gap></span> <span class="GAPinput">mon4 := [2,2,2,2,1,1,1,3,3];;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">LeadVarNM( mon4 );           </span>
2
<span class="GAPprompt">gap></span> <span class="GAPinput">LeadExpNM( mon4 );           </span>
4
<span class="GAPprompt">gap></span> <span class="GAPinput">TailNM( mon4 );           </span>
[ 1, 1, 1, 3, 3 ]

</pre></div>

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

<h5>4.1-9 DivNM</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DivNM</code>( <var class="Arg">monomial</var>, <var class="Arg">monomial</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>The operation <code class="code">DivNM(large, small);</code> for two monomials returns all the ways that <em>small</em> divides <em>large</em> in the form of a list of pairs of monomials <em>[left,right]</em> so that <em>large = left*small*right</em>. In the example we search for subwords <span class="SimpleMath">\(ab\)</span> of <span class="SimpleMath">\(m = abcababc\)</span>, returning <span class="SimpleMath">\([ [abcab,c], [abc,abc], [1,cababc] ]\)</span>.</p>


<div class="example"><pre>

<span class="GAPprompt">gap></span> <span class="GAPinput">GBNP.ConfigPrint( "a""b""c" );</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">m := [ 1, 2, 3, 1, 2, 1, 2, 3 ];;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">d := [ 1, 2 ];;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">PrintNMList( [ m, d ] );</span>
abcababc
ab                
<span class="GAPprompt">gap></span> <span class="GAPinput">divs := DivNM( m, d ); </span>
[ [ [ 1, 2, 3, 1, 2 ], [ 3 ] ], [ [ 1, 2, 3 ], [ 1, 2, 3 ] ], 
  [ [  ], [ 3, 1, 2, 1, 2, 3 ] ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">PrintNMList( divs[1] );</span>
abcab
c

</pre></div>


<div class="chlinkprevnextbot"> <a href="chap0_mj.html">[Top of Book]</a>   <a href="chap0_mj.html#contents">[Contents]</a>    <a href="chap3_mj.html">[Previous Chapter]</a>    <a href="chap5_mj.html">[Next Chapter]</a>   </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a>  <a href="chap1_mj.html">1</a>  <a href="chap2_mj.html">2</a>  <a href="chap3_mj.html">3</a>  <a href="chap4_mj.html">4</a>  <a href="chap5_mj.html">5</a>  <a href="chap6_mj.html">6</a>  <a href="chapBib_mj.html">Bib</a>  <a href="chapInd_mj.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>

98%


¤ Dauer der Verarbeitung: 0.16 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.