<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Not really blogging &#187; Google Summer of Code 2012</title>
	<atom:link href="http://amakelov.wordpress.com/category/google-summer-of-code-2012/feed/" rel="self" type="application/rss+xml" />
	<link>http://amakelov.wordpress.com</link>
	<description>A. Makelov</description>
	<lastBuildDate>Mon, 22 Apr 2013 02:20:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='amakelov.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Not really blogging &#187; Google Summer of Code 2012</title>
		<link>http://amakelov.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://amakelov.wordpress.com/osd.xml" title="Not really blogging" />
	<atom:link rel='hub' href='http://amakelov.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Google Summer of Code 2012: Week 13</title>
		<link>http://amakelov.wordpress.com/2012/08/20/google-summer-of-code-2012-week-13/</link>
		<comments>http://amakelov.wordpress.com/2012/08/20/google-summer-of-code-2012-week-13/#comments</comments>
		<pubDate>Mon, 20 Aug 2012 14:38:23 +0000</pubDate>
		<dc:creator>Александър Макелов</dc:creator>
				<category><![CDATA[Google Summer of Code 2012]]></category>

		<guid isPermaLink="false">http://amakelov.wordpress.com/?p=512</guid>
		<description><![CDATA[Hi all, here&#8217;s a brief summary of my 13th (and last) week of GSoC. I continued my work on centralizers, improving normal closure, derived in lower central series, etc. My most recent pull request containing these additions just got merged and can be found here. This week I spent a lot of time on writing [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=512&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi all, here&#8217;s a brief summary of my 13th (and last) week of GSoC.</p>
<ul>
<li>I continued my work on centralizers, improving normal closure, derived in lower central series, etc. My most recent pull request containing these additions just got merged and can be found <a href="https://github.com/sympy/sympy/pull/1495" target="_blank">here</a>. This week I spent a lot of time on writing better tests and developing some new test practices. The group-theoretical algorithms in the combinatorics module are getting more and more complicated, so better, cleverer and more thorough tests are needed. I came up with the following model for verification:<br />
- since the results of the tests are very hard to compute by hand, some helper functions are needed that find the wanted object in a brute-force manner using only definitions. For example, we often look for a subgroup with certain properties. The most naive and robust approach to this is to:<br />
- list all group elements, go over the list and check each element for the given property.<br />
- Then, make a list of all the &#8220;good&#8221; elements and compare it (as a set) with the list of all elements of the group the function being tested returns.<br />
Hence, a new file was created, sympy/combinatorics/testutil.py, that will host such functions. (Needless to say, they are exponential in complexity, and for example going over all the elements of SymmetricGroup(n) becomes infeasible for n larger than 10.)<br />
- The presence of functions being used to test other functions gets us in a bit of a <a href="http://en.wikipedia.org/wiki/Quis_custodiet_ipsos_custodes%3F" target="_blank"><strong><em>Quis custodiet ipsos custodes?</em></strong></a> situation, but this is not fatal: the functions in testutil.py are extremely straightforward compared to the functions in perm_groups.py that they test, and it&#8217;s really obvious what they&#8217;re doing, so it&#8217;ll take less tests to verify <em>them. </em><br />
- In the tests for the new functions from perm_groups.py, I introduced some comments to indicate what (and why) I&#8217;m testing. Another practice that seems to be good is to verify the algorithms for small groups (degrees 1, 2, 3) since there are a lot of corner cases there that seem to break them.</li>
<li>I started work on improving the disjoint cycle notation, namely excluding singleton cycles from the cyclic form; however, there are other changes to handling permutations that are waiting to be merged in the combinatorics module <a href="https://github.com/sympy/sympy/pull/1498" target="_blank">here</a>, so I guess I&#8217;ll first discuss my changes with <a href="https://github.com/smichr" target="_blank">Christopher</a>. Currently, I see the following two possibilities for handling the singleton cycles:<br />
- add a <code>_size</code> attribute to the Permutation class, and then, when faced with something like <code>Permutation([[2, 3], [4, 5, 6], [8]])</code>, find the maximum index appearing in the permutation (here it&#8217;s 8) and assign the size of the permutation to that + 1. Then it remains to adjust some of the other methods in the class (after I adjusted <strong>mul</strong> so that it treats permutations of different sizes as if they leave all points outside their domain fixed, all the tests passed) so that they make sense with that new approach to cyclic forms.<br />
- more ambitious: make a new class, <code>ExtendedArrayForm</code> or something, with a field <code>_array_form</code> that holds the usual array form of a permutation. Then we overload the <code>__getitem__</code> method so that if the index is outside the bounds of <code>self._array_form</code> we return the index unchanged. Of course, we&#8217;ll have to overload other things, like the <code>__len__</code> and <code>__str__</code> to make it behave like a list. Then instead of using a list to initialize the array form of a permutation, we use the corresponding <code>ExtendedArrayForm</code>. This will make all permutations behave as if they are acting on a practically infinite domain, and if we do it that way, we won&#8217;t have to make any changes to the methods in <code>Permutation</code> &#8211; everything is going to work as expected, no casework like <code>if len(a) &gt; len(b),...</code> will be needed. So this sounds like a rather elegant approach. On the other hand, I&#8217;m not entirely sure if it is possible to make it completely like a list, and also it doesn&#8217;t seem like a very performance-efficient decision since <code>ExtendedArrayForm</code> instances will be created all the time. (<strong>see the discussion <a href="https://github.com/sympy/sympy/pull/1498" target="_blank">here</a>).</strong></li>
<li>Still nothing on a database of groups. I looked around the web for a while but didn&#8217;t find any resources&#8230; the search continues. Perhaps I should ask someone more knowledgeable.</li>
</ul>
<p>That&#8217;s it for now, and that&#8217;s the end of my series of blog posts for the GSoC, but I don&#8217;t really feel that something has ended since it seems that my contributions to the combinatorics module will continue (albeit not that regularly : ) ). After all, it&#8217;s a lot of fun, and there are a lot more things to be implemented/fixed there! So, a big &#8220;Thank you&#8221; to everyone who helped me get through (and to) GSoC, it&#8217;s been a pleasure and I learned a lot. Goodbye!</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amakelov.wordpress.com/512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amakelov.wordpress.com/512/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=512&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amakelov.wordpress.com/2012/08/20/google-summer-of-code-2012-week-13/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d10599ccc7ab7986bfc049cbbf565950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amakelov</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Summer of Code 2012: Week 12</title>
		<link>http://amakelov.wordpress.com/2012/08/13/google-summer-of-code-2012-week-12/</link>
		<comments>http://amakelov.wordpress.com/2012/08/13/google-summer-of-code-2012-week-12/#comments</comments>
		<pubDate>Mon, 13 Aug 2012 15:00:09 +0000</pubDate>
		<dc:creator>Александър Макелов</dc:creator>
				<category><![CDATA[Google Summer of Code 2012]]></category>

		<guid isPermaLink="false">http://amakelov.wordpress.com/?p=484</guid>
		<description><![CDATA[Hi all, here&#8217;s a brief summary of the 12th week of my GSoC: Centralizers got some more attention since there were several bugs in the implementation from last week; this also exposed a bug in .subgroup_search() as it is on sympy/master right now. Fortunately, I located it and fixed it earlier today, so the fix [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=484&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi all, here&#8217;s a brief summary of the 12th week of my GSoC:</p>
<ul>
<li>Centralizers got some more attention since there were several bugs in the implementation from last week; this also exposed a bug in .subgroup_search() as it is on sympy/master right now. Fortunately, I located it and fixed it earlier today, so the fix for .subgroup_search() will be contained in my next pull request. In fact, it is just three more lines that should be added. Namely,
<pre class="brush: python; title: ; wrap-lines: false; notranslate">
# line 29: set the next element from the current branch and update
# accorndingly
c[l] += 1
element = ~(computed_words[l - 1])
</pre>
<p>should be replaced with</p>
<pre class="brush: python; title: ; wrap-lines: false; notranslate">
# line 29: set the next element from the current branch and update
# accorndingly
c[l] += 1
if l == 0:
    element = identity
else:
    element = ~(computed_words[l - 1])
</pre>
<p>since we might be at the bottom level with <img src='http://s0.wp.com/latex.php?latex=l%3D0&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='l=0' title='l=0' class='latex' />. In this case, python doesn&#8217;t yell at you for looking up computed_words[-1] since negative indices wrap around the list in python. Yet another silly mistake that&#8217;s incredibly hard to track down! I hope that it will work properly from now on, and I&#8217;ll have to include some more tests to it.</li>
<li>The description of the algorithm for finding the center in polynomial time given in [1] didn&#8217;t really make sense to me, so instead a straightforward one,
<pre class="brush: python; title: ; notranslate">
def center(self):
    return self.centralizer(self)
</pre>
<p>was used. This can be updated later when I (or someone else) figures out the polynomial-time algorithm.</li>
<li>A new, faster algorithm for finding normal closures: this one uses the incremental version of Schreier-Sims, and some randomization. It&#8217;s described in [1].</li>
<li>Some applications of normal closure: the derived series, lower cenral series, the commutator of two subgroups of a group, nilpotency testing. Now we have things like this:
<pre class="brush: python; title: ; wrap-lines: false; notranslate">
In [68]: from sympy.combinatorics.named_groups import *
In [69]: S = SymmetricGroup(4)
In [70]: ds = S.derived_series()
In [71]: len(ds)
Out[71]: 4
In [72]: ds[1] == AlternatingGroup(4)
Out[72]: True
In [73]: ds[2] == DihedralGroup(2)
Out[73]: True
In [74]: ds[3] == PermutationGroup([Permutation([0, 1, 2, 3])])
Out[74]: True
</pre>
<p>demonstrating the well-known normal series of groups <img src='http://s0.wp.com/latex.php?latex=e+%3C+K_4+%3C+A_4+%3C+S_4&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='e &lt; K_4 &lt; A_4 &lt; S_4' title='e &lt; K_4 &lt; A_4 &lt; S_4' class='latex' /> that solves the symmetric group on 4 letters. Note that the normal closure algorithm was already there thanks to the work of <a href="https://github.com/pernici" target="_blank">Mario</a>, I just improved it a bit and added some applications.</li>
<li>Moved DirectProduct() to a new file, group_constructs.py, that is planned to hold functions that treat several groups equally (for one other example, the commutator of two groups in the full symmetric group) rather than treating them in some sort of subgroup-supergroup relationship (such as .centralizer()).</li>
</ul>
<p>I wrote docstrings for the new stuff, and my current work can be found on <a href="https://github.com/amakelov/sympy/tree/week10" target="_blank">my week10 branch</a>. There will be some comprehensive test following the new additions (and I&#8217;ll need GAP to verify the results of some of them, probably). It seems that Todd-Coxeter won&#8217;t happen during GSoC since there&#8217;s just one more week; instead, I plan to focus on improving disjoint cycle notation and group databases.</p>
<p>[1] Derek F. Holt, Bettina Eick, Bettina, Eamonn A. O’Brien, “Handbook of computational group theory”, Discrete Mathematics and its Applications (Boca Raton). Chapman &amp; Hall/CRC, Boca Raton, FL, 2005. ISBN 1-58488-372-3</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amakelov.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amakelov.wordpress.com/484/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=484&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amakelov.wordpress.com/2012/08/13/google-summer-of-code-2012-week-12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d10599ccc7ab7986bfc049cbbf565950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amakelov</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Summer of Code 2012: Week 11</title>
		<link>http://amakelov.wordpress.com/2012/08/06/google-summer-of-code-2012-week-11/</link>
		<comments>http://amakelov.wordpress.com/2012/08/06/google-summer-of-code-2012-week-11/#comments</comments>
		<pubDate>Mon, 06 Aug 2012 14:26:08 +0000</pubDate>
		<dc:creator>Александър Макелов</dc:creator>
				<category><![CDATA[Google Summer of Code 2012]]></category>

		<guid isPermaLink="false">http://amakelov.wordpress.com/?p=445</guid>
		<description><![CDATA[Hi all, here&#8217;s a brief summary of the 11th week of my GSoC. Yay! Subgroup searching now works with the use of .stabilizer(), as I discussed in my previous blog post. Surprisingly, the running time is similar to that of the flawed version using .baseswap() (whenever the one using .baseswap() works), you can play around [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=445&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi all, here&#8217;s a brief summary of the 11th week of my GSoC.</p>
<ul>
<li>Yay! Subgroup searching now works with the use of .stabilizer(), as I discussed in <a href="http://amakelov.wordpress.com/2012/07/30/google-summer-of-code-2012-week-10/" target="_blank">my previous blog post</a>. Surprisingly, the running time is similar to that of the flawed version using .baseswap() (whenever the one using .baseswap() works), you can play around with the two versions on my <a href="https://github.com/amakelov/sympy/tree/week6" target="_blank">week6</a> (has a bug, using .baseswap()) and <a href="https://github.com/amakelov/sympy/tree/week9" target="_blank">week9</a> (seems to work, using .stabilizer()) branches.</li>
<li>Consequently, I made a <a href="https://github.com/sympy/sympy/pull/1454" target="_blank">new pull request</a> containing the incremental version of Schreier-Sims, the remove_gens utility for getting rid of redundant generators in a strong generating set, and the new (working) subgroup_search algorithm. You&#8217;re most welcome to help with the review!</li>
</ul>
<ul>
<li>I worked on several applications of subgroup_search() and the incremental Schreier-Sims algorithm. Namely, the pointwise stabilizer of a set of points (via the incremental Schreier-Sims algorithm):</li>
</ul>
<pre class="brush: python; title: ; wrap-lines: false; notranslate">
In [4]: from sympy.combinatorics.named_groups import *
In [5]: A = AlternatingGroup(9)
In [6]: G = A.pointwise_stabilizer([2, 3, 5])
In [7]: G == A.stabilizer(2).stabilizer(3).stabilizer(5)
Out[7]: True
</pre>
<p>(this is much faster than the naive implementation using .stabilizer() repeatedly), and the centralizer of a group <img src='http://s0.wp.com/latex.php?latex=H&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='H' title='H' class='latex' /> inside a group <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G' title='G' class='latex' />:</p>
<pre class="brush: python; title: ; wrap-lines: false; notranslate">
In [11]: from sympy.combinatorics.named_groups import *
In [12]: S = SymmetricGroup(6)
In [13]: A = AlternatingGroup(6)
In [14]: C = CyclicGroup(6)
In [15]: S_els = list(S.generate())
In [16]: G = S.centralizer(A)
In [17]: G.order()
Out[17]: 1
In [18]: temp = [[el*gen for gen in A.generators] == [gen*el for gen in A.generators] for el in S_els]
In [19]: temp.count(False)
Out[19]: 719
In [20]: temp.count(True)
Out[20]: 1
In [21]: G = S.centralizer(C)
In [22]: G == C
Out[22]: True
In [23]: temp = [[el*gen for gen in C.generators] == [gen*el for gen in C.generators] for el in S_els]
In [24]: temp.count(True)
Out[24]: 6
</pre>
<p>(it takes some effort to see that these calculations indeed prove that .centralizer() returned the needed centralizer). The centralizer algorithm uses a pruning criterion described in [1], and even though it&#8217;s exponential in complexity, it&#8217;s fast for practical purposes. Both of the above functions are available (albeit not documented yet) on <a href="https://github.com/amakelov/sympy/tree/week10" target="_blank">my week10 branch</a>.</p>
<ul>
<li>The next steps are an algorithm for the centre in polynomial time, and an algorithm to find the intersection of two subgroups! And after that, I hope to be able to implement the Todd-Coxeter algorithm&#8230;</li>
</ul>
<p>That&#8217;s it for now!</p>
<p>[1] Derek F. Holt, Bettina Eick, Bettina, Eamonn A. O’Brien, “Handbook of computational group theory”, Discrete Mathematics and its Applications (Boca Raton). Chapman &amp; Hall/CRC, Boca Raton, FL, 2005. ISBN 1-58488-372-3</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amakelov.wordpress.com/445/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amakelov.wordpress.com/445/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=445&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amakelov.wordpress.com/2012/08/06/google-summer-of-code-2012-week-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d10599ccc7ab7986bfc049cbbf565950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amakelov</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Summer of Code 2012: Week 10</title>
		<link>http://amakelov.wordpress.com/2012/07/30/google-summer-of-code-2012-week-10/</link>
		<comments>http://amakelov.wordpress.com/2012/07/30/google-summer-of-code-2012-week-10/#comments</comments>
		<pubDate>Mon, 30 Jul 2012 13:46:30 +0000</pubDate>
		<dc:creator>Александър Макелов</dc:creator>
				<category><![CDATA[Google Summer of Code 2012]]></category>

		<guid isPermaLink="false">http://amakelov.wordpress.com/?p=429</guid>
		<description><![CDATA[Hi all, here&#8217;s a brief summary of what I&#8217;ve been doing during the 10th week of my GSoC. Though I fixed a bug in the SUBGROUPSEARCH function during the week, I ran some more comprehensive tests as I had planned to, and some of them broke the function. If you&#8217;re particularly interested, something like that [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=429&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi all,</p>
<p>here&#8217;s a brief summary of what I&#8217;ve been doing during the 10th week of my GSoC.</p>
<ul>
<li>Though I fixed a bug in the SUBGROUPSEARCH function during the week, I ran some more comprehensive tests as I had planned to, and some of them broke the function. If you&#8217;re particularly interested, something like that will work:
<pre class="brush: python; title: ; wrap-lines: false; notranslate">
In [87]: S = SymmetricGroup(5)
In [88]: prop_fix_3 = lambda x: x(3) == 3
In [89]: %autoreload
In [90]: S.subgroup_search(prop_fix_3)
---------------------------------------------------------------------------
StopIteration                             Traceback (most recent call last)
&lt;ipython-input-90-6b85aa1285b8&gt; in &lt;module&gt;()
----&gt; 1 S.subgroup_search(prop_fix_3)

/home/alexander/workspace/sympy/sympy/combinatorics/perm_groups.py in subgroup_search(self, prop, base, strong_gens, tests, init_subgroup)
2660
2661                 # this function maintains a partial BSGS structure up to position l
-&gt; 2662                 _insert_point_in_base(res, res_base, res_strong_gens, l, new_point, distr_gens=res_distr_gens, basic_orbits=res_basic_orbits, transversals=res_transversals)
2663                 # find the l+1-th basic stabilizer
2664                 new_stab = PermutationGroup(res_distr_gens[l + 1])

/home/alexander/workspace/sympy/sympy/combinatorics/util.py in _insert_point_in_base(group, base, strong_gens, pos, point, distr_gens, basic_orbits, transversals)
423     # baseswap with the partial BSGS structures. Notice that we need only
424     # the orbit and transversal of the new point under the last stabilizer
--&gt; 425     new_base, new_strong_gens = group.baseswap(partial_base, strong_gens, pos, randomized=False, transversals=partial_transversals, basic_orbits=partial_basic_orbits, distr_gens=partial_distr_gens)
426     # amend the basic orbits and transversals
427     stab_pos = PermutationGroup(distr_gens[pos])

/home/alexander/workspace/sympy/sympy/combinatorics/perm_groups.py in baseswap(self, base, strong_gens, pos, randomized, transversals, basic_orbits, distr_gens)
2472             # ruling out member of the basic orbit of base[pos] along the way
2473             while len(current_group.orbit(base[pos])) != size:
-&gt; 2474                 gamma = iter(Gamma).next()
2475                 x = transversals[pos][gamma]
2476                 x_inverse = ~x

StopIteration:

</pre>
<p>The reason is certainly the change of base performed on line 11 in the pseudocode (this is also indicated in my code on my local week6 branch <a href="https://github.com/amakelov/sympy/tree/week6" target="_blank">here</a> ). The use of the function BASESWAP there is what gets us into trouble. It is meant to be applied to  base and a strong generating set relative to it, switch two consecutive base points and change the generating set accordinly.  However, in subgroup_search the goal is to change a base <img src='http://s0.wp.com/latex.php?latex=%28b_1%2C+b_2%2C+%5Cldots%2C+b_l%2C+%5Cldots%2C+b_k%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='(b_1, b_2, &#92;ldots, b_l, &#92;ldots, b_k)' title='(b_1, b_2, &#92;ldots, b_l, &#92;ldots, b_k)' class='latex' /> to <img src='http://s0.wp.com/latex.php?latex=%28b_1%2C+b_2%2C+%5Cldots%2C+b_l%27%2C+%5Cldots%2C+b_k%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='(b_1, b_2, &#92;ldots, b_l&#039;, &#92;ldots, b_k)' title='(b_1, b_2, &#92;ldots, b_l&#039;, &#92;ldots, b_k)' class='latex' /> where <img src='http://s0.wp.com/latex.php?latex=b_l%27&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='b_l&#039;' title='b_l&#039;' class='latex' /> is a new point. The book ([1]) mentions that this is done by using BASESWAP but doesn&#8217;t provide any details. My strategy is the following: I cut the base so that it becomes <img src='http://s0.wp.com/latex.php?latex=%28b_1%2C+b_2%2C%5Cldots%2C+b_l%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='(b_1, b_2,&#92;ldots, b_l)' title='(b_1, b_2,&#92;ldots, b_l)' class='latex' /> and cut the correponding data structures &#8211; the strong generators <strong>strong_gens</strong>, the <strong>basic_orbits, </strong> the <strong>transversals</strong>, and the strong generators distributed according to membership in basic stabilizers <strong>distr_gens </strong>(I know, I still have to rename this to strong_gens_distr). Then I append the point <img src='http://s0.wp.com/latex.php?latex=b_l%27&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='b_l&#039;' title='b_l&#039;' class='latex' /> so that the base is <img src='http://s0.wp.com/latex.php?latex=%28b_1%2C+b_2%2C+%5Cldots%2C+b_l%2C+b_l%27%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='(b_1, b_2, &#92;ldots, b_l, b_l&#039;)' title='(b_1, b_2, &#92;ldots, b_l, b_l&#039;)' class='latex' /> and calculate an orbit and transversal for $b_l&#8217;$ under the stabilzier of <img src='http://s0.wp.com/latex.php?latex=b_1%2C+b_2%2C+%5Cldots%2C+b_l&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='b_1, b_2, &#92;ldots, b_l' title='b_1, b_2, &#92;ldots, b_l' class='latex' />. Finally I apply BASESWAP to this new base in order to switch the two rightmost points. Then I go back to <img src='http://s0.wp.com/latex.php?latex=%28b_1%2C+b_2%2C+%5Cldots%2C+b_l%27%2C+%5Cldots%2C+b_k%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='(b_1, b_2, &#92;ldots, b_l&#039;, &#92;ldots, b_k)' title='(b_1, b_2, &#92;ldots, b_l&#039;, &#92;ldots, b_k)' class='latex' /> by appending what I had cut in the start and calculating a transversal/orbit for <img src='http://s0.wp.com/latex.php?latex=b_%7Bl%2B1%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='b_{l+1}' title='b_{l+1}' class='latex' /> under the stabilizer just found, that of <img src='http://s0.wp.com/latex.php?latex=b_1%2C+%5Cldots%2C+b_l%27&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='b_1, &#92;ldots, b_l&#039;' title='b_1, &#92;ldots, b_l&#039;' class='latex' />. Obviously, the resulting BSGS structures are valid only up to position <img src='http://s0.wp.com/latex.php?latex=l&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='l' title='l' class='latex' />, and that&#8217;s all the information we can acquire without another application of baseswap or finding another stabilizer ( and in general, finding a stabilizer is a computationally hard task relative to calculating orbits/transversals). The entire purpose of this use of BASESWAP in SUBGROUPSEARCH is to obtain generators for the stabilizer of <img src='http://s0.wp.com/latex.php?latex=b_1%2C+b_2%2C+%5Cldots%2C+b_l%27&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='b_1, b_2, &#92;ldots, b_l&#039;' title='b_1, b_2, &#92;ldots, b_l&#039;' class='latex' /> and maintain a base/strong generating set that are valid up to a certain position. There are many such base changes performed on the same base throughout the course of the function and something goes wrong along the way. I still have to figure out why and where.</li>
<li><strong>The good news</strong>: There is a straightforward alternative to using BASESWAP: maintain a list of generators for each of the basic stabilizers in <img src='http://s0.wp.com/latex.php?latex=%28b_1%2C+b_2%2C+%5Cldots%2C+b_k%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='(b_1, b_2, &#92;ldots, b_k)' title='(b_1, b_2, &#92;ldots, b_k)' class='latex' /> and change it accordingly as the base is changed, using the function stabilizer() in sympy/combinatorics/perm_groups.py. For each base change we have to calculate one more stabilizer, so that&#8217;s not terrible. It is also sort of suggested in <a href="http://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;ved=0CFIQFjAA&amp;url=http%3A%2F%2Fwww.math.colostate.edu%2F~hulpke%2FCGT%2Fcgtnotes.pdf&amp;ei=u48WUN24M4jf4QS2q4GgBg&amp;usg=AFQjCNHasgOmBkx2AetpE0_-92TFjSyU3A" target="_blank">&#8220;Notes on Computational Group Theory&#8221;</a> by Alexander Hulpke (page 34). The problem with this approach is that stabilizer() tends to return a group with many generators, and repeated applications keep increasing this number. However, using this <strong>removed the bug from SUBGROUPSEARCH. </strong>As before, more comprehensive tests are on the way : )</li>
<li><strong>Yet another alternative : </strong>we can use the incremental Schreier-Sims algorithm with the new base <img src='http://s0.wp.com/latex.php?latex=%28b_1%2C+%5Cldots%2C+b_l%27%2C+%5Cldots%2C+b_k%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='(b_1, &#92;ldots, b_l&#039;, &#92;ldots, b_k)' title='(b_1, &#92;ldots, b_l&#039;, &#92;ldots, b_k)' class='latex' /> and the strong generating set for <img src='http://s0.wp.com/latex.php?latex=%28b_1%2C+%5Cldots%2C+b_l%2C+%5Cldots%2C+b_k%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='(b_1, &#92;ldots, b_l, &#92;ldots, b_k)' title='(b_1, &#92;ldots, b_l, &#92;ldots, b_k)' class='latex' />. There will likely be redundant generators after that, and it will probably involve more computation than finding a single stabilizer. However, in the long run (since there are many base changes performed) this might perform faster (due to the increasing number of generators that stabilizer() tends to create). I have not tried that approach yet.</li>
<li>Other than that, I had <a href="https://github.com/sympy/sympy/pull/1406" target="_blank">my latest major pull request</a> merged! Thanks a lot to <a href="https://github.com/Krastanov" target="_blank">Stefan</a> and my mentor <a href="https://github.com/wdjoyner" target="_blank">David</a> for the review! That was the largest one so far&#8230;</li>
<li>I started reading about some of the applications of subgroup search; subgroup intersection seems to be the easiest to implement, so I&#8217;ll probably go for it first.</li>
</ul>
<p>That&#8217;s it for now : )</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amakelov.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amakelov.wordpress.com/429/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=429&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amakelov.wordpress.com/2012/07/30/google-summer-of-code-2012-week-10/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d10599ccc7ab7986bfc049cbbf565950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amakelov</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Summer of Code 2012: Week 9</title>
		<link>http://amakelov.wordpress.com/2012/07/23/google-summer-of-code-2012-week-9/</link>
		<comments>http://amakelov.wordpress.com/2012/07/23/google-summer-of-code-2012-week-9/#comments</comments>
		<pubDate>Mon, 23 Jul 2012 00:21:19 +0000</pubDate>
		<dc:creator>Александър Макелов</dc:creator>
				<category><![CDATA[Google Summer of Code 2012]]></category>

		<guid isPermaLink="false">http://amakelov.wordpress.com/?p=391</guid>
		<description><![CDATA[Hi all, here&#8217;s a brief summary of what I&#8217;ve been doing for the 9th week of my GSoC. This week saw (and still has to see) some exciting new additions: I. The incremental Schreier-Sims algorithm. This is a version of the Schreier-Sims algorithm that takes a sequence of points and a generating set for a [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=391&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi all, here&#8217;s a brief summary of what I&#8217;ve been doing for the 9th week of my GSoC.</p>
<p>This week saw (and still has to see) some exciting new additions:</p>
<p><strong><span style="font-size:large;">I. The incremental Schreier-Sims algorithm.</span></strong></p>
<p>This is a version of the Schreier-Sims algorithm that takes a sequence of points <img src='http://s0.wp.com/latex.php?latex=B&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='B' title='B' class='latex' /> and a generating set <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='S' title='S' class='latex' /> for a group <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G' title='G' class='latex' /> as input, and extends <img src='http://s0.wp.com/latex.php?latex=B&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='B' title='B' class='latex' /> to a base and <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='S' title='S' class='latex' /> to a strong generating set relative to it. It is described in [1], pp.87-93. The default value of <img src='http://s0.wp.com/latex.php?latex=B&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='B' title='B' class='latex' /> is <img src='http://s0.wp.com/latex.php?latex=%5B%5D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='[]' title='[]' class='latex' />, and that of <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='S' title='S' class='latex' /> is <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BG.generators%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='&#92;text{G.generators}' title='&#92;text{G.generators}' class='latex' />. Here&#8217;s an example:</p>
<pre class="brush: python; title: ; notranslate">

In [41]: S = SymmetricGroup(5)
In [42]: base = [3, 4]
In [43]: gens = S.generators
In [44]: x = S.schreier_sims_incremental(base, gens)
In [45]: x
Out[45]:
([3, 4, 0, 1],
[Permutation([1, 2, 3, 4, 0]),
Permutation([1, 0, 2, 3, 4]),
Permutation([4, 0, 1, 3, 2]),
Permutation([0, 2, 1, 3, 4])])
In [46]: from sympy.combinatorics.util import _verify_bsgs
In [47]: _verify_bsgs(S, x[0], x[1])
Out[47]: True
</pre>
<p>The current implementation stores the transversals for the basic orbits explicitly (the alternative is to use Schreier vectors to describe the orbits &#8211; this saves a lot of space, but requires more time in order to compute transversal elements whenever they are needed. This feature is still to be implemented, and this probably won&#8217;t happen in this GSoC). The current implementation of the Schreier-Sims algorithm on the master branch uses Jerrum&#8217;s filter (for more details and comparisons of the incremental version and the one using Jerrum&#8217;s filter, go <a href="http://www.m8j.net/data/List/Files-118/Documentation.pdf" target="_blank">here</a>) as an optimization, and also stores the transversals explicitly. The incremental version seems to be asymptotically faster though. Here&#8217;s several comparisons of the current version on the master branch and the incremental one which can be found on a local branch of mine which is somewhat inadequately called <a href="https://github.com/amakelov/sympy/tree/week6" target="_blank">week6</a>):</p>
<p>For symmetric groups:</p>
<pre class="brush: python; title: ; notranslate">

In [50]: groups = []
In [51]: for i in range(20, 30):
....:     groups.append(SymmetricGroup(i))
....:
In [52]: for group in groups:
....:     %timeit -r1 -n1 group.schreier_sims()
....:
1 loops, best of 1: 590 ms per loop
1 loops, best of 1: 719 ms per loop
1 loops, best of 1: 981 ms per loop
1 loops, best of 1: 1.35 s per loop
1 loops, best of 1: 1.66 s per loop
1 loops, best of 1: 2.19 s per loop
1 loops, best of 1: 2.74 s per loop
1 loops, best of 1: 3.37 s per loop
1 loops, best of 1: 4.28 s per loop
1 loops, best of 1: 5.37 s per loop
In [53]: for group in groups:
....:     %timeit -r1 -n1 group.schreier_sims_incremental()
....:
1 loops, best of 1: 612 ms per loop
1 loops, best of 1: 737 ms per loop
1 loops, best of 1: 927 ms per loop
1 loops, best of 1: 1.15 s per loop
1 loops, best of 1: 1.41 s per loop
1 loops, best of 1: 1.72 s per loop
1 loops, best of 1: 2.1 s per loop
1 loops, best of 1: 2.52 s per loop
1 loops, best of 1: 3.02 s per loop
1 loops, best of 1: 3.58 s per loop
</pre>
<p>For alternating groups:</p>
<pre class="brush: python; title: ; notranslate">

In [54]: groups = []
In [55]: for i in range(20, 40, 2):
....:     groups.append(AlternatingGroup(i))
....:
In [56]: for group in groups:
%timeit -r1 -n1 group.schreier_sims()
....:
1 loops, best of 1: 613 ms per loop
1 loops, best of 1: 1.03 s per loop
1 loops, best of 1: 1.77 s per loop
1 loops, best of 1: 2.65 s per loop
1 loops, best of 1: 3.51 s per loop
1 loops, best of 1: 5.31 s per loop
1 loops, best of 1: 7.71 s per loop
1 loops, best of 1: 11.1 s per loop
1 loops, best of 1: 15.3 s per loop
1 loops, best of 1: 19.1 s per loop
In [57]: for group in groups:
%timeit -r1 -n1 group.schreier_sims_incremental()
....:
1 loops, best of 1: 504 ms per loop
1 loops, best of 1: 787 ms per loop
1 loops, best of 1: 1.23 s per loop
1 loops, best of 1: 1.9 s per loop
1 loops, best of 1: 2.8 s per loop
1 loops, best of 1: 3.99 s per loop
1 loops, best of 1: 5.48 s per loop
1 loops, best of 1: 7.45 s per loop
1 loops, best of 1: 10 s per loop
1 loops, best of 1: 13.2 s per loop
</pre>
<p>And for some dihedral groups of large degree (to illustrate the case of small-base groups of large degrees):</p>
<pre class="brush: python; title: ; notranslate">

In [58]: groups = []
In [59]: for i in range(100, 2000, 200):
....:     groups.append(DihedralGroup(i))
....:
In [60]: for group in groups:
%timeit -r1 -n1 group.schreier_sims()
....:
1 loops, best of 1: 29.6 ms per loop
1 loops, best of 1: 108 ms per loop
1 loops, best of 1: 278 ms per loop
1 loops, best of 1: 527 ms per loop
1 loops, best of 1: 861 ms per loop
1 loops, best of 1: 1.29 s per loop
1 loops, best of 1: 1.83 s per loop
1 loops, best of 1: 2.39 s per loop
1 loops, best of 1: 3.06 s per loop
1 loops, best of 1: 3.83 s per loop
In [61]: for group in groups:
%timeit -r1 -n1 group.schreier_sims_incremental()
....:
1 loops, best of 1: 20.8 ms per loop
1 loops, best of 1: 52.8 ms per loop
1 loops, best of 1: 121 ms per loop
1 loops, best of 1: 223 ms per loop
1 loops, best of 1: 365 ms per loop
1 loops, best of 1: 548 ms per loop
1 loops, best of 1: 766 ms per loop
1 loops, best of 1: 1 s per loop
1 loops, best of 1: 1.25 s per loop
1 loops, best of 1: 1.51 s per loop
</pre>
<p>In addition to this algorithm I implemented a related function _remove_gens in sympy.combinatorics.util which removes redundant generators from a strong generating set (since there tend to be some redundant ones after schreier_sims_incremental() is run):</p>
<pre class="brush: python; title: ; notranslate">

In [68]: from sympy.combinatorics.util import _remove_gens
In [69]: S = SymmetricGroup(6)
In [70]: base, strong_gens = S.schreier_sims_incremental()
In [71]: strong_gens
Out[71]:
[Permutation([1, 2, 3, 4, 5, 0]),
Permutation([1, 0, 2, 3, 4, 5]),
Permutation([0, 5, 1, 2, 3, 4]),
Permutation([0, 1, 2, 3, 5, 4]),
Permutation([0, 1, 2, 4, 3, 5]),
Permutation([0, 1, 3, 2, 4, 5]),
Permutation([0, 1, 2, 5, 4, 3]),
Permutation([0, 1, 5, 3, 4, 2])]
In [72]: new_gens = _remove_gens(base, strong_gens)
In [73]: new_gens
Out[73]:
[Permutation([1, 0, 2, 3, 4, 5]),
Permutation([0, 5, 1, 2, 3, 4]),
Permutation([0, 1, 2, 4, 3, 5]),
Permutation([0, 1, 2, 5, 4, 3]),
Permutation([0, 1, 5, 3, 4, 2])]
In [74]: _verify_bsgs(S, base, new_gens)
Out[74]: True
</pre>
<p><strong><span style="font-size:large;">II. Subgroup search.</span></strong><br />
This is an algorithm used to find the subgroup <img src='http://s0.wp.com/latex.php?latex=K&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='K' title='K' class='latex' /> of a given group <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G' title='G' class='latex' /> of all elements of <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G' title='G' class='latex' /> satisfying a given property <img src='http://s0.wp.com/latex.php?latex=P&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='P' title='P' class='latex' />. It is described in [1], pp.114-118 and is <strong>quite sophisticated </strong>(the book is right when it says &#8220;The function SUBGROUPSEARCH is rather complicated and will require careful study by the reader.&#8221;). On the other hand, it is one of the most interesting additions to the groups module to date since it can do so much. The idea is to do a depth-first search over all group elements and prune large parts of the search tree based on several different criteria. It&#8217;s currently about 150 lines of code and works in many cases but still <strong>needs debugging</strong>. It can currently do some wonderful stuff like this:</p>
<pre class="brush: python; title: ; notranslate">

In [77]: S = SymmetricGroup(6)
In [78]: prop = lambda g: g.is_even
In [79]: G = S.subgroup_search(prop)
In [80]: G == AlternatingGroup(6)
Out[80]: True

</pre>
<p>to find the alternating group as a subgroup of the full symmetric group by the defining property that all its elements are the even permutations, or this:</p>
<pre class="brush: python; title: ; notranslate">

In [81]: D = DihedralGroup(10)
In [82]: prop_true = lambda g: True
In [83]: G = D.subgroup_search(prop_true)
In [84]: G == D
Out[84]: True
</pre>
<p>to find the dihedral group <img src='http://s0.wp.com/latex.php?latex=D_%7B10%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='D_{10}' title='D_{10}' class='latex' /> as a subgroup of itself using the trivial property that always returns <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTrue%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='&#92;text{True}' title='&#92;text{True}' class='latex' />; or this:</p>
<pre class="brush: python; title: ; notranslate">

In [106]: A = AlternatingGroup(4)
In [107]: G = A.subgroup_search(prop_fix_23)
In [108]: G == A.stabilizer(2).stabilizer(3)
Out[108]: True
</pre>
<p>to find the pointwise stabilizer of <img src='http://s0.wp.com/latex.php?latex=%5C%7B2%2C3%5C%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='&#92;{2,3&#92;}' title='&#92;{2,3&#92;}' class='latex' />. And so on and so on. What is more wonderful is that you can specify the base used for <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G' title='G' class='latex' /> in advance, and the generating set returned for <img src='http://s0.wp.com/latex.php?latex=K&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='K' title='K' class='latex' /> will be a strong generating set with respect to that base!</p>
<pre class="brush: python; title: ; notranslate">

In [119]: A = AlternatingGroup(5)
In [120]: base, strong_gens = A.schreier_sims_incremental()
In [121]: G = A.subgroup_search(prop_fix_1, base=base, strong_gens=strong_gens)
In [122]: G == A.stabilizer(1)
Out[122]: True
In [123]: _verify_bsgs(G, base, G.generators)
Out[123]: True
</pre>
<p>The bad news is that the function breaks somewhere. For example:</p>
<pre class="brush: python; title: ; notranslate">

In [125]: S = SymmetricGroup(7)
In [126]: prop_true = lambda g: True
In [127]: G = S.subgroup_search(prop_true)
In [128]: G == S
Out[128]: False
</pre>
<p>This needs some really careful debugging, but overall it looks promising since it works in so many cases &#8211; so the bug is hopefully small : ).</p>
<p>So, that&#8217;s it for now!</p>
<p>[1] Derek F. Holt, Bettina Eick, Bettina, Eamonn A. O’Brien, “Handbook of computational group theory”, Discrete Mathematics and its Applications (Boca Raton). Chapman &amp; Hall/CRC, Boca Raton, FL, 2005. ISBN 1-58488-372-3</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amakelov.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amakelov.wordpress.com/391/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=391&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amakelov.wordpress.com/2012/07/23/google-summer-of-code-2012-week-9/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d10599ccc7ab7986bfc049cbbf565950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amakelov</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Summer of Code 2012: Week 8</title>
		<link>http://amakelov.wordpress.com/2012/07/15/google-summer-of-code-2012-week-8/</link>
		<comments>http://amakelov.wordpress.com/2012/07/15/google-summer-of-code-2012-week-8/#comments</comments>
		<pubDate>Sun, 15 Jul 2012 23:28:05 +0000</pubDate>
		<dc:creator>Александър Макелов</dc:creator>
				<category><![CDATA[Google Summer of Code 2012]]></category>

		<guid isPermaLink="false">http://amakelov.wordpress.com/?p=302</guid>
		<description><![CDATA[Hi everyone, here&#8217;s a brief summary of what I&#8217;ve been doing for the 8th week of my GSoC: The issue with the BASESWAP function on page 103 of [1] that I discussed here is now resolved: one of the authors, Professor Derek Holt at Warwick, replied to me that this is indeed a typo and [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=302&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi everyone, here&#8217;s a brief summary of what I&#8217;ve been doing for the 8th week of my GSoC:</p>
<ul>
<li>The issue with the BASESWAP function on page 103 of [1] that I discussed <a href="http://amakelov.wordpress.com/2012/07/01/google-summer-of-code-2012-week-6/" target="_blank">here</a> is now resolved: one of the authors, Professor Derek Holt at Warwick, replied to me that this is indeed a typo and added it to the errata page <a href="http://homepages.warwick.ac.uk/~mareg/CGTHandbookErrors" target="_blank">here</a>.</li>
</ul>
<ul>
<li>I studied the SUBGROUPSEARCH algorithm described in [1] in more depth. It takes as input a group <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G' title='G' class='latex' /> with a BSGS, a subgroup <img src='http://s0.wp.com/latex.php?latex=K+%3C+G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='K &lt; G' title='K &lt; G' class='latex' /> with a BSGS having the same base as that of <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G' title='G' class='latex' />, a property <img src='http://s0.wp.com/latex.php?latex=P&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='P' title='P' class='latex' /> such that <img src='http://s0.wp.com/latex.php?latex=P%28g%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='P(g)' title='P(g)' class='latex' /> for <img src='http://s0.wp.com/latex.php?latex=g+%5Cin+G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='g &#92;in G' title='g &#92;in G' class='latex' /> is either true or false, <img src='http://s0.wp.com/latex.php?latex=P%28g%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='P(g)' title='P(g)' class='latex' /> is always true for $g \in K$, and the elements of <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G' title='G' class='latex' /> satisfying <img src='http://s0.wp.com/latex.php?latex=P&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='P' title='P' class='latex' /> form a subgroup <img src='http://s0.wp.com/latex.php?latex=H&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='H' title='H' class='latex' />, and tests <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BTEST%7D%28g%2C+l%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='&#92;text{TEST}(g, l)' title='&#92;text{TEST}(g, l)' class='latex' /> used to rule out group elements (i.e., make sure they don&#8217;t satisfy <img src='http://s0.wp.com/latex.php?latex=P&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='P' title='P' class='latex' />) based on the image of the first <img src='http://s0.wp.com/latex.php?latex=l&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='l' title='l' class='latex' /> base points of <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G' title='G' class='latex' />, the so-called partial base image. It modifies <img src='http://s0.wp.com/latex.php?latex=K&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='K' title='K' class='latex' /> by adding generators until <img src='http://s0.wp.com/latex.php?latex=K+%3D+H&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='K = H' title='K = H' class='latex' />, and returns a strong generating set for <img src='http://s0.wp.com/latex.php?latex=H&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='H' title='H' class='latex' />. It performs a depth-first search over all possible base images (which by the definition of a base determine uniquely every element of <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G' title='G' class='latex' />), but uses several conditions to prune the search tree and is said to be fast in practice. This algorithm is the basis for finding normalizers and centralizers and intersections of subgroups, so it&#8217;s pretty fundamental. One of its features is the frequent change of base for <img src='http://s0.wp.com/latex.php?latex=K&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='K' title='K' class='latex' />: at level <img src='http://s0.wp.com/latex.php?latex=l&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='l' title='l' class='latex' /> in the search tree we want to make sure that the base for <img src='http://s0.wp.com/latex.php?latex=K&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='K' title='K' class='latex' /> starts with the current partial base image (i.e., the image of the first <img src='http://s0.wp.com/latex.php?latex=l&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='l' title='l' class='latex' /> points in the base). In [1] it is said that this requires only one application of BASESWAP (which swaps two neighbouring base points). <strong>This was confusing me for a while.</strong> However, since we want to only change the <img src='http://s0.wp.com/latex.php?latex=l&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='l' title='l' class='latex' />-th base point at any base change, and the base after the <img src='http://s0.wp.com/latex.php?latex=l&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='l' title='l' class='latex' />-th point doesn&#8217;t matter at level <img src='http://s0.wp.com/latex.php?latex=l&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='l' title='l' class='latex' />, it seems that we can do the following. Treat the partial base image, denote it by <img src='http://s0.wp.com/latex.php?latex=c_1+c_2+%5Cldots+c_l&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='c_1 c_2 &#92;ldots c_l' title='c_1 c_2 &#92;ldots c_l' class='latex' />, as a base, and then run BASESWAP on <img src='http://s0.wp.com/latex.php?latex=c_1+c_2+%5Cldots+c_l+c&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='c_1 c_2 &#92;ldots c_l c' title='c_1 c_2 &#92;ldots c_l c' class='latex' />, interchanging the last two elements, where <img src='http://s0.wp.com/latex.php?latex=c&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='c' title='c' class='latex' /> is the new <img src='http://s0.wp.com/latex.php?latex=l&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='l' title='l' class='latex' />-th point in the base. Now I&#8217;m more confident that I can implement SUBGROUP search (the other parts of the procedure are easily approachable). But there is one other problem with it:</li>
<li>We want <img src='http://s0.wp.com/latex.php?latex=K&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='K' title='K' class='latex' />, the group we initialize <img src='http://s0.wp.com/latex.php?latex=H&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='H' title='H' class='latex' /> with, to have the same base as <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G' title='G' class='latex' />. The current deterministic implementation of the Schreier-Sims algorithm (using Jerrum&#8217;s filther) always produces a BSGS from scratch, and therefore we can&#8217;t tell it to make a BSGS for <img src='http://s0.wp.com/latex.php?latex=K&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='K' title='K' class='latex' /> with respect to some particular base. Hence we need an implementation of the so-called &#8220;incremental&#8221; Schreier-Sims algorithm, which takes a sequence of points and a generating set and extends them to a BSGS. This is also described in [1], together with some optimizations, and it won&#8217;t be very hard to go through the pseudocode and implement it &#8211; so that&#8217; going to be the next step. It would also be a useful addition to the entire group-theoretical module since often in algorithms we want a BSGS with respect to some convenient base.</li>
</ul>
<p>More or less, that&#8217;s it for now. In the next few days I&#8217;ll try to write some actual code implementing the above two bullets and get some more reviewing for my <a href="https://github.com/sympy/sympy/pull/1406" target="_blank">most recent pull request</a>.</p>
<p>[1] Derek F. Holt, Bettina Eick, Bettina, Eamonn A. O’Brien, “Handbook of computational group theory”, Discrete Mathematics and its Applications (Boca Raton). Chapman &amp; Hall/CRC, Boca Raton, FL, 2005. ISBN 1-58488-372-3</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amakelov.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amakelov.wordpress.com/302/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=302&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amakelov.wordpress.com/2012/07/15/google-summer-of-code-2012-week-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d10599ccc7ab7986bfc049cbbf565950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amakelov</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Summer of Code 2012: Week 7</title>
		<link>http://amakelov.wordpress.com/2012/07/08/google-summer-of-code-2012-week-7/</link>
		<comments>http://amakelov.wordpress.com/2012/07/08/google-summer-of-code-2012-week-7/#comments</comments>
		<pubDate>Sun, 08 Jul 2012 15:29:12 +0000</pubDate>
		<dc:creator>Александър Макелов</dc:creator>
				<category><![CDATA[Google Summer of Code 2012]]></category>

		<guid isPermaLink="false">http://amakelov.wordpress.com/?p=266</guid>
		<description><![CDATA[Hi all, here&#8217;s a brief summary of what I&#8217;ve been doing during the 7th week of my GSoC, as well as a general overview of what&#8217;s going on and where things are going with computational group theory in sympy. Things I did during the week. This week I focused on: improving the existing code for [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=266&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi all,</p>
<p>here&#8217;s a brief summary of what I&#8217;ve been doing during the 7th week of my GSoC, as well as a general overview of what&#8217;s going on and where things are going with computational group theory in sympy.</p>
<p><strong>Things I did during the week.</strong></p>
<p>This week I focused on:</p>
<ul>
<li>improving the existing code for the functions I recently added &#8211; the randomized Schreier-Sims algorithm, the function BASESWAP that changes two points in a base, and the PRINTELEMENTS function (I talk about these <a href="http://amakelov.wordpress.com/2012/06/24/google-summer-of-code-2012-week-5/" target="_blank">here</a> and <a href="http://amakelov.wordpress.com/2012/06/18/google-summer-of-code-2012-week-4/" target="_blank">here</a>). I included some comments in the bodies of the functions since these tend to be quite long. Also, I adopted some new naming conventions for handling all the structures related to a base and a strong generating set. It&#8217;d be nice if this naming convention is used throughout the combinatorics module (which for now depends mostly on me, as it seems <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ), and it&#8217;d be nice if people provide some feedback on the names I chose. So here we go:</li>
<li>making possible the interaction with the deterministic Schreier-Sims algorithm. After some insights from <a href="https://github.com/pernici" target="_blank">Mario</a> on the values returned by his implementation, I extracted from it the data necessary to make the algorihtms described in [1] that use a base and strong generating set possible.</li>
<li>splitting the code further, with the sympy.combinatorics.util file which now holds the internal functions used to handle permutaion groups (this can be later expanded with other internal functions across the combinatorics module).</li>
<li>Finally, adding docstrings, tests and making a pull request which is available <a href="https://github.com/sympy/sympy/pull/1406#issuecomment-6812223" target="_blank">here </a>. It&#8217;s about 1300 lines of code, which is sort of bad, but I can remove some of the stuff and keep it for a future pull request.</li>
</ul>
<p>So here are the <em><strong>naming conventions for working with a BSGS:</strong></em></p>
<p><strong>degree</strong> &#8211; the degree of the permutation group.</p>
<p><strong>base</strong> &#8211; This is sort of obvious. A base for a permutation group <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G' title='G' class='latex' /> is an ordered tuple of points <img src='http://s0.wp.com/latex.php?latex=%28b_1%2C+b_2%2C%5Cldots%2C+b_k%29+&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='(b_1, b_2,&#92;ldots, b_k) ' title='(b_1, b_2,&#92;ldots, b_k) ' class='latex' /> such that no group element <img src='http://s0.wp.com/latex.php?latex=g+%5Cin+G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='g &#92;in G' title='g &#92;in G' class='latex' /> fixes all the points <img src='http://s0.wp.com/latex.php?latex=b_1%2C+b_2%2C+%5Cldots%2C+b_k&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='b_1, b_2, &#92;ldots, b_k' title='b_1, b_2, &#92;ldots, b_k' class='latex' /> (the significance of the ordering will become apparent later). This is implemented as a list.</p>
<p><strong>base_len</strong> &#8211; the number of elements in a base.</p>
<p><strong>strong_gens</strong> &#8211; the strong generating set (relative to some base). This is implemented as a list of Perm objects.</p>
<p><strong>basic_stabilizers</strong> &#8211; For a base <img src='http://s0.wp.com/latex.php?latex=%28b_1%2C+b_2%2C%5Cldots%2C+b_k%29+&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='(b_1, b_2,&#92;ldots, b_k) ' title='(b_1, b_2,&#92;ldots, b_k) ' class='latex' />, the basic stabilizers are defined as <img src='http://s0.wp.com/latex.php?latex=G%5E%7B%28i%29%7D+%3D+G_%7Bb_1%2C+%5Cldots%2C+b_%7Bi-1%7D%7D+%3A%3D+%5C%7B+g+%5Cin+G+%7C+g%28b_1%29+%3D+b_1%2C+%5Cldots%2C+g%28b_%7Bi-1%7D%29+%3D+b_%7Bi-1%7D%5C%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G^{(i)} = G_{b_1, &#92;ldots, b_{i-1}} := &#92;{ g &#92;in G | g(b_1) = b_1, &#92;ldots, g(b_{i-1}) = b_{i-1}&#92;}' title='G^{(i)} = G_{b_1, &#92;ldots, b_{i-1}} := &#92;{ g &#92;in G | g(b_1) = b_1, &#92;ldots, g(b_{i-1}) = b_{i-1}&#92;}' class='latex' /> for <img src='http://s0.wp.com/latex.php?latex=i+%5Cin+%5C%7B1%2C+2%2C+%5Cldots%2C+k%5C%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='i &#92;in &#92;{1, 2, &#92;ldots, k&#92;}' title='i &#92;in &#92;{1, 2, &#92;ldots, k&#92;}' class='latex' /> so that we have <img src='http://s0.wp.com/latex.php?latex=G%5E%7B%281%29%7D+%3D+G&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G^{(1)} = G' title='G^{(1)} = G' class='latex' />. This is implemented as a list of permutation groups.</p>
<p><strong>distr_gens</strong> &#8211; the strong generators distributed according to the basic stabilizers. This means: for a base <img src='http://s0.wp.com/latex.php?latex=%28b_1%2C+b_2%2C%5Cldots%2C+b_k%29+&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='(b_1, b_2,&#92;ldots, b_k) ' title='(b_1, b_2,&#92;ldots, b_k) ' class='latex' /> and a strong generating set <img src='http://s0.wp.com/latex.php?latex=S%3D+%5C%7B+g_1%2C+g_2%2C+%5Cldots%2C+g_t%5C%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='S= &#92;{ g_1, g_2, &#92;ldots, g_t&#92;}' title='S= &#92;{ g_1, g_2, &#92;ldots, g_t&#92;}' class='latex' />, distribute the <img src='http://s0.wp.com/latex.php?latex=g_i&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='g_i' title='g_i' class='latex' /> in sets <img src='http://s0.wp.com/latex.php?latex=S%5E%7B%28i%29%7D+%3D+G%5E%7B%28i%29%7D+%5Ccap+S&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='S^{(i)} = G^{(i)} &#92;cap S' title='S^{(i)} = G^{(i)} &#92;cap S' class='latex' /> for <img src='http://s0.wp.com/latex.php?latex=i+%5Cin+%5C%7B1%2C+2%2C%5Cldots%2C+k%5C%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='i &#92;in &#92;{1, 2,&#92;ldots, k&#92;}' title='i &#92;in &#92;{1, 2,&#92;ldots, k&#92;}' class='latex' /> where the <img src='http://s0.wp.com/latex.php?latex=G%5E%7B%28i%29%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G^{(i)}' title='G^{(i)}' class='latex' /> are defined as above. This is implemented as a list of lists holding the elements of the <img src='http://s0.wp.com/latex.php?latex=S%5E%7B%28i%29%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='S^{(i)}' title='S^{(i)}' class='latex' /></p>
<p><strong>basic_orbits</strong> &#8211; these are the orbits of <img src='http://s0.wp.com/latex.php?latex=b_i&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='b_i' title='b_i' class='latex' /> under <img src='http://s0.wp.com/latex.php?latex=G%5E%7B%28i%29%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G^{(i)}' title='G^{(i)}' class='latex' />. These are implemented as a list of lists, being the list of lists of keys for the basic transversals, see below.</p>
<p><strong>basic_transversals</strong> &#8211; these are transversals for the basic orbits. Notice that the choice for these may not (and in most cases won&#8217;t be) unique. For one thing, it depends on the set of strong generators present (which is also not uniquely determined for a given base). They are implemented as a list of dictionaries indexed according to the base <img src='http://s0.wp.com/latex.php?latex=%28b_1%2C+b_2%2C%5Cldots%2C+b_k%29+&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='(b_1, b_2,&#92;ldots, b_k) ' title='(b_1, b_2,&#92;ldots, b_k) ' class='latex' />, with keys &#8211; the elements of the basic orbits, and values &#8211; transversal elements sending the current <img src='http://s0.wp.com/latex.php?latex=b_i&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='b_i' title='b_i' class='latex' /> to the key.</p>
<p>I wrote functions extracting <strong>basic_orbits, basic_transversals, basic_stabilizers, distr_gens</strong> from only a base and strong generating set, as well as functions for extracting all of them from a base, strong generating set, and a part of them, so that if any of them is available, it can be supplied in order to avoid recalculations.</p>
<p>Also, there is a straightforward test _verify_bsgs in sympy.combinatorics.util that tests a sequence of points and group elements for being a base and strong generating set. It simply verifies the definition of a base and strong generating set relative to it. There will likely be other ways to do that in the future &#8211; more effective, but surely more complicated and thus error-prone. This will serve as a robust testing tool</p>
<p><strong>Where we are.</strong></p>
<p>So, here&#8217;s a checklist of what I&#8217;ve promised in my <a href="http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/amakelov/1" target="_blank">proposal</a> on the melange website, and which parts of it have already been implemented. This is reading the optimistic timeline. This all pertains to permutation groups, unless specified:</p>
<ul>
<li>handling different representations &#8211; NO</li>
<li>excluding singleton cycles from the cycle decomposition &#8211; NO</li>
<li>powers and orders of elements &#8211; YES. This was actually already there for permutations.</li>
<li>orbits &#8211; YES.</li>
<li>stabilizers &#8211; YES.</li>
<li>schreier vectors &#8211; YES.</li>
<li>randomized Schreier-Sims algorithm &#8211; YES</li>
<li>handling bases and strong generating sets &#8211; YES</li>
<li>membership testing &#8211; YES (the function _strip in sympy.combinatorics.util)</li>
<li>rewriting algorithm &#8211; NO.</li>
<li>actions on cosets &#8211; NO.</li>
<li>quotient groups &#8211; NO.</li>
<li>order of a group &#8211; YES. This was already there.</li>
<li>subgroup testing &#8211; NO.</li>
<li>coset enumeration by the Todd-Coxeter algorithm &amp; consequences &#8211; NO.</li>
<li>primitivity testing &#8211; YES.</li>
<li>finding (minimal) block systems &#8211; YES.</li>
<li>general backtrack search for a certain property &#8211; No, however easy to do by modifying PRINTELEMENTS.</li>
<li>outputting all group elements &#8211; YES. This was already there, however PRINTELEMENTS does it in lexicographical order according to a base.</li>
<li>Sylow subgroups &#8211; NO.</li>
<li>calculating the center &#8211; NO.</li>
<li>pointwise stabilizers (of more than one point, see above) &#8211; NO.</li>
<li>change of base &#8211; YES.</li>
<li>product groups &#8211; YES.</li>
<li>more on finitely presented groups (&#8230;) &#8211; NO.</li>
<li>the p-core &#8211; NO.</li>
<li>the solvable radical &#8211; NO.</li>
<li>database of known groups &#8211; NO.</li>
</ul>
<p><strong>Things yet to be done.</strong></p>
<p>Apart from the things that got a &#8220;NO&#8221; on the list above, the following currently come to mind (I&#8217;ll update this list periodically):</p>
<ul>
<li>Work on removing redundant generators from a strong/any generating set, as described in [1].</li>
<li>Precompute more properties for the groups in the named groups module (transitivity degrees, bases and strong generating sets, etc.)</li>
<li>Add more groups to the named groups module.</li>
<li>Fix the issues pointed out in the review of <a href="https://github.com/sympy/sympy/pull/1377" target="_blank">my second pull request</a>.</li>
<li>Finally do something for handling representations of finite groups over vector spaces, like working with character tables. It&#8217;d be cool to have a function that computes the conjugacy classes for a given group, but I don&#8217;t know right now how possible that is.</li>
<li>Finally implement the group intersection algorithm&#8230; I&#8217;m currently starting to work my way through the SUBGROUPSEARCH function which is fundamental for implementing backtracking algorithms for group intersection, centralizers, etc.</li>
<li>Upgrade the randomized version of Schreier-Sims to Las Vegas type in the case when the order of the group is known.</li>
<li>Currently, transversal elements for the basic orbits for a stabilizer chain are stored explicitly. This requires too much memory for large groups. An alternative solution (which slows down execution) is to use Schreier vectors to describe the orbits. This means supplying some more arguments and adding code to many of the functions already present, and is a significant challenge by itself. The good news is that it can be carried out without modifying what is already there.</li>
<li>Come up with a more concise functionality to relate the different structures used to describe a base and strong generating set: the generators for basic stabilizers, the basic orbits, the basic transversals&#8230; There are many situations in which some of these are given and we need some of the other ones; sometimes it&#8217;s more convenient to get the orbits as sets, and sometimes as lists, and so on&#8230; the current approach is to write a new utility function whenever the present ones don&#8217;t suffice.</li>
<li>Handle the case when the identity element is provided as a generator for a permutation group &#8211; this can make some algorithms less efficient.</li>
<li>Optimize the behavior of BASESWAP so that only the <img src='http://s0.wp.com/latex.php?latex=i&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='i' title='i' class='latex' />-th and <img src='http://s0.wp.com/latex.php?latex=i%2B1&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='i+1' title='i+1' class='latex' />-th transversals are calculated.</li>
<li>Reduce side effects as much as possible (let&#8217;s be pythonic!)</li>
<li>Improve the docstring quality: it might be reasonable to lay out the theory/notation/definitions behind the Schreier-Sims algorithm in one place in some of the files and then simply refer to it as necessary. Otherwise the descriptions get unnecessarily long.<br />
.</li>
</ul>
<p>Well, that&#8217;s it for now it seems. If anything else pops up soon, I&#8217;ll add it here!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amakelov.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amakelov.wordpress.com/266/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=266&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amakelov.wordpress.com/2012/07/08/google-summer-of-code-2012-week-7/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d10599ccc7ab7986bfc049cbbf565950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amakelov</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Summer of Code 2012: Week 6</title>
		<link>http://amakelov.wordpress.com/2012/07/01/google-summer-of-code-2012-week-6/</link>
		<comments>http://amakelov.wordpress.com/2012/07/01/google-summer-of-code-2012-week-6/#comments</comments>
		<pubDate>Sun, 01 Jul 2012 22:45:03 +0000</pubDate>
		<dc:creator>Александър Макелов</dc:creator>
				<category><![CDATA[Google Summer of Code 2012]]></category>

		<guid isPermaLink="false">http://amakelov.wordpress.com/?p=245</guid>
		<description><![CDATA[Hi all, here&#8217;s a brief summary of what I&#8217;ve been doing for the sixth week of my GSoC: Submitting, fixing and finally getting merged my second pull request. Thanks a lot to Stefan and my mentor David for reviewing it! now we have a lot more functionality for handling permutation groups. Some more debugging on [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=245&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi all,</p>
<p>here&#8217;s a brief summary of what I&#8217;ve been doing for the sixth week of my GSoC:</p>
<ul>
<li>Submitting, fixing and finally getting merged my <a href="https://github.com/sympy/sympy/pull/1377" target="_blank">second pull request</a>. Thanks a lot to <a href="https://github.com/Krastanov" target="_blank">Stefan</a> and my mentor <a href="https://github.com/wdjoyner" target="_blank">David</a> for reviewing it! now we have a lot more functionality for handling permutation groups.</li>
<li>Some more debugging on PRINTELEMENTS (I was talking about it in the third bullet of <a href="http://amakelov.wordpress.com/2012/06/24/google-summer-of-code-2012-week-5/" target="_blank">my post from last week</a>). It turned out that it was still doing something slightly wrong but now it&#8217;s the way it should be. Apart from that, its speed was optimized by a different means of storing computed subwords of the group element being computed as a word in elements from the basic transversals (this assumes some knowledge of the theory of bases and strong generating sets; for a discussion, see [1],  pp.87-88,  pp.108-110)</li>
<li>In the <a href="http://amakelov.wordpress.com/2012/06/24/google-summer-of-code-2012-week-5/#comments" target="_blank">comments</a> on <a href="http://amakelov.wordpress.com/2012/06/24/google-summer-of-code-2012-week-5/" target="_blank">my post from last week</a>, I got a clarification from <a href="https://github.com/pernici" target="_blank">Mario</a> on the struggles with _coset_repr that I discussed in the third bullet of last week&#8217;s post. Now I&#8217;ll be able to use the current deterministic implementation of the Schreier-Sims algorithm whenever a BSGS is needed (after some minor modifications to the attributes of a PermutationGroup that are assigned after running Schreier-Sims).</li>
<li>Finally, the implementation of the algorithm BASESWAP ([1],  pp.102-103). This function is necessary for SUBGROUPSEARCH ([1], p.117) which in turn is necessary for the group intersection algorithm. <strong>This deserves some special attention &#8211; I have strong reasons to believe that the pseudocode &amp; its discussion in [1], pp. 102-103 contain the same mistake repeated several times.</strong> Namely, I think that line 3 of the pseudocode for BASESWAP should read <img src='http://s0.wp.com/latex.php?latex=%7C%5Cbeta_i%5E%7B%5Cleft%5Clangle+T%5Cright%5Crangle%7D%7C%5Cneq+s&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='|&#92;beta_i^{&#92;left&#92;langle T&#92;right&#92;rangle}|&#92;neq s' title='|&#92;beta_i^{&#92;left&#92;langle T&#92;right&#92;rangle}|&#92;neq s' class='latex' /> instead of <img src='http://s0.wp.com/latex.php?latex=%7C%5Cbeta_%7Bi%2B1%7D%5E%7B%5Cleft%5Clangle+T%5Cright%5Crangle%7D%7C%5Cneq+s&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='|&#92;beta_{i+1}^{&#92;left&#92;langle T&#92;right&#92;rangle}|&#92;neq s' title='|&#92;beta_{i+1}^{&#92;left&#92;langle T&#92;right&#92;rangle}|&#92;neq s' class='latex' />. At first I implemented the algorithm the way it was given is pseudocode, and lost many hours (it wasn&#8217;t working) until I discovered that this little detail might be wrong. Now, I shall assume the notation used in [1] in order to follow their argument as closely as possible. My reasoning is as follows: as we change the set <img src='http://s0.wp.com/latex.php?latex=T&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='T' title='T' class='latex' /> during the run of BASESWAP, we finally want to have <img src='http://s0.wp.com/latex.php?latex=%5Cleft%5Clangle+T%5Cright%5Crangle+%3D+H+%3A%3D+G%5E%7B%28i%29%7D_%7B%5Cbeta_%7Bi%2B1%7D%7D%3DG_%7B%5Cbeta_1%2C+%5Cbeta_2%2C+%5Cldots%2C+%5Cbeta_%7Bi-1%7D%2C+%5Cbeta_%7Bi%2B1%7D%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='&#92;left&#92;langle T&#92;right&#92;rangle = H := G^{(i)}_{&#92;beta_{i+1}}=G_{&#92;beta_1, &#92;beta_2, &#92;ldots, &#92;beta_{i-1}, &#92;beta_{i+1}}' title='&#92;left&#92;langle T&#92;right&#92;rangle = H := G^{(i)}_{&#92;beta_{i+1}}=G_{&#92;beta_1, &#92;beta_2, &#92;ldots, &#92;beta_{i-1}, &#92;beta_{i+1}}' class='latex' />. The last line <img src='http://s0.wp.com/latex.php?latex=%7CG%5E%7B%28i%29%7D%7C+%3D+%7C%5CDelta%5E%7B%28i%29%7D%7C%7C%5CDelta%5E%7B%28i%2B1%29%7D%7C%7CG%5E%7B%28i%2B2%29%7D%7C+%3D+%7C%5Cbeta_%7Bi%2B1%7D%5E%7BG%5E%7B%28i%29%7D%7D%7C%7CH%7C&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='|G^{(i)}| = |&#92;Delta^{(i)}||&#92;Delta^{(i+1)}||G^{(i+2)}| = |&#92;beta_{i+1}^{G^{(i)}}||H|' title='|G^{(i)}| = |&#92;Delta^{(i)}||&#92;Delta^{(i+1)}||G^{(i+2)}| = |&#92;beta_{i+1}^{G^{(i)}}||H|' class='latex' /> on page 102 of [1] is indeed correct by a straightforward application of the orbit-stabilizer theorem; so if we put <img src='http://s0.wp.com/latex.php?latex=s+%3D+%5Cfrac%7B%7C%5CDelta%5E%7B%28i%29%7D%7C%7C%5CDelta%5E%7B%28i%2B1%29%7D%7C%7D%7B+%7C%5Cbeta_%7Bi%2B1%7D%5E%7BG%5E%7B%28i%29%7D%7D%7C%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='s = &#92;frac{|&#92;Delta^{(i)}||&#92;Delta^{(i+1)}|}{ |&#92;beta_{i+1}^{G^{(i)}}|}' title='s = &#92;frac{|&#92;Delta^{(i)}||&#92;Delta^{(i+1)}|}{ |&#92;beta_{i+1}^{G^{(i)}}|}' class='latex' /> we indeed have <img src='http://s0.wp.com/latex.php?latex=%7CH%7C+%3D+s%7CG%5E%7B%28i%2B2%29%7D%7C&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='|H| = s|G^{(i+2)}|' title='|H| = s|G^{(i+2)}|' class='latex' />. Up to this point, I believe the book. However, after that <strong>they say</strong> that the last equation implies that <img src='http://s0.wp.com/latex.php?latex=s+%3D+%7C%5Cbeta_%7Bi%2B1%7D%5EH%7C&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='s = |&#92;beta_{i+1}^H|' title='s = |&#92;beta_{i+1}^H|' class='latex' />. Looking more closely, by definitions we recall that <img src='http://s0.wp.com/latex.php?latex=H+%3D+G_%7B%5Cbeta_1%2C+%5Cbeta_2%2C+%5Cldots%2C+%5Cbeta_%7Bi-1%7D%2C+%5Cbeta_%7Bi%2B1%7D%7D%2C+G%5E%7B%28i%2B2%29%7D+%3D+G_%7B%5Cbeta_1%2C+%5Cbeta_2%2C%5Cldots%2C+%5Cbeta_%7Bi%2B1%7D%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='H = G_{&#92;beta_1, &#92;beta_2, &#92;ldots, &#92;beta_{i-1}, &#92;beta_{i+1}}, G^{(i+2)} = G_{&#92;beta_1, &#92;beta_2,&#92;ldots, &#92;beta_{i+1}}' title='H = G_{&#92;beta_1, &#92;beta_2, &#92;ldots, &#92;beta_{i-1}, &#92;beta_{i+1}}, G^{(i+2)} = G_{&#92;beta_1, &#92;beta_2,&#92;ldots, &#92;beta_{i+1}}' class='latex' />. Hence, <img src='http://s0.wp.com/latex.php?latex=G%5E%7B%28i%2B2%29%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G^{(i+2)}' title='G^{(i+2)}' class='latex' /> is the stabilizer of <img src='http://s0.wp.com/latex.php?latex=%5Cbeta_i&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='&#92;beta_i' title='&#92;beta_i' class='latex' /> in <img src='http://s0.wp.com/latex.php?latex=H&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='H' title='H' class='latex' />, thus by the orbit-stabilizer theorem we have <img src='http://s0.wp.com/latex.php?latex=%7CH%7C+%3D+%7C%5Cbeta_i%5EH%7C%7CG%5E%7B%28i%2B2%29%7D%7C&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='|H| = |&#92;beta_i^H||G^{(i+2)}|' title='|H| = |&#92;beta_i^H||G^{(i+2)}|' class='latex' />, hence we must have <img src='http://s0.wp.com/latex.php?latex=%7C%5Cbeta_i%5EH%7C+%3D+s&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='|&#92;beta_i^H| = s' title='|&#92;beta_i^H| = s' class='latex' />, not <img src='http://s0.wp.com/latex.php?latex=%7C%5Cbeta_%7Bi%2B1%7D%5EH%7C%3Ds&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='|&#92;beta_{i+1}^H|=s' title='|&#92;beta_{i+1}^H|=s' class='latex' />. This same mistake (<img src='http://s0.wp.com/latex.php?latex=%5Cbeta_%7Bi%2B1%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='&#92;beta_{i+1}' title='&#92;beta_{i+1}' class='latex' /> instead of <img src='http://s0.wp.com/latex.php?latex=%5Cbeta_i&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='&#92;beta_i' title='&#92;beta_i' class='latex' />) appears several other times (in fact, all the times) in the discussion of BASESWAP and once in the pseudocode. Now that I changed it to <img src='http://s0.wp.com/latex.php?latex=%5Cbeta_i&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='&#92;beta_i' title='&#92;beta_i' class='latex' />, the implementation doesn&#8217;t break and behaves as expected. I also implemented the randomized version described in [1], p.103 and [2], p.98, and it also behaves as expected. I&#8217;d be extremely happy if anyone else is willing to go over this and check whether what I&#8217;m saying is true; I&#8217;m pretty sure it is, but I didn&#8217;t expect to find such a serious mistake in that book. I&#8217;m willing to provide their argument in its entirety or clarify the notation, just shoot me a comment below.</li>
</ul>
<p>So, that&#8217;s it for now. I&#8217;m in the process of furnishing my code for the next pull request (which will hopefully be submitted tomorrow), and then I&#8217;ll resume my work on subgroup intersections.</p>
<p>Edit: My pull request has not been submitted yet since writing the docstrings and tests took me longer than expected. The current state of it is available <a href="https://github.com/amakelov/sympy/tree/week4" target="_blank">here</a>, if anyone wants to take a look at how things are going. I still have to write some more tests, and hopefully will push it today for review.</p>
<p>Edit#2: <a href="https://github.com/sympy/sympy/pull/1406" target="_blank">The pull request</a> is finally out. It is some 1300 lines of code, so if people object I can remove some of the stuff and save them for a future pull request.</p>
<p>[1] Derek F. Holt, Bettina Eick, Bettina, Eamonn A. O’Brien, “Handbook of computational group theory”, Discrete Mathematics and its Applications (Boca Raton). Chapman &amp; Hall/CRC, Boca Raton, FL, 2005. ISBN 1-58488-372-3</p>
<p>[2] Permutation Group Algorithms, Ákos Seress, Cambridge University Press</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amakelov.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amakelov.wordpress.com/245/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=245&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amakelov.wordpress.com/2012/07/01/google-summer-of-code-2012-week-6/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d10599ccc7ab7986bfc049cbbf565950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amakelov</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Summer of Code 2012: Week 5</title>
		<link>http://amakelov.wordpress.com/2012/06/24/google-summer-of-code-2012-week-5/</link>
		<comments>http://amakelov.wordpress.com/2012/06/24/google-summer-of-code-2012-week-5/#comments</comments>
		<pubDate>Sun, 24 Jun 2012 21:19:23 +0000</pubDate>
		<dc:creator>Александър Макелов</dc:creator>
				<category><![CDATA[Google Summer of Code 2012]]></category>

		<guid isPermaLink="false">http://amakelov.wordpress.com/?p=147</guid>
		<description><![CDATA[Hi everyone, here&#8217;s a brief summary of what I&#8217;ve been doing for the fifth week of my GSoC. Firstly, I finally had my first pull request merged; it&#8217;s all my fault I didn&#8217;t complain about it on the mailing list earlier : ) I had to fix a bunch of things on it (stuff like [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=147&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi everyone,</p>
<p>here&#8217;s a brief summary of what I&#8217;ve been doing for the fifth week of my GSoC.</p>
<ul>
<li>Firstly, I finally had <a href="https://github.com/sympy/sympy/pull/1319" target="_blank">my first pull request</a> merged; it&#8217;s all my fault I didn&#8217;t complain about it on the mailing list earlier : ) I had to fix a bunch of things on it (stuff like documentation using sphinx and some improvements in code quality, mainly docstrings), and now I&#8217;m really happy to have my first major contribution to sympy merged with the master branch. Thanks to everyone who helped in reviewing it &#8211; <a href="https://github.com/Krastanov" target="_blank">Stefan</a>, <a href="https://github.com/pernici" target="_blank">Mario</a>, <a href="https://github.com/ness01" target="_blank">Tom</a>, <a href="https://github.com/mrocklin" target="_blank">Matthew</a>, and of course my mentor <a href="https://github.com/wdjoyner" target="_blank">David</a>.</li>
<li>Secondly, my next pull request, mainly containing work from weeks 2 and 5. After some moderate rebasing over the fixes from my first pull request, it is available <a href="https://github.com/sympy/sympy/pull/1377" target="_blank">here</a>. Apart from implementations of <a href="http://amakelov.wordpress.com/2012/06/02/google-summer-of-code-2012-week-2/" target="_blank">what I did in week 2</a>, it addresses the issue of testing randomized algorithms ( which is still being discussed <a href="https://groups.google.com/forum/?fromgroups#!topic/sympy/2el1T0ZY-Z4" target="_blank">here</a> ), and splits the generators for the named groups (symmetric, dihedral,&#8230;) in a separate file (which is probably going to contain more and more constructors for some well-known groups as time goes by). The PR looks longer than it is ( : ) read: any help in the review process will be appreciated), mainly because some 250 lines were copied to a new file in order to accommodate the named groups module. I hope that this time I did a better job at splitting the different parts of the PR into several commits.</li>
<li>Finally, I started work on algorithms for backtrack searches in groups. These include stuff like printing all group elements (sort of boring, but you have to start somewhere), searching for subgroups of elements satisfying a given property, finding normalizers and centralizers,  intersection of subgroups,&#8230; In general, backtrack searches tend to be slow since all the elements in the group have to be visited, but there are ways of skipping large numbers of them. Also, for some problems in computational group theory, backtrack searches are the best we have today. They are described in [1], 4.6., and I&#8217;m currently following the exposition offered there. After two days of debugging, I finally got the function PRINTELEMENTS described in 4.6.1 of [1] to work; it turned out that the current implementation of the Schreier-Sims algorithm sets the field _coset_repr of an object of class PermutationGroup in sympy.combinatorics.perm_groups.py in a way that was unexpected to me. This little digression might help anyone else trying to understand the perm_groups file better. So for example consider the following:</li>
</ul>
<pre class="brush: python; title: ; notranslate">

In [297]: S = SymmetricGroup(4)

In [298]: S.schreier_sims()

In [299]: S._coset_repr
Out[299]:
[[[0, 1, 2, 3], [1, 2, 3, 0], [2, 3, 0, 1], [3, 0, 1, 2]],
[[0, 1, 2, 3], [0, 2, 1, 3], [0, 3, 1, 2]],
[[0, 1, 2, 3], [0, 1, 3, 2]]]
 
 In [300]: S._base
Out[300]: [0, 1, 2]

</pre>
<p>From this and similar examples I concluded that the i-th component of _coset_repr is a transversal of the i-th basic orbit of the group S and tried to use this in PRINTELEMENTS. However, consired the following example:</p>
<pre class="brush: python; title: ; notranslate">

In [302]: G = PermutationGroup([Permutation([[0, 1, 2, 3], [4], [5]]), Permutation([[1, 3], [0], [2], [4], [5]]), Permutation([[0], [1], [2], [3], [4, 5]])])

In [303]: G.schreier_sims()

In [304]: G._base
 Out[304]: [0, 1, 4]

In [305]: G._coset_repr
 Out[305]:
 [[[0, 1, 2, 3, 4, 5],
 [1, 2, 3, 0, 4, 5],
 [2, 3, 0, 1, 4, 5],
 [3, 0, 1, 2, 4, 5]],
 [[0, 1, 2, 3, 4, 5], [0, 3, 2, 1, 4, 5]],
 [[0, 1, 2, 3, 4, 5]],
 [[0, 1, 2, 3, 4, 5]],
 [[0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 5, 4]]]

</pre>
<p>Here, the first two components of _coset_repr are as I expected, but the 3rd and 4th are something I didn&#8217;t expect to be there (I expected to get the 5th component instead of the 3rd, and no more components). Hence at present the behaviour of _coset_repr is not too clear to me. The current solution is to use the randomized version of the Schreier-Sims algorithm to get a base and a strong generating set. Another option would be to use the generators from the attribute _stabilizers_gens, but I haven&#8217;t tried that yet. Anyway, PRINTELEMENTS works now (edit: there are many other algorithms present for printing all the elements of a group, but this one is significant for the implementation of backtrack searches), and the order in which the elements of the group are visited (lexicographically with respect to the image of the base, in an ordering of <img src='http://s0.wp.com/latex.php?latex=%5COmega+%3D+%5C%7B0%2C+1%2C%5Cldots%2C+n-1%5C%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='&#92;Omega = &#92;{0, 1,&#92;ldots, n-1&#92;}' title='&#92;Omega = &#92;{0, 1,&#92;ldots, n-1&#92;}' class='latex' /> in which base points come first) is used in most of the following backtrack searches, so a large part of this algorithm will be reused in subsequent algorithms ( I hope : ) ). My description of the situation assumed some knowledge of the theory behind the Schreier-Sims algorithm, so if something is not quite clear feel free to ask in the comments!</p>
<p>That&#8217;s it for now. Next week, I&#8217;ll continue with backtrack searches, and hopefully will implement the subgroup intersection routine (it seems formidable right now)&#8230; and put some more effort into getting the second pull request merged &#8211; I&#8217;ve got a lot to catch up with in terms of getting my code in sympy : ) .</p>
<p>[1] Derek F. Holt, Bettina Eick, Bettina, Eamonn A. O’Brien, “Handbook of computational group theory”, Discrete Mathematics and its Applications (Boca Raton). Chapman &amp; Hall/CRC, Boca Raton, FL, 2005. ISBN 1-58488-372-3</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amakelov.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amakelov.wordpress.com/147/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=147&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amakelov.wordpress.com/2012/06/24/google-summer-of-code-2012-week-5/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d10599ccc7ab7986bfc049cbbf565950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amakelov</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Summer of Code 2012: Week 4</title>
		<link>http://amakelov.wordpress.com/2012/06/18/google-summer-of-code-2012-week-4/</link>
		<comments>http://amakelov.wordpress.com/2012/06/18/google-summer-of-code-2012-week-4/#comments</comments>
		<pubDate>Mon, 18 Jun 2012 00:30:18 +0000</pubDate>
		<dc:creator>Александър Макелов</dc:creator>
				<category><![CDATA[Google Summer of Code 2012]]></category>

		<guid isPermaLink="false">http://amakelov.wordpress.com/?p=130</guid>
		<description><![CDATA[Hi everyone, Here&#8217;s a brief summary of what I&#8217;ve been doing for the 4-th week of my GSoC. This week, like the previous one, was not intense in terms of coding. Here&#8217;s what I have up and running, basically what I was talking about last week: A working implementation of the randomized Schreier-Sims algorithm. This [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=130&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi everyone,</p>
<p>Here&#8217;s a brief summary of what I&#8217;ve been doing for the 4-th week of my GSoC.</p>
<p>This week, like the previous one, was not intense in terms of coding. Here&#8217;s what I have up and running, basically what I was talking about last week:</p>
<ul>
<li>A working implementation of the randomized Schreier-Sims algorithm. This still needs to be integrated with the deterministic version of the algorithm, using the fields  _base, _coset_repr, _coset_repr_n, stabilizers_gens so that a result from the randomized algorithm can be verified deterministically. Also, it&#8217;s been <a href="http://amakelov.wordpress.com/2012/06/10/google-summer-of-code-2012-week-3/#comments" target="_blank">suggested </a>that we have a function that determines the base and transversal elements for the basic orbits by a given generating set that is known to be strong. This won&#8217;t be hard to implement, and will be helpful for the Butler-Portugal algorithm for tensor canonicalization &#8211; see <a href="https://github.com/sympy/sympy/pull/1326#issuecomment-6236332" target="_blank">this</a> pull request for more information if you are interested! For more on bases and strong generating sets, see [1], pp.101-119</li>
<li>A function <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BDirectProduct%28%2Agroups%29%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='&#92;text{DirectProduct(*groups)}' title='&#92;text{DirectProduct(*groups)}' class='latex' /> that constructs the direct product of several groups. For more than two groups, <img src='http://s0.wp.com/latex.php?latex=%5Ctext%7BDirectProduct%7D%28G_1%2C%5Cldots%2C+G_n%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='&#92;text{DirectProduct}(G_1,&#92;ldots, G_n)' title='&#92;text{DirectProduct}(G_1,&#92;ldots, G_n)' class='latex' /> is several times faster than calling <img src='http://s0.wp.com/latex.php?latex=G_1%2A%5Cldots+%2A+G_n&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='G_1*&#92;ldots * G_n' title='G_1*&#92;ldots * G_n' class='latex' /> (benchmarked it), thus it makes sense to have such a function. This is later used in constructing an arbitrary abelian group by its cycle decomposition.</li>
<li>A function for calculating the degree of transitivity of a permutation group. The idea is very brute-force: we look at the orbit of a <img src='http://s0.wp.com/latex.php?latex=k%2B1&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='k+1' title='k+1' class='latex' />-tuple <img src='http://s0.wp.com/latex.php?latex=%280%2C+1%2C+%5Cldots%2C+k%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='(0, 1, &#92;ldots, k)' title='(0, 1, &#92;ldots, k)' class='latex' /> for <img src='http://s0.wp.com/latex.php?latex=k+%3D+0%2C+1%2C+%5Cldots%2C+n-1&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='k = 0, 1, &#92;ldots, n-1' title='k = 0, 1, &#92;ldots, n-1' class='latex' /> and check if it spans all possible <img src='http://s0.wp.com/latex.php?latex=k%2B1&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='k+1' title='k+1' class='latex' />-tuples. This is really bad since the number of tuples is growing like <img src='http://s0.wp.com/latex.php?latex=n%5E%7Bk%2B1%7D&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='n^{k+1}' title='n^{k+1}' class='latex' />, hence the complexity is <img src='http://s0.wp.com/latex.php?latex=O%28n%5E%7Bk%2B1%7Dr%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='O(n^{k+1}r)' title='O(n^{k+1}r)' class='latex' /> where <img src='http://s0.wp.com/latex.php?latex=k&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='k' title='k' class='latex' /> is the degree of transitivity, <img src='http://s0.wp.com/latex.php?latex=r&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='r' title='r' class='latex' /> is the number of generators. It seems that some sort of randomization that checks only several randomly chosen tuples for membership in the orbit will decrease the complexity, but to make sure we still need to do all the checks if the random tuples pass, which is again <img src='http://s0.wp.com/latex.php?latex=O%28n%5E%7Bk%2B1%7Dr%29&amp;bg=ffffff&amp;fg=4b5d67&amp;s=0' alt='O(n^{k+1}r)' title='O(n^{k+1}r)' class='latex' />. Some bound on the probability will be good to know here.</li>
</ul>
<p>The main focus this week was on several discussions about future changes in the permutation groups module, and on making some more effort to get my code so far merged <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  :</p>
<ul>
<li>In <a href="https://groups.google.com/forum/?fromgroups#!topic/sympy/dpeN1Z9pf9c" target="_blank">this</a> post to the mailing list, it was suggested to implement an algorithm for intersecting subgroups of a given group so that it can be used in the tensor canonicalization algorithm (again, see <a href="https://github.com/sympy/sympy/pull/1326#issuecomment-6236332" target="_blank">here</a>). This is done in [1] but seems fairly complicated and opens the subject of backtrack searches in permutation groups; I&#8217;ll try to figure it out and implement it this coming week.</li>
<li>In <a href="https://groups.google.com/forum/?fromgroups#!topic/sympy/2el1T0ZY-Z4" target="_blank">this</a> post to the mailing list, we discussed ways of testing randomized algorithms (and there are a lot of them involved in computational group theory), and an agreement was reached that some sort of manual setting of the randomized output (via an additional argument) is a sensible approach.</li>
<li>In <a href="https://groups.google.com/forum/?fromgroups#!topic/sympy/xRXpKZuvpzg" target="_blank">this</a> post to the mailing list, we discussed some changes in interface in the permutations module. Even though not everybody agrees with what I last suggested, I&#8217;ll carry these changes out and see how things unfold (i.e., whether people are happy)</li>
<li>Finally, my work from week 1 is, I hope, ready to be merged, now that I&#8217;ve made the changes suggested in the discussion of the <a href="https://github.com/sympy/sympy/pull/1319" target="_blank">pull request</a> . I (finally) got familiar with the sphinx system and building the docs for sympy, and with all the conventions for writing docstrings (and convinced myself that I&#8217;ve been writing them the wrong way, I&#8217;ll fix all the docstrings in the module in the future). By the way, I installed the sphinx system in a virtualenv at the suggestion of S. Krastanov, and found the following <a href="http://iamzed.com/2009/05/07/a-primer-on-virtualenv/" target="_blank">guide </a>really helpful in the process. When the week1 branch gets merged, a pull request with the week2 code will follow shortly, and then with the rest of the code so far&#8230;</li>
<li>And in <a href="https://groups.google.com/forum/?fromgroups#!topic/sympy/bc2viXVsVmU" target="_blank">this </a>discussion, there were some more changes suggested, for example David proposed isolating the named groups (Symmetric, Dihedral, &#8230;) in a separate module, which I&#8217;m going to do in one of the next pull requests.</li>
</ul>
<p>So, that&#8217;s it for now. Next week I&#8217;ll focus on getting some more of my code merged and backtrack searches.</p>
<p>[1] Holt, D., Eick, B., O&#8217;Brien, E. &#8220;Handbook of computational group theory&#8221;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amakelov.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amakelov.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amakelov.wordpress.com&#038;blog=35896871&#038;post=130&#038;subd=amakelov&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://amakelov.wordpress.com/2012/06/18/google-summer-of-code-2012-week-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d10599ccc7ab7986bfc049cbbf565950?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">amakelov</media:title>
		</media:content>
	</item>
	</channel>
</rss>
