File: chap10_mj.html

package info (click to toggle)
gap-utils 0.93-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,504 kB
  • sloc: xml: 2,167; javascript: 155; makefile: 105
file content (192 lines) | stat: -rw-r--r-- 11,858 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?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 (Utils) - Chapter 10: Various other functions</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="chap10"  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="chap7_mj.html">7</a>  <a href="chap8_mj.html">8</a>  <a href="chap9_mj.html">9</a>  <a href="chap10_mj.html">10</a>  <a href="chap11_mj.html">11</a>  <a href="chap12_mj.html">12</a>  <a href="chapBib_mj.html">Bib</a>  <a href="chapInd_mj.html">Ind</a>  </div>

<div class="chlinkprevnexttop">&nbsp;<a href="chap0_mj.html">[Top of Book]</a>&nbsp;  <a href="chap0_mj.html#contents">[Contents]</a>&nbsp;  &nbsp;<a href="chap9_mj.html">[Previous Chapter]</a>&nbsp;  &nbsp;<a href="chap11_mj.html">[Next Chapter]</a>&nbsp;  </div>

<p id="mathjaxlink" class="pcenter"><a href="chap10.html">[MathJax off]</a></p>
<p><a id="X83EFC3178180D918" name="X83EFC3178180D918"></a></p>
<div class="ChapSects"><a href="chap10_mj.html#X83EFC3178180D918">10 <span class="Heading">Various other functions</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap10_mj.html#X81A0A4FF842B039B">10.1 <span class="Heading">File operations</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap10_mj.html#X7B7ECADF85F748BE">10.1-1 Log2HTML</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap10_mj.html#X84D2922D87EDE9E9">10.2 <span class="Heading">LaTeX strings</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap10_mj.html#X87DEB2B58266F858">10.2-1 IntOrOnfinityToLaTeX</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap10_mj.html#X7DC642B97CD02F4E">10.2-2 LaTeXStringFactorsInt</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap10_mj.html#X79F021B1830B68F6">10.3 <span class="Heading">Conversion to <span class="SimpleMath">\({\sf Magma}\)</span> strings</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap10_mj.html#X8768D7707B4CBBD4">10.3-1 ConvertToMagmaInputString</a></span>
</div></div>
</div>

<h3>10 <span class="Heading">Various other functions</span></h3>

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

<h4>10.1 <span class="Heading">File operations</span></h4>

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

<h5>10.1-1 Log2HTML</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Log2HTML</code>( <var class="Arg">filename</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<p>This function has been transferred from package <strong class="pkg">RCWA</strong>.</p>

<p>This function converts the <strong class="pkg">GAP</strong> logfile <code class="file">filename</code> to HTML. It appears that the logfile should be in your current directory. The extension of the input file must be <code class="file">*.log</code>. The name of the output file is the same as the one of the input file except that the extension <code class="file">*.log</code> is replaced by <code class="file">*.html</code>. There is a sample CSS file in <code class="file">utils/doc/gaplog.css</code>, which you can adjust to your taste.</p>


<div class="example"><pre>

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LogTo( "triv.log" );</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">a := 33^5;</span>
39135393
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LogTo(); </span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Log2HTML( "triv.log" );     </span>

</pre></div>

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

<h4>10.2 <span class="Heading">LaTeX strings</span></h4>

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

<h5>10.2-1 IntOrOnfinityToLaTeX</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IntOrOnfinityToLaTeX</code>( <var class="Arg">n</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<p>This function has been transferred from package <strong class="pkg">ResClasses</strong>.</p>

<p><code class="code">IntOrInfinityToLaTeX(n)</code> returns the LaTeX string for <var class="Arg">n</var>.</p>


<div class="example"><pre>

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IntOrInfinityToLaTeX( 10^3 );</span>
"1000"
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IntOrInfinityToLaTeX( infinity );</span>
"\\infty"

</pre></div>

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

<h5>10.2-2 LaTeXStringFactorsInt</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LaTeXStringFactorsInt</code>( <var class="Arg">n</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<p>This function has been transferred from package <strong class="pkg">RCWA</strong>.</p>

<p>It returns the prime factorization of the integer <span class="SimpleMath">\(n\)</span> as a string in LaTeX format.</p>


<div class="example"><pre>

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LaTeXStringFactorsInt( Factorial(12) );</span>
"2^{10} \\cdot 3^5 \\cdot 5^2 \\cdot 7 \\cdot 11"

</pre></div>

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

<h4>10.3 <span class="Heading">Conversion to <span class="SimpleMath">\({\sf Magma}\)</span> strings</span></h4>

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

<h5>10.3-1 ConvertToMagmaInputString</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ConvertToMagmaInputString</code>( <var class="Arg">arg</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<p>The function <code class="code">ConvertToMagmaInputString( obj [, str] )</code> attempts to output a string <code class="code">s</code> which can be read into <span class="SimpleMath">\({\sf Magma}\)</span> <a href="chapBib_mj.html#biBMAGMA">[BCP97]</a> so as to produce the same group in that computer algebra system. In the second form the user specifies the name of the resulting object, so that the output string has the form <code class="code">"str := ..."</code>.</p>

<p>When <code class="code">obj</code> is a permutation group, the operation <code class="code">PermGroupToMagmaFormat(obj)</code> is called. This function has been taken from <code class="file">other.gi</code> in the main library where it was called <code class="code">MagmaInputString</code>.</p>

<p>When <code class="code">obj</code> is a pc-group, the operation <code class="code">PcGroupToMagmaFormat(obj)</code> is called. This function was private code of Max Horn.</p>

<p>When <code class="code">obj</code> is a matrix group over a finite field, the operation <code class="code">MatrixGroupToMagmaFormat(obj)</code> is called. This function is a modification of private code of Frank Lübeck.</p>

<p>Hopefully code for other types of group will be added in due course.</p>

<p>These functions should be considered <em>experimental</em>, and more testing is desirable.</p>


<div class="example"><pre>

<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">## permutation groups</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ConvertToMagmaInputString( Group( (1,2,3,4,5), (3,4,5) ) );</span>
"PermutationGroup&lt;5|(1,2,3,4,5),\n(3,4,5)&gt;;\n"
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ConvertToMagmaInputString( Group( (1,2,3,4,5) ), "c5" );        </span>
"c5 := PermutationGroup&lt;5|(1,2,3,4,5)&gt;;\n"
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">## pc-group</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ConvertToMagmaInputString( DihedralGroup( IsPcGroup, 10 ) );</span>
"PolycyclicGroup&lt; f1,f2 |\nf1^2,\nf2^5,\nf2^f1 = f2^4\n&gt;;\n"
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">## fp-group</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">F2 := FreeGroup( 2 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f := F2.1;;  g := F2.2;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">relq8 := [ f^4, g^4, f*g*f*g^-1, f^2*g^2 ];; </span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">q8 := F2/relq8;; </span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ConvertToMagmaInputString( q8 );</span>
no conversion function yet available for fp-groups
fail
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">## matrix group</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M := GL(2,5);;  Size(M); </span>
480
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">s1 := ConvertToMagmaInputString( M );</span>
"F := GF(5);\nP := GL(2,F);\ngens := [\nP![2,0,0,1],\nP![4,1,4,0]\n];\nsub&lt;P |\
 gens&gt;;\n"
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Print( s1 );</span>
F := GF(5);
P := GL(2,F);
gens := [
P![2,0,0,1],
P![4,1,4,0]
];
sub&lt;P | gens&gt;;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">n1 := [ [ Z(9)^0, Z(9)^0 ], [ Z(9)^0, Z(9) ] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">n2 := [ [ Z(9)^0, Z(9)^3 ], [ Z(9)^4, Z(9)^2 ] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">N := Group( n1, n2 );;  Size( N );</span>
5760
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">s2 := ConvertToMagmaInputString( N, "gpN" );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Print( s2 );</span>
F := GF(3^2);
P := GL(2,F);
w := PrimitiveElement(F);
gens := [
P![ 1, 1, 1,w^1],
P![ 1,w^3, 2,w^2]
];
gpN := sub&lt;P | gens&gt;;

</pre></div>


<div class="chlinkprevnextbot">&nbsp;<a href="chap0_mj.html">[Top of Book]</a>&nbsp;  <a href="chap0_mj.html#contents">[Contents]</a>&nbsp;  &nbsp;<a href="chap9_mj.html">[Previous Chapter]</a>&nbsp;  &nbsp;<a href="chap11_mj.html">[Next Chapter]</a>&nbsp;  </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="chap7_mj.html">7</a>  <a href="chap8_mj.html">8</a>  <a href="chap9_mj.html">9</a>  <a href="chap10_mj.html">10</a>  <a href="chap11_mj.html">11</a>  <a href="chap12_mj.html">12</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>