<?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>nessgrh</title>
	<atom:link href="http://nessgrh.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nessgrh.wordpress.com</link>
	<description>My GSoC Project</description>
	<lastBuildDate>Fri, 12 Aug 2011 18:22:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nessgrh.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>nessgrh</title>
		<link>http://nessgrh.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nessgrh.wordpress.com/osd.xml" title="nessgrh" />
	<atom:link rel='hub' href='http://nessgrh.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Last Status Update (Probably)</title>
		<link>http://nessgrh.wordpress.com/2011/08/12/last-status-update-probably/</link>
		<comments>http://nessgrh.wordpress.com/2011/08/12/last-status-update-probably/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 18:22:27 +0000</pubDate>
		<dc:creator>nessgrh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nessgrh.wordpress.com/?p=366</guid>
		<description><![CDATA[Time flies by … I feel like I just started hyperexpand() yesterday (not quite actually; but you get the idea *g*). I&#8217;ve been moving around this week, so I wasn&#8217;t terribly productive so far. I did, however, compute (reasonably) neat representations for all the in the hyperexpand() table. These examples demonstrate the kind of neat [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=366&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Time flies by … I feel like I just started hyperexpand() yesterday (not quite actually; but you get the idea *g*). I&#8217;ve been moving around this week, so I wasn&#8217;t terribly productive so far. I did, however, compute (reasonably) neat representations for all the <img src='http://s0.wp.com/latex.php?latex=%7B%7D_pF_%7Bp-1%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='{}_pF_{p-1}' title='{}_pF_{p-1}' class='latex' /> in the hyperexpand() table. These <a href="http://pastebin.com/raw.php?i=fv9BNEMe">examples</a> demonstrate the kind of neat answers this can yield (compare to some of the examples from last week) [actually the tables contain some much more complicated functions, but I was not yet able to come up with interesting integrals that yield these answers *g*].</p>
<p>My final plan, beyond mere cleanup and bugfixing, is to do something along the way of simplifying convergence conditions. This won&#8217;t be anything fancy (I&#8217;m thinking of peep-hole optimisation); my goal is to make mess like the <a href="http://pastebin.com/raw.php?i=dYdgefP9">following</a> somewhat less horrific. I hope to have a final pull request ready by sunday night. Then I will finally slow down and relax; work towards merging my branches; perhaps review some other GSOC pull requests.</p>
<p>Quite a summer.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nessgrh.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nessgrh.wordpress.com/366/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=366&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nessgrh.wordpress.com/2011/08/12/last-status-update-probably/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19a106c007b937829625d57470b0c19c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nessgrh</media:title>
		</media:content>
	</item>
		<item>
		<title>Branching, Once More</title>
		<link>http://nessgrh.wordpress.com/2011/08/06/branching-once-more/</link>
		<comments>http://nessgrh.wordpress.com/2011/08/06/branching-once-more/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 19:32:42 +0000</pubDate>
		<dc:creator>nessgrh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nessgrh.wordpress.com/?p=355</guid>
		<description><![CDATA[As usual with my &#8220;out-of-line&#8221; posts, this one is again mostly to clear my own thoughts. It seeks to address the problem of how to get out &#8220;nice&#8221; answers, in the sense of e.g. finding a representation that is manifestly real (say to use inverse trig functions instead of logarithms with imaginary arguments). This turns [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=355&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>As usual with my &#8220;out-of-line&#8221; posts, this one is again mostly to clear my own thoughts. It seeks to address the problem of how to get out &#8220;nice&#8221; answers, in the sense of e.g. finding a representation that is manifestly real (say to use inverse trig functions instead of logarithms with imaginary arguments). This turns out to be fairly delicate; let me explain why. Recall that when the code returns an expression like <img src='http://s0.wp.com/latex.php?latex=%5Csqrt%7B1+%2B+e%5E%7B-i+%5Cpi%7D+z%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;sqrt{1 + e^{-i &#92;pi} z}' title='&#92;sqrt{1 + e^{-i &#92;pi} z}' class='latex' />, we really mean a certain function on the riemann surface of the logarithm which we try to crudely express above. First of all, it is clear that if we want neat answers, we cannot just return this expression as stated. This is because the square-root function <em>per se</em> has lots of meanings, whereas we attach here a <em>very</em> specific meaning to it. There is no realiable way to recognise and transform such expressions later. So we really should return a new function object &#8220;MySqrt(z)&#8221; which has well-defined meaning for all polar <img src='http://s0.wp.com/latex.php?latex=z&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='z' title='z' class='latex' />, and which can convert itself into a nice representation. The trouble is now that we have to very carefully <em>define</em> MySqrt(z) for all polar <img src='http://s0.wp.com/latex.php?latex=z&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='z' title='z' class='latex' />, in such a way that all slater-expansions are correct. It is not (to me) immediately obvious that this is even possible (although it will turn out it is); note in particular that this function will necessarily be discontinuous. The first problem to solve then is how to deal with hypergeometric and meijer g-functions branched at other points than zero and infinity. After that we need to find a way to display things nicely.</p>
<h2>Branching at +-1</h2>
<p>We have the following facts about <img src='http://s0.wp.com/latex.php?latex=%7B%7D_pF_q%28z%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='{}_pF_q(z)' title='{}_pF_q(z)' class='latex' />:</p>
<ul>
<li>unbranched if <img src='http://s0.wp.com/latex.php?latex=p+%5Cle+q&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='p &#92;le q' title='p &#92;le q' class='latex' /></li>
<li>branched at <img src='http://s0.wp.com/latex.php?latex=%2B1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='+1' title='+1' class='latex' /> if <img src='http://s0.wp.com/latex.php?latex=p+%3D+q+%2B+1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='p = q + 1' title='p = q + 1' class='latex' /></li>
</ul>
<p>And we have the following facts about <img src='http://s0.wp.com/latex.php?latex=G_%7Bp%2Cq%7D%5E%7Bm%2Cn%7D%28z%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='G_{p,q}^{m,n}(z)' title='G_{p,q}^{m,n}(z)' class='latex' />:</p>
<ul>
<li>usually branched at <img src='http://s0.wp.com/latex.php?latex=0%2C+%5Cinfty&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='0, &#92;infty' title='0, &#92;infty' class='latex' /></li>
<li>unbranched at <img src='http://s0.wp.com/latex.php?latex=%2B1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='+1' title='+1' class='latex' /> if <img src='http://s0.wp.com/latex.php?latex=%5Cdelta+%3D+p+%2B+q+-+%28m+%2B+n%29%2F2+%3E+0&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;delta = p + q - (m + n)/2 &gt; 0' title='&#92;delta = p + q - (m + n)/2 &gt; 0' class='latex' />; in this case it is even analytic in a neighborhood of the positive reals</li>
<li>if <img src='http://s0.wp.com/latex.php?latex=p+%3D+q&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='p = q' title='p = q' class='latex' />, branched at <img src='http://s0.wp.com/latex.php?latex=%28-1%29%5E%7Bp+-+m+-+n%7D+%3D+%28-1%29%5E%7Bq+-+m+-+n%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='(-1)^{p - m - n} = (-1)^{q - m - n}' title='(-1)^{p - m - n} = (-1)^{q - m - n}' class='latex' /></li>
<li>always has a polar lift that is continuous on &#8220;circles&#8221; (spirals) of radius not equal to one</li>
</ul>
<p>Notice further that the Slater theorem (or a generalisation) can be used to come up with a nice (single) answer if <img src='http://s0.wp.com/latex.php?latex=%5Cdelta+%3E+0&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;delta &gt; 0' title='&#92;delta &gt; 0' class='latex' />. We thus assume now that <img src='http://s0.wp.com/latex.php?latex=p+%3D+q&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='p = q' title='p = q' class='latex' /> (so there is a problematic branch point) and <img src='http://s0.wp.com/latex.php?latex=%5Cdelta+%3E+0&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;delta &gt; 0' title='&#92;delta &gt; 0' class='latex' /> (so that we need to define the lift of the hypergeometric functions involved), and that a version of the slater theorem applies (else there is no work to do at all). As always, we let <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' /> be the riemann surface of the logarithm, we understand <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='G' title='G' class='latex' /> to be defined thereon (although it is not continuous).</p>
<p>We immediately find that <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='G' title='G' class='latex' /> is branched at <img src='http://s0.wp.com/latex.php?latex=-1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='-1' title='-1' class='latex' />, thus <img src='http://s0.wp.com/latex.php?latex=G&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='G' title='G' class='latex' /> can be expressed as a sum of hypergeometric functions of argument <img src='http://s0.wp.com/latex.php?latex=-z&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='-z' title='-z' class='latex' /> or <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7B-1%7D%7Bz%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;frac{-1}{z}' title='&#92;frac{-1}{z}' class='latex' />. Now given a hypergeometric function <img src='http://s0.wp.com/latex.php?latex=%7B%7D_pF_%7Bp-1%7D%3A+D+%5Crightarrow+%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='{}_pF_{p-1}: D &#92;rightarrow &#92;mathbb{C}' title='{}_pF_{p-1}: D &#92;rightarrow &#92;mathbb{C}' class='latex' /> (where <img src='http://s0.wp.com/latex.php?latex=D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='D' title='D' class='latex' /> is the unit disc, the region of convergence of the power series representation), we wish to define a lift <img src='http://s0.wp.com/latex.php?latex=%7B%7D_pF_%7Bp-1%7D%3A+%5Cmathcal%7BS%7D+%5Crightarrow+%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='{}_pF_{p-1}: &#92;mathcal{S} &#92;rightarrow &#92;mathbb{C}' title='{}_pF_{p-1}: &#92;mathcal{S} &#92;rightarrow &#92;mathbb{C}' class='latex' /> which makes all slater-expansions valid for all polar <img src='http://s0.wp.com/latex.php?latex=z&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='z' title='z' class='latex' /> (even though they were initially only valid for <img src='http://s0.wp.com/latex.php?latex=%7Cz%7C+%3C+1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='|z| &lt; 1' title='|z| &lt; 1' class='latex' />). Indeed I claim that there exists a <em>unique</em> <img src='http://s0.wp.com/latex.php?latex=f%28z%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='f(z)' title='f(z)' class='latex' /> lift satisfying the following list of properties:</p>
<ul>
<li><img src='http://s0.wp.com/latex.php?latex=f&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='f' title='f' class='latex' /> is defined on <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D+%5Csetminus+%5C%7Be%5E%7Bi+t%7D+%7C+t+%5Cin+%5Cmathbb%7BR%7D%5C%7D+%5Ccup+%5C%7Be%5E%7Bi+t%7D%2C+t+%5Cin+%280%2C+2%5Cpi%29%5C%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S} &#92;setminus &#92;{e^{i t} | t &#92;in &#92;mathbb{R}&#92;} &#92;cup &#92;{e^{i t}, t &#92;in (0, 2&#92;pi)&#92;}' title='&#92;mathcal{S} &#92;setminus &#92;{e^{i t} | t &#92;in &#92;mathbb{R}&#92;} &#92;cup &#92;{e^{i t}, t &#92;in (0, 2&#92;pi)&#92;}' class='latex' /></li>
<li>if <img src='http://s0.wp.com/latex.php?latex=%7B%7D_pF_q&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='{}_pF_q' title='{}_pF_q' class='latex' /> does not have a pole at <img src='http://s0.wp.com/latex.php?latex=1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='1' title='1' class='latex' />, then <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='f' title='f' class='latex' /> is additionally defined on <img src='http://s0.wp.com/latex.php?latex=e%5E0%2C+e%5E%7B2+%5Cpi+i%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='e^0, e^{2 &#92;pi i}' title='e^0, e^{2 &#92;pi i}' class='latex' /></li>
<li><img src='http://s0.wp.com/latex.php?latex=f&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='f' title='f' class='latex' /> is locally analytic (that is, if <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='f' title='f' class='latex' /> is defined at <img src='http://s0.wp.com/latex.php?latex=z_0&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='z_0' title='z_0' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=U&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='U' title='U' class='latex' /> is an open neighbourhood of <img src='http://s0.wp.com/latex.php?latex=z_0&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='z_0' title='z_0' class='latex' /> on which <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='f' title='f' class='latex' /> is defined, then <img src='http://s0.wp.com/latex.php?latex=f&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='f' title='f' class='latex' /> is analytic on <img src='http://s0.wp.com/latex.php?latex=U&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='U' title='U' class='latex' />)</li>
<li><img src='http://s0.wp.com/latex.php?latex=f&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='f' title='f' class='latex' /> <em>is</em> a lift, i.e. if <img src='http://s0.wp.com/latex.php?latex=p%3A%5Cmathcal%7BS%7D+%5Crightarrow+%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='p:&#92;mathcal{S} &#92;rightarrow &#92;mathbb{C}' title='p:&#92;mathcal{S} &#92;rightarrow &#92;mathbb{C}' class='latex' /> denotes the usual projection, then for all <img src='http://s0.wp.com/latex.php?latex=z+%5Cin+p%5E%7B-1%7D%28D%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='z &#92;in p^{-1}(D)' title='z &#92;in p^{-1}(D)' class='latex' /> we have <img src='http://s0.wp.com/latex.php?latex=f%28z%29+%3D+%7B%7D_pF_q%28p%28z%29%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='f(z) = {}_pF_q(p(z))' title='f(z) = {}_pF_q(p(z))' class='latex' />.</li>
</ul>
<p>Such a function has, in particular, the following properties:</p>
<ul>
<li><img src='http://s0.wp.com/latex.php?latex=f&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='f' title='f' class='latex' /> is continuous along the ray <img src='http://s0.wp.com/latex.php?latex=r+e%5E%7Bi%5Cpi%7D%2C+r+%3E+0&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='r e^{i&#92;pi}, r &gt; 0' title='r e^{i&#92;pi}, r &gt; 0' class='latex' /></li>
<li>it is continuous on &#8220;circles&#8221; (spirals)</li>
</ul>
<p>From this it is easy to prove that if in all slater expansions the hypergeometric functions have argument <img src='http://s0.wp.com/latex.php?latex=e%5E%7Bi+%5Cpi%7Dz&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='e^{i &#92;pi}z' title='e^{i &#92;pi}z' class='latex' />, then with the above lift the slater expansion holds for all polar <img src='http://s0.wp.com/latex.php?latex=z&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='z' title='z' class='latex' />.</p>
<h2>Finding nice representations</h2>
<p>My idea is to create new objects to represent above-defined polar lifts, a la &#8220;MySqrt(z)&#8221;. hyperexpand() will work exclusively with these, except that in the end it (optionally) calls &#8220;rewrite(&#8216;elementary&#8217;)&#8221;. The object then attempts to determine a &#8220;nice&#8221; representation (where what that means is up to the object, of course). I now have to sit down and compute said representations, and come up with a good way to test them. Sounds like a final project.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nessgrh.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nessgrh.wordpress.com/355/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=355&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nessgrh.wordpress.com/2011/08/06/branching-once-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19a106c007b937829625d57470b0c19c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nessgrh</media:title>
		</media:content>
	</item>
		<item>
		<title>Status Update—Week 11</title>
		<link>http://nessgrh.wordpress.com/2011/08/05/status-update%e2%80%94week-11/</link>
		<comments>http://nessgrh.wordpress.com/2011/08/05/status-update%e2%80%94week-11/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 22:08:31 +0000</pubDate>
		<dc:creator>nessgrh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nessgrh.wordpress.com/?p=351</guid>
		<description><![CDATA[The end of GSOC is rapidly approaching, so this was one further busy week. Here is what I did: Fix some bugs in meijerint, uncovered by statistical integrals, Optimise meijerint and hyperexpand, Implement exponential integrals. Before I go into details, let me stake out a final list of things I hope to do before the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=351&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The end of GSOC is rapidly approaching, so this was one further busy week. Here is what I did:</p>
<ul>
<li>Fix some bugs in meijerint, uncovered by statistical integrals,</li>
<li>Optimise meijerint and hyperexpand,</li>
<li>Implement exponential integrals.</li>
</ul>
<p>Before I go into details, let me stake out a final list of things I hope to do before the end of summer:</p>
<ol>
<li>Fix a test failure in meijerint. (explained below)</li>
<li>Think about branching again. In particular, investigate how we can come up with &#8220;nice&#8221; answers.</li>
<li>Investigate why hyperexpand results are sometimes ridiculously complicated.</li>
</ol>
<p>Let&#8217;s now turn to what I did. First Matthew reported some bugs in my integration code, mostly related to how real variables are converted into polar ones (that is, they were not, which is wrong). I took the opportunity to test lots of integrals that seemed to be important for statistics, e.g. <a href="http://pastebin.com/raw.php?i=WRyYNrFr">these</a>, computing various moments of the normal, exponential and chi-squared distributions.</p>
<p>Then I started to optimise my code. First I created a script (sympy/benchmark/bench_meijerint.py) which basically times all the individual integrals from the tests. This allowed me to quickly isolate biggest performance problems. <a href="http://pastebin.com/raw.php?i=ZSQb4GfZ">This</a> is the output of the first run, and <a href="http://pastebin.com/raw.php?i=XrDDQf8Y">this</a> is the output with my new optimisations. Let me go through the first few entries on both lists.</p>
<ul>
<li>
<pre>LT((t-apos)**bpos*exp(-cpos*(t-apos))*Heaviside(t-apos), t, s)</pre>
<p>This was my biggest worry, for two reasons. Firstly it seems fairly common—this is just a very basic laplace transform (though with many parameters). Second it is surprisingly hard—in order to do it, the algorithm has to expand the exponential, then bracket the two exponentials as G1, and the rest as G2. However, it turns out that a few tweaks allow us to recognise fairly quickly that the integral won&#8217;t be doable without expansion (because <img src='http://s0.wp.com/latex.php?latex=e%5E%7Bc%2At+%2B+d%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='e^{c*t + d}' title='e^{c*t + d}' class='latex' /> is not in the tables), and then a few improvements to the heuristics make us try things in a reasonable order. Thus this laplace transform is comfortably down in the second list; from 4.8 to 0.5 seconds.</li>
<li>
<pre>MT(bessely(a, sqrt(x))**2, x, s)</pre>
<p>and similar mellin transforms involving bessel functions or logarithms are slow for three reasons: (1) Hyperexpand(), is fairly slow to realise that a certain expansion <em>cannot</em> be done. This means that any &#8220;mis-step&#8221; the algorithm does is quite costly. (2) there tend to be confluent g-functions involved, for which we need series expansions (for computing residues), and these are slow. (3) Combsimp used to be slow. I improved combsimp, and I rewrote the residue function to use series expansions a bit more cleverly. I also improved hyperexpand a bit; the results are fairly noticable, but not as satisfying as for the laplace transform.</li>
<li>
<pre>E((x+y-1)**2)</pre>
<p>This computes a certain statistical double integral in two ways, and it is not actually that slow. By my calculation the code winds up doing about 40 integrals (splitting integrals along the real line into two patrs, expanding the binomial, doing a double integral in two steps, and finally doing it all over again the other way round), putting the time for every single integral well into a sensible range.</li>
</ul>
<p>I should mention that during this optimisations the path taken by meijerint was changed slightly, causing a test failure in test_meijerint which is actually fairly difficult to correct. So much for robust code&#8230;</p>
<p>Finally I implemented exponential integrals. This was quite good fun; let&#8217;s just look at a few <a href="http://pastebin.com/raw.php?i=1Lm7nmC4">examples</a>. A few things can be said here. The answers are sometimes messy; often expand() already yields a lot of cancellation. The noticable exception is the integral representation of the generalised exponential integral with two parameters, here more tricks are necessary (but I don&#8217;t really think there is any way to know in advance that expressing everything in terms of expint yields such a nice answer, short from recognising the integral). At one stage I&#8217;m using a polar variable, this is to allow <img src='http://s0.wp.com/latex.php?latex=%5Clog%28u%5E2%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;log(u^2)' title='&#92;log(u^2)' class='latex' /> to expand (alternatively one could safely use force here). The laplace transforms are a nice example where answers come out much messier than they have to (the other exponential integrals are mostly as bad es Si, noticable exception being e1). Some of the definite integrals illustrate a similar problem.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nessgrh.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nessgrh.wordpress.com/351/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=351&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nessgrh.wordpress.com/2011/08/05/status-update%e2%80%94week-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19a106c007b937829625d57470b0c19c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nessgrh</media:title>
		</media:content>
	</item>
		<item>
		<title>Status Update—Week 10</title>
		<link>http://nessgrh.wordpress.com/2011/07/28/status-update%e2%80%94week-10/</link>
		<comments>http://nessgrh.wordpress.com/2011/07/28/status-update%e2%80%94week-10/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 21:38:29 +0000</pubDate>
		<dc:creator>nessgrh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nessgrh.wordpress.com/?p=347</guid>
		<description><![CDATA[This is a little earlier than my usual status update, but I think now is a good time. I just commited some new code, and many new interesting things work now, hence it is a good time to show off . On the other hand there a quite a number of bugs in my code, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=347&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This is a little earlier than my usual status update, but I think now is a good time. I just commited some new code, and many new interesting things work now, hence it is a good time to show off <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . On the other hand there a quite a number of bugs in my code, so that&#8217;s probably what I will be spending next week on&#8230;</p>
<p>Anyway. First I added lerch phi to hyperexpand. Here are a few <a href="http://pastebin.com/raw.php?i=FkYNdpTN">examples</a>. There is not a lot to be said here, but it is good to see many common sums to work now.</p>
<p>Next I improved hyperexpand() to handle some expansions at &#8220;special points&#8221;. This means evaluating hypergeometric (or meijer g) functions at say <img src='http://s0.wp.com/latex.php?latex=z%3D1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='z=1' title='z=1' class='latex' />, even if we don&#8217;t know any closed-form expressions for general <img src='http://s0.wp.com/latex.php?latex=z&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='z' title='z' class='latex' />. There is  a vast literature on such &#8220;hypergeometric identities&#8221;, and my code is a very humble start at best. It basically just implements Gauss&#8217; and Kummer&#8217;s summation theorems for 2F1 and nothing else, but this is fairly effective. Then I improved one of the convergence conditions—it turns out that in addition to what is listed on the wolfram functions site, in the russian book from which they took the conditions there is a crucial extra part. After finding someone to translate it to me I could implement this; now we can do some more integrals. The upshot of this is that the mellin transform of a product of bessel functions can now be <em>derived</em> by the code, instead of having to put it into the table.</p>
<p>Let me put this into perspective. There are (at least) the functions <img src='http://s0.wp.com/latex.php?latex=J%2C+Y%2C+I%2C+K&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='J, Y, I, K' title='J, Y, I, K' class='latex' />. The general products <img src='http://s0.wp.com/latex.php?latex=J_a+J_b%2C+Y_a+Y_b%2C+J_a+Y_b&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='J_a J_b, Y_a Y_b, J_a Y_b' title='J_a J_b, Y_a Y_b, J_a Y_b' class='latex' /> can be exrpessed as g-functions, and similarly for <img src='http://s0.wp.com/latex.php?latex=I%2C+K&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='I, K' title='I, K' class='latex' />. Also many special products can be expressed. I had previously put in a few of the identities of the first kind. Now almost all of them can be derived from just the entries for single functions. (There are some problems with functions of the second kind, which tend to be singular and/or rapidly growing, so that they don&#8217;t really have mellin transforms; deriving formulae for these is difficult in the current setup). On the other hand, this can be somewhat slow; for this reason I only commented out the formulae instead of removing them. Here are a few <a href="http://pastebin.com/raw.php?i=f65MmSTU">timings</a>. These are evidently not great, I&#8217;ll have to see what can be done. My guess is that hyperexpand() is relatively slow, but I haven&#8217;t looked into this further. [Note also that running this with cache off is much slower, since the algorithm internally uses caching.]</p>
<p>Finally, I improved the integration heuristics so as to be able to do some more <a href="http://pastebin.com/raw.php?i=sbN8dQYA">integrals</a> [with a few additional factors the last integral is a representation of besselj]. Again I don&#8217;t know what makes this so slow.</p>
<p>In closing, let&#8217;s look at some more fun definite <a href="http://pastebin.com/raw.php?i=UVYgPFpB">integrals</a> (all played around with long enough until I found a variation that can be done in closed form <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ). Again not much to say here (except that (9) shows a bug in the hyperepand table, the minus sign must be <img src='http://s0.wp.com/latex.php?latex=e%5E%7B-i%5Cpi%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='e^{-i&#92;pi}' title='e^{-i&#92;pi}' class='latex' />); the numerical computations are for comparison with wolfram alpha.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nessgrh.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nessgrh.wordpress.com/347/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=347&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nessgrh.wordpress.com/2011/07/28/status-update%e2%80%94week-10/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19a106c007b937829625d57470b0c19c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nessgrh</media:title>
		</media:content>
	</item>
		<item>
		<title>Status Update—Week 9</title>
		<link>http://nessgrh.wordpress.com/2011/07/22/status-update%e2%80%94week-9/</link>
		<comments>http://nessgrh.wordpress.com/2011/07/22/status-update%e2%80%94week-9/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 22:08:02 +0000</pubDate>
		<dc:creator>nessgrh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nessgrh.wordpress.com/?p=343</guid>
		<description><![CDATA[This was one busy week again. I implemented polar numbers and changed over the integration and hyperexpand code to use them. This was more painful than I thought, but it seems to work now. Indeed the problems I mentioned before (other than matching) are gone now, as are the hacks. After this I cleaned up [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=343&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This was one busy week again. I implemented polar numbers and changed over the integration and hyperexpand code to use them. This was more painful than I thought, but it seems to work now. Indeed the problems I mentioned before (other than matching) are gone now, as are the hacks. After this I cleaned up my branch to such an extent that I considered it ready for review. There are still some minor issues regarding numerical evaluation that I&#8217;m working to sort out, but this shouldn&#8217;t affect the review much.</p>
<p>Then I started working on adding lerchphi and polylogarithms to sympy. The goal of this is to incorporate them into hyperexpand(), so that a few more interesting series can be summed. This is good fun. Here are a few <a href="http://pastebin.com/raw.php?i=bjrqW8Hp">exampes</a>. As you can see, all the standard things that one expects to work do work. And expand_func() can be used to reduce lerchphi to polylogarithms. In fact it can also reduce to hurwitz zeta functions in some cases but that is a <a href="http://pastebin.com/raw.php?i=aeyYzhmK">mess</a>. However, it is correct (tested numerically) and in a specific sense even simpler. In any case it&#8217;s nice to have it, even if it is not used much <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p>I also started extending hyperexpand to recognise lerch phi &#8230; this is slightly non-trivial (compared to normal table extensions) because lerch phi is actually not hypergeometric unless the parameter s is an integer, and even then the number of parameters of the hypergeometric function depends on s. Thus we need a special function to recognise such hypergeometric functions and generate formulae on the fly, this is what I am working on now. It will be finished on monday (so I have something cool to show off next week again *g*).</p>
<p>Finally it turns out that there are some subtle bugs in random numeric testing for hyperexpand. Since the code is in master now and we are about to release this is fairly bad of course. But luckily another gsoc student is setting up jenkins and configured it in such a way to currently run the relevant tests every five minutes. That should allow me to weed out all bugs.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nessgrh.wordpress.com/343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nessgrh.wordpress.com/343/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=343&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nessgrh.wordpress.com/2011/07/22/status-update%e2%80%94week-9/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19a106c007b937829625d57470b0c19c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nessgrh</media:title>
		</media:content>
	</item>
		<item>
		<title>Deciphering Branch Behaviour</title>
		<link>http://nessgrh.wordpress.com/2011/07/22/deciphering-branch-behaviour/</link>
		<comments>http://nessgrh.wordpress.com/2011/07/22/deciphering-branch-behaviour/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 13:43:53 +0000</pubDate>
		<dc:creator>nessgrh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nessgrh.wordpress.com/?p=317</guid>
		<description><![CDATA[Handling branches in computer systems is indeed unbelievably subtle. Here is one slightly complicated example which comes out correctly, at least when looked at in the right way; this is encouraging. The following integral comes up in an ODE test: . The right hand side is as computed by the meijerint code and looks suspicious, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=317&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Handling branches in computer systems is indeed unbelievably subtle. Here is one slightly complicated example which comes out correctly, at least when looked at in the right way; this is encouraging. The following integral comes up in an ODE test: <img src='http://s0.wp.com/latex.php?latex=%5Cint+%5Cfrac%7B%5Cmathrm%7Bd%7Dx%7D%7Bx+%5Csqrt%7B1+-+x%5E2%7D%7D+%3D+i+%5Carcsin%7B%5Cfrac%7B1%7D%7Bx%7D%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;int &#92;frac{&#92;mathrm{d}x}{x &#92;sqrt{1 - x^2}} = i &#92;arcsin{&#92;frac{1}{x}}' title='&#92;int &#92;frac{&#92;mathrm{d}x}{x &#92;sqrt{1 - x^2}} = i &#92;arcsin{&#92;frac{1}{x}}' class='latex' />. The right hand side is as computed by the meijerint code and looks suspicious, not being invariant under complex conjugation. However, note that on both sides are branched functions: <img src='http://s0.wp.com/latex.php?latex=%5Csqrt%7B1+-+x%5E2%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;sqrt{1 - x^2}' title='&#92;sqrt{1 - x^2}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Carcsin%7B%5Cfrac%7B1%7D%7Bx%7D%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;arcsin{&#92;frac{1}{x}}' title='&#92;arcsin{&#92;frac{1}{x}}' class='latex' />. The left hand side is unbranched at the origin, whereas the right hand side is unbranched at infinity. The left hand side is branched at infinity, whereas the rigth hand side is not. (There is nothing unusual about this, there is no reason to expect indefinite integrals to retain branchpoints.)</p>
<p>Thus in order to understand what is going on, we first have to understand the extension of both functions to true polar numbers <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='x' title='x' class='latex' />, because this is what the meijer g code works with. Since inverse sine is surely nasty, let&#8217;s try to understand the square root expression. A clue comes from enabling debug output: the meijerint code decides <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7B1%7D%7B%5Csqrt%7B1-x%5E2%7D%7D+%3D+G%28x%5E2+e%5E%7Bi+%5Cpi%7D%29+%3D+%5Csqrt%7B%5Cpi%7D+G_%7B1%2C+1%7D%5E%7B1%2C+1%7D+%5Cleft%28%5Cbegin%7Bmatrix%7D%5Cfrac%7B1%7D%7B2%7D+%5C%5C+0+%5Cend%7Bmatrix%7D%5Cmiddle%7C+x%5E2+e%5E%7Bi%5Cpi%7D+%5Cright%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;frac{1}{&#92;sqrt{1-x^2}} = G(x^2 e^{i &#92;pi}) = &#92;sqrt{&#92;pi} G_{1, 1}^{1, 1} &#92;left(&#92;begin{matrix}&#92;frac{1}{2} &#92;&#92; 0 &#92;end{matrix}&#92;middle| x^2 e^{i&#92;pi} &#92;right)' title='&#92;frac{1}{&#92;sqrt{1-x^2}} = G(x^2 e^{i &#92;pi}) = &#92;sqrt{&#92;pi} G_{1, 1}^{1, 1} &#92;left(&#92;begin{matrix}&#92;frac{1}{2} &#92;&#92; 0 &#92;end{matrix}&#92;middle| x^2 e^{i&#92;pi} &#92;right)' class='latex' />. From the definitions, for <img src='http://s0.wp.com/latex.php?latex=%7Cx%7C+%3C+1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='|x| &lt; 1' title='|x| &lt; 1' class='latex' /> we find <img src='http://s0.wp.com/latex.php?latex=G%28x%29+%3D+F%28x%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='G(x) = F(x)' title='G(x) = F(x)' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=F%28x%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='F(x)' title='F(x)' class='latex' />, which we shall define only for <img src='http://s0.wp.com/latex.php?latex=%7Cx%7C+%3C+1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='|x| &lt; 1' title='|x| &lt; 1' class='latex' />, is <img src='http://s0.wp.com/latex.php?latex=%281+%2B+x%29%5E%7B-%5Cfrac%7B1%7D%7B2%7D%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='(1 + x)^{-&#92;frac{1}{2}}' title='(1 + x)^{-&#92;frac{1}{2}}' class='latex' />, evaluated on the principal branch (indeed it is just a binomial series). Also from the definitions, we find that for <img src='http://s0.wp.com/latex.php?latex=%7Cx%7C+%3E+1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='|x| &gt; 1' title='|x| &gt; 1' class='latex' />, <img src='http://s0.wp.com/latex.php?latex=G%28x%29+%3D+%5Cfrac%7B1%7D%7B%5Csqrt%7Bx%7D%7D+F%5Cleft%28%5Cfrac%7B1%7D%7Bx%7D%5Cright%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='G(x) = &#92;frac{1}{&#92;sqrt{x}} F&#92;left(&#92;frac{1}{x}&#92;right)' title='G(x) = &#92;frac{1}{&#92;sqrt{x}} F&#92;left(&#92;frac{1}{x}&#92;right)' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7B1%7D%7B%5Csqrt%7Bx%7D%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;frac{1}{&#92;sqrt{x}}' title='&#92;frac{1}{&#92;sqrt{x}}' class='latex' /> denotes the holomorphic function <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D+%5Crightarrow+%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S} &#92;rightarrow &#92;mathbb{C}' title='&#92;mathcal{S} &#92;rightarrow &#92;mathbb{C}' class='latex' /> (which is, in particular, continuous, i.e. free of branch cuts). Finally we know that for <img src='http://s0.wp.com/latex.php?latex=%7CArg%28x%29%7C+%3C+%5Cpi&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='|Arg(x)| &lt; &#92;pi' title='|Arg(x)| &lt; &#92;pi' class='latex' />, these two definitions must patch together continuously.</p>
<p>Note how the branching has been resolved crudely: for every polar number x (outside a set of measure zero which does not disconnect <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' />) the integrand has acquired a definite value, continuous on circles. However, there is a circular branch cut on every other sheet.</p>
<p>Now let&#8217;s look back at the integrand. The meijerint code interprets <img src='http://s0.wp.com/latex.php?latex=%5Cint+%5Cfrac%7B1%7D%7Bx+%5Csqrt%7B1+-+x%5E2%7D%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;int &#92;frac{1}{x &#92;sqrt{1 - x^2}}' title='&#92;int &#92;frac{1}{x &#92;sqrt{1 - x^2}}' class='latex' /> as <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7BG%28e%5E%7Bi%5Cpi%7D+x%5E2%29%7D%7Bx%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;frac{G(e^{i&#92;pi} x^2)}{x}' title='&#92;frac{G(e^{i&#92;pi} x^2)}{x}' class='latex' />. [It's <img src='http://s0.wp.com/latex.php?latex=e%5E%7Bi%5Cpi%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='e^{i&#92;pi}' title='e^{i&#92;pi}' class='latex' /> and not <img src='http://s0.wp.com/latex.php?latex=e%5E%7B-i%5Cpi%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='e^{-i&#92;pi}' title='e^{-i&#92;pi}' class='latex' /> since <img src='http://s0.wp.com/latex.php?latex=-1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='-1' title='-1' class='latex' /> "in the wild" means <img src='http://s0.wp.com/latex.php?latex=e%5E%7Bi%5Cpi%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='e^{i&#92;pi}' title='e^{i&#92;pi}' class='latex' /> in the standard branch. Of course one can specify this by hand if it is not the desired choice.] Hence for <img src='http://s0.wp.com/latex.php?latex=%7Cx%7C+%3E+1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='|x| &gt; 1' title='|x| &gt; 1' class='latex' />, the integrand is <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7BF%5Cleft%28%5Cfrac%7B-1%7D%7Bx%5E2%7D+%5Cright%29%7D%7Bx+%5Csqrt%7Be%5E%7Bi+%5Cpi%7Dx%5E2%7D+%7D+%3D+%5Cfrac%7BF%5Cleft%28%5Cfrac%7B-1%7D%7Bx%5E2%7D+%5Cright%29%7D%7Bx%5E2+e%5E%7Bi+%5Cpi%2F2%7D%7D+%3D+%5Cfrac%7B-i%7D%7Bx%5E2+%5Csqrt%7B1+-+%5Cfrac%7B1%7D%7Bx%5E2%7D%7D%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;frac{F&#92;left(&#92;frac{-1}{x^2} &#92;right)}{x &#92;sqrt{e^{i &#92;pi}x^2} } = &#92;frac{F&#92;left(&#92;frac{-1}{x^2} &#92;right)}{x^2 e^{i &#92;pi/2}} = &#92;frac{-i}{x^2 &#92;sqrt{1 - &#92;frac{1}{x^2}}}' title='&#92;frac{F&#92;left(&#92;frac{-1}{x^2} &#92;right)}{x &#92;sqrt{e^{i &#92;pi}x^2} } = &#92;frac{F&#92;left(&#92;frac{-1}{x^2} &#92;right)}{x^2 e^{i &#92;pi/2}} = &#92;frac{-i}{x^2 &#92;sqrt{1 - &#92;frac{1}{x^2}}}' class='latex' /> (Recall that in the first term the the square root means the continuous function on <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' />, and so the second term is the same as the first. In the third term the square root denotes the principal branch, which is continuous throughout <img src='http://s0.wp.com/latex.php?latex=%7Cx%7C%3E1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='|x|&gt;1' title='|x|&gt;1' class='latex' /> as well.)</p>
<p>Finally, for <img src='http://s0.wp.com/latex.php?latex=%7Cx%7C+%3C+1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='|x| &lt; 1' title='|x| &lt; 1' class='latex' />, the derivative of <img src='http://s0.wp.com/latex.php?latex=%5Carcsin%7Bx%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;arcsin{x}' title='&#92;arcsin{x}' class='latex' /> is <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7B1%7D%7B%5Csqrt%7B1+-+x%5E2%7D%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;frac{1}{&#92;sqrt{1 - x^2}}' title='&#92;frac{1}{&#92;sqrt{1 - x^2}}' class='latex' />, again with the principal branch of the square root (for the same reason as before: continue analytically on circles from the real-valued function). Thus lo and behold, if we differentiate <img src='http://s0.wp.com/latex.php?latex=i%5Carcsin%7B%5Cfrac%7B1%7D%7Bx%7D%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='i&#92;arcsin{&#92;frac{1}{x}}' title='i&#92;arcsin{&#92;frac{1}{x}}' class='latex' /> for <img src='http://s0.wp.com/latex.php?latex=%7Cx%7C+%3E+1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='|x| &gt; 1' title='|x| &gt; 1' class='latex' />, we do get out the right sign. As a side note, if we replace <img src='http://s0.wp.com/latex.php?latex=-x%5E2&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='-x^2' title='-x^2' class='latex' /> in the integrand by <img src='http://s0.wp.com/latex.php?latex=e%5E%7B-i%5Cpi%7Dx%5E2&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='e^{-i&#92;pi}x^2' title='e^{-i&#92;pi}x^2' class='latex' />, we get the other sign.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nessgrh.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nessgrh.wordpress.com/317/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=317&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nessgrh.wordpress.com/2011/07/22/deciphering-branch-behaviour/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19a106c007b937829625d57470b0c19c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nessgrh</media:title>
		</media:content>
	</item>
		<item>
		<title>Status Update—Week 8</title>
		<link>http://nessgrh.wordpress.com/2011/07/16/status-update%e2%80%94week-8/</link>
		<comments>http://nessgrh.wordpress.com/2011/07/16/status-update%e2%80%94week-8/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 23:32:59 +0000</pubDate>
		<dc:creator>nessgrh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nessgrh.wordpress.com/?p=300</guid>
		<description><![CDATA[Introduction So this week I finally extended the integration lookup tables to now include trigonomic, hyperbolic and exponential functions, certain algebraic functions, error functions, the logarithm, the error function, and various bessel functions. I also did some miscellaneous fixes and extensions which I might mention in passing. Furthermore I decided to create a &#8220;TODO later&#8221; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=300&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h2>Introduction</h2>
<p>So this week I finally extended the integration lookup tables to now include trigonomic, hyperbolic and exponential functions, certain algebraic functions, error functions, the logarithm, the error function, and various bessel functions. I also did some miscellaneous fixes and extensions which I might mention in passing. Furthermore I decided to create a &#8220;TODO later&#8221; list: basically a list of things that I really really do want to fix, but that will not go into my first integrals pull request. For I have been working on this for so (comparatively) long, I feel I need to stabilise the branch. Indeed the only thing left to do before I subsmit it is a decent treatment of branched functions. After that I think progress can be incremential, and I will start working on the &#8220;TODO later&#8221; stuff in a gsoc-3 branch.</p>
<p>This post consists of three parts: the first shows results of this weeks work. The second describes some items on the &#8220;TODO later&#8221; list (to give an idea of what will be missing in the upcoming pull request). The third branch describes my ideas for polar numbers in detail, which I will start implementing tomorrow (I did not actually do any work today, instead I want to the Calypso Water park (near Ottawa). Hurray for flexible work hours.)</p>
<h2>Visible Results of the Extended Tables</h2>
<p>Basically now the code can solve the same sort of problems as before, just on many more classes of functions. One simple example is some <a href="http://pastebin.com/raw.php?i=qUR8AH1y">indefinite integration</a>. A few comments are in order. First of all, there is no use hiding that indefinite integration is hardly the strength of the algorithm. The examples show that it can be made to work in some situations, but basically any composition of functions or similar will stop it from working. (The same is true for definite integration, of course, but there nobody expects much more *g*.) We see in equations 4, 5, 7, 9 (sorry for the non-consecutive numbering) that integration of simple combinations of trigonometric and polynomial functions can be done, and can indeed be faster than existing code. Equations 12, 14, 15 show recursive mellin transforms in action, of course this gets much slower. Equations 18, 19, 20 and 38 show integration of bessel functions. Incidentially I could not verify the last by differentiation, so I will have to look into this again—before submitting the pull request, of course. Equations 40 and 41 illustrate integration of bessel functions. Equation 42 shows a slight shortcoming: the integral can be expressed using struve functions (I think), but they are just not in the table for expanding g-functions (and neither in sympy). Equation 43 shows a more serious limitation: the integral can be done using integration by parts, but the integrand is *not* a meijer g-function (mellin transform involves digamma functions), so this is not an integral the algorithm will be able to determine.</p>
<p>Let&#8217;s now look at some <a href="http://pastebin.com/raw.php?i=snLKLA60">definite integration</a>. There is not very much to say here, except that I show these integrals <em>because</em> they can be done. There are many more like them that can be done, and extremely many more like them that cannot be done. Some of these might look odd (23, 36); I will explain what is going on in the &#8220;TODO later&#8221; section.</p>
<h2>The &#8220;TODO Later&#8221; list</h2>
<p>One problem is that hyperexpand() sometimes is not very clever. For example in equation 28 of the definite integration examples, we see that apparently the integral cannot be done in named special functions. hyperexpand() retains the meijer g-function because the hypergeometric functions cannot be expanded; this is usually a good idea since a g-function expansion in hypergeometric functions can be very messy. However in this case the hypergeometric functions actually cancel! hyperexpand() note this and return the simplified result. However things are not quite so easy. Sometimes there is choice involved in what hypergeometric functions to expand into, and only some choices cancel. Moreover, sometimes the hypergeometric functions do not cancel, but instead can be evaluated at special arguments. Here are a few <a href="http://pastebin.com/raw.php?i=dH5pFZ4j">examples</a>. Equation 3 shows some non-obvious cancellation: the gammas have to be simplified, and then the symmetry of the arguments of the hypergeometric functions has to be used. Equation five shows an example that can be done because of the special argument, indeed 2F1 can always be summed at unity, using a theorem of Gauss&#8217;. Equation 7 shows something more complicated still, I know it can be done but I am not sure how (maybe using a so-called quadratic transformation). One side-effect of this shortcoming is that currently I have had to put formulae for e.g. <img src='http://s0.wp.com/latex.php?latex=J_a%28x%29+J_b%28x%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='J_a(x) J_b(x)' title='J_a(x) J_b(x)' class='latex' /> into the table, even though they should be derivable (at a time cost, of course). This is a bad thing since it leads to an explosion of entries.</p>
<p>Another thing that should be fixed is that the convergence conditions for the integral of two g-functions are sometimes just too weak. For example none of the following can currently be done: <img src='http://s0.wp.com/latex.php?latex=%5Cint_0%5E%5Cinfty+%5Csin%7Bx%7D+%5Ccos%7Bx%7D+%5Cfrac%7B%5Cmathrm%7Bd%7Dx%7D%7B%5Csqrt%7Bx%7D%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;int_0^&#92;infty &#92;sin{x} &#92;cos{x} &#92;frac{&#92;mathrm{d}x}{&#92;sqrt{x}}' title='&#92;int_0^&#92;infty &#92;sin{x} &#92;cos{x} &#92;frac{&#92;mathrm{d}x}{&#92;sqrt{x}}' class='latex' />, <img src='http://s0.wp.com/latex.php?latex=%5Cint_0%5E%5Cinfty+e%5E%7B-x%7D+%5Csinh%7B%5Cfrac%7Bx%7D%7B2%7D%7D+%5Cmathrm%7Bd%7Dx&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;int_0^&#92;infty e^{-x} &#92;sinh{&#92;frac{x}{2}} &#92;mathrm{d}x' title='&#92;int_0^&#92;infty e^{-x} &#92;sinh{&#92;frac{x}{2}} &#92;mathrm{d}x' class='latex' />, <img src='http://s0.wp.com/latex.php?latex=%5Cint_0%5E%5Cinfty+e%5E%7B-x%7D+%5Csinh%7Bx%7D+%5Cfrac%7B%5Cmathrm%7Bd%7Dx%7D%7Bx%5Csqrt%7Bx%7D%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;int_0^&#92;infty e^{-x} &#92;sinh{x} &#92;frac{&#92;mathrm{d}x}{x&#92;sqrt{x}}' title='&#92;int_0^&#92;infty e^{-x} &#92;sinh{x} &#92;frac{&#92;mathrm{d}x}{x&#92;sqrt{x}}' class='latex' />, <img src='http://s0.wp.com/latex.php?latex=%5Cint_0%5E%5Cinfty+e%5Ex+H%281-x%29+%5Cmathrm%7Bd%7Dx&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;int_0^&#92;infty e^x H(1-x) &#92;mathrm{d}x' title='&#92;int_0^&#92;infty e^x H(1-x) &#92;mathrm{d}x' class='latex' />. This also stops the recursive algorithm from working.</p>
<p>Then the tables can and should of course be extended further. Notably missing currently are inverse trigonometric functions and powers of trigonometric/hyperbolic functions (though these should be derivable).</p>
<p>As another point, the code to transform an integrand and limits into a known form is not currently very clever. For example <img src='http://s0.wp.com/latex.php?latex=%5Cint_1%5E%5Cinfty+%5Cfrac%7B%5Csin%28zu%29%7D%7B%28u%5E2+-+1%29%5Ea%7D+%5Cmathrm%7Bd%7Du&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;int_1^&#92;infty &#92;frac{&#92;sin(zu)}{(u^2 - 1)^a} &#92;mathrm{d}u' title='&#92;int_1^&#92;infty &#92;frac{&#92;sin(zu)}{(u^2 - 1)^a} &#92;mathrm{d}u' class='latex' /> can be done by rewriting it as <img src='http://s0.wp.com/latex.php?latex=%5Cint_0%5E%5Cinfty+H%28u%5E2-1%29+%5Cfrac%7B%5Csin%28zu%29%7D%7B%28u%5E2+-+1%29%5Ea%7D+%5Cmathrm%7Bd%7Du&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;int_0^&#92;infty H(u^2-1) &#92;frac{&#92;sin(zu)}{(u^2 - 1)^a} &#92;mathrm{d}u' title='&#92;int_0^&#92;infty H(u^2-1) &#92;frac{&#92;sin(zu)}{(u^2 - 1)^a} &#92;mathrm{d}u' class='latex' />, but the code cannot do this, yet.</p>
<p>On a related note, I should probably write a function to simplify bessel functions, e.g. equation 36 of the definite integration examples is just a single bessel I function (times a step function), but this is far from obvious. Importantly this needs proper treatment of polar numbers to get the branch factors right.</p>
<h2>Introducing Polar Numbers</h2>
<p>Finally, my new plan to treat branch cuts. I think there is no way around implementing proper polar numbers, in some way. Let&#8217;s first talk about the mathematics, and then about a possible implementation.</p>
<p>Let <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' /> again denote the riemann surface of the logarithm, and let <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathbb{C}' title='&#92;mathbb{C}' class='latex' /> denote the ordinary complex line. [We shall sometimes think of <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' /> as an open subset of a topological space <img src='http://s0.wp.com/latex.php?latex=S&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='S' title='S' class='latex' /> which contains one additional point called "origin"; notably there is no complex structure near it.] We have the holomorphic map <img src='http://s0.wp.com/latex.php?latex=Exp%3A+%5Cmathbb%7BC%7D+%5Crightarrow+%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='Exp: &#92;mathbb{C} &#92;rightarrow &#92;mathcal{S}' title='Exp: &#92;mathbb{C} &#92;rightarrow &#92;mathcal{S}' class='latex' /> which is indeed a biholomorphism. Its inverse is <img src='http://s0.wp.com/latex.php?latex=Log%3A+%5Cmathcal%7BS%7D+%5Crightarrow+%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='Log: &#92;mathcal{S} &#92;rightarrow &#92;mathbb{C}' title='Log: &#92;mathcal{S} &#92;rightarrow &#92;mathbb{C}' class='latex' />. We also have a holomorphic projection map <img src='http://s0.wp.com/latex.php?latex=p%3A+%5Cmathcal%7BS%7D+%5Crightarrow+%5Cmathbb%7BC%7D%2C+Exp%28z%29+%5Cmapsto+exp%28z%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='p: &#92;mathcal{S} &#92;rightarrow &#92;mathbb{C}, Exp(z) &#92;mapsto exp(z)' title='p: &#92;mathcal{S} &#92;rightarrow &#92;mathbb{C}, Exp(z) &#92;mapsto exp(z)' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=exp%28z%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='exp(z)' title='exp(z)' class='latex' /> denotes the ordinary exponential function from <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathbb{C}' title='&#92;mathbb{C}' class='latex' /> to itself. There is a section (one-sided inverse) of <img src='http://s0.wp.com/latex.php?latex=p&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='p' title='p' class='latex' /> related to the standard branch of the argument which we shall denote <img src='http://s0.wp.com/latex.php?latex=q%3A+%5Cmathbb%7BC%7D+%5Crightarrow+S%2C+exp%28k+%2B+i+%5Ctheta%29+%5Cmapsto+Exp%28k+%2B+i+%5Ctheta%29%2C+0+%5Cin+%5Cmathbb%7BC%7D+%5Cmapsto+0+%5Cin+S&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='q: &#92;mathbb{C} &#92;rightarrow S, exp(k + i &#92;theta) &#92;mapsto Exp(k + i &#92;theta), 0 &#92;in &#92;mathbb{C} &#92;mapsto 0 &#92;in S' title='q: &#92;mathbb{C} &#92;rightarrow S, exp(k + i &#92;theta) &#92;mapsto Exp(k + i &#92;theta), 0 &#92;in &#92;mathbb{C} &#92;mapsto 0 &#92;in S' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=k&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='k' title='k' class='latex' /> is real and <img src='http://s0.wp.com/latex.php?latex=-%5Cpi+%3C+%5Ctheta+%5Cle+%5Cpi&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='-&#92;pi &lt; &#92;theta &#92;le &#92;pi' title='-&#92;pi &lt; &#92;theta &#92;le &#92;pi' class='latex' />. This function is <em>not</em> continuous at the non-positive reals, but holomorphic outside thereof.</p>
<p>Multiplication in <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' /> is defined in the obvious way. If <img src='http://s0.wp.com/latex.php?latex=f%3A+D+%5Crightarrow+%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='f: D &#92;rightarrow &#92;mathcal{S}' title='f: D &#92;rightarrow &#92;mathcal{S}' class='latex' /> is a meromorphic (say) function, then <img src='http://s0.wp.com/latex.php?latex=p+%5Ccirc+f%3A+D+%5Crightarrow+%5Cmathcal%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='p &#92;circ f: D &#92;rightarrow &#92;mathcal{C}' title='p &#92;circ f: D &#92;rightarrow &#92;mathcal{C}' class='latex' /> is also meromorphic. Similarly if <img src='http://s0.wp.com/latex.php?latex=g%3A+%5Cmathbb%7BC%7D+%5Crightarrow+D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='g: &#92;mathbb{C} &#92;rightarrow D' title='g: &#92;mathbb{C} &#92;rightarrow D' class='latex' /> is any meromorphic (say) function, then so is <img src='http://s0.wp.com/latex.php?latex=g+%5Ccirc+p%3A+%5Cmathcal%7BS%7D+%5Crightarrow+D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='g &#92;circ p: &#92;mathcal{S} &#92;rightarrow D' title='g &#92;circ p: &#92;mathcal{S} &#92;rightarrow D' class='latex' />. This allows us to extend many more functions from <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathbb{C}' title='&#92;mathbb{C}' class='latex' /> to <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' />, and this is often done implicitely. Let&#8217;s mention two peculiarites: the sum of two elements in <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' /> cannot be defined very satisfactorily (although of course their sum in <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathbb{C}' title='&#92;mathbb{C}' class='latex' /> is well-defined and well-behaved). Also if <img src='http://s0.wp.com/latex.php?latex=a+%5Cin+%5Cmathcal%7BS%7D%2C+b+%5Cin+%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='a &#92;in &#92;mathcal{S}, b &#92;in &#92;mathbb{C}' title='a &#92;in &#92;mathcal{S}, b &#92;in &#92;mathbb{C}' class='latex' /> we can define <img src='http://s0.wp.com/latex.php?latex=a%5Eb+%3D+Exp%28b+Log%28a%29%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='a^b = Exp(b Log(a))' title='a^b = Exp(b Log(a))' class='latex' />, and if instead <img src='http://s0.wp.com/latex.php?latex=b+%5Cin+%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='b &#92;in &#92;mathcal{S}' title='b &#92;in &#92;mathcal{S}' class='latex' /> we can define <img src='http://s0.wp.com/latex.php?latex=a%5Eb+%3D+Exp%28p%28b%29+Log%28a%29%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='a^b = Exp(p(b) Log(a))' title='a^b = Exp(p(b) Log(a))' class='latex' />. With these definitions all the usual algebraic relations (like <img src='http://s0.wp.com/latex.php?latex=%28xy%29%5Ez+%3D+x%5Ez+y%5Ez&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='(xy)^z = x^z y^z' title='(xy)^z = x^z y^z' class='latex' />) hold for <em>all</em> <img src='http://s0.wp.com/latex.php?latex=x%2C+y%2C+z+%5Cin+%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='x, y, z &#92;in &#92;mathcal{S}' title='x, y, z &#92;in &#92;mathcal{S}' class='latex' />.</p>
<p>Now about the implementation. First we need a function to create/represent elements of <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' />. I had thought about exp(x, polar=True), polar being a new assumption. While I still think introducing an assumption is a good thing, I&#8217;m not so sure about this notation any more. The advantage is that the object looks very much like exp, so much code (printing, simplification) knows what to do with it. The disadvantage is that the assumption is easily lost, e.g. obj.func(*obj.args) will lose it, and also code might just create new exp objects, not knowing that there can be assumptions around. So probably creating a new function exp_polar is better.</p>
<p>Next I want to add an assumption polar which can be given to symbols. It does not interact much with other assumptions, except that positive shall imply polar. Much simplification code (notably in expand_log, powdenest, powsimp, logcombine) can now be updated to look for the polar assumption instead of the cruder positive.</p>
<p>Finally, for sake of usability, I propose the following functions: polarify(expr, subs=True/False) traverses the expression tree and turns any non-positive numeric constants (e.g. 1+I) into their image under <img src='http://s0.wp.com/latex.php?latex=q&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='q' title='q' class='latex' /> (namely sqrt(2)*exp_polar(I*pi/4)). It also converts instances of exp into exp_polar. If subs=True, also all symbols that are not polar will be substituted for polar dummies; thus polarify() behaves much like posify(). A function unpolarify(expr) that essentially computes the image of expr under <img src='http://s0.wp.com/latex.php?latex=p&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='p' title='p' class='latex' />, in as simple a form as possible. Thus it converts the outermost instances of exp_polar into exp, and recursively does the same thing for arguments of unbranched functions (e.g. powers with integral exponents, or things like sin(x)—here probably the function class should give a hint, similar to nargs). Then functions like expand, powdenest can accept a new argument polar=True/False which works like force, except that it calls polarify instead of posify. Finally for convenience Expr should get a method extract_branch_factor (a wrapper around extract_multiplicatively I imagine) that extracts factors of the form exp_polar(I*pi*n), n nt integer, which allows branched functions to expose their branching behaviour.</p>
<p>This is about it; I feel I have spent forever writing this post (it&#8217;s actually just 2.5 hours <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nessgrh.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nessgrh.wordpress.com/300/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=300&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nessgrh.wordpress.com/2011/07/16/status-update%e2%80%94week-8/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19a106c007b937829625d57470b0c19c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nessgrh</media:title>
		</media:content>
	</item>
		<item>
		<title>A question of the argument—or: Tricky branch cuts revisited</title>
		<link>http://nessgrh.wordpress.com/2011/07/13/a-question-of-the-argument%e2%80%94or-tricky-branch-cuts-revisited/</link>
		<comments>http://nessgrh.wordpress.com/2011/07/13/a-question-of-the-argument%e2%80%94or-tricky-branch-cuts-revisited/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 21:24:33 +0000</pubDate>
		<dc:creator>nessgrh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nessgrh.wordpress.com/?p=276</guid>
		<description><![CDATA[This post is a continuation of my previous one on branch cuts. My usual status update will again come on friday, and this time I actually have something to show off. As before, the aim of this post is two-fold: both to clarify my thoughts, and to invite suggestions for solution. It turn out my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=276&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This post is a continuation of my previous one on branch cuts. My usual status update will again come on friday, and this time I actually have something to show off.</p>
<p>As before, the aim of this post is two-fold: both to clarify my thoughts, and to invite suggestions for solution.</p>
<p>It turn out my previous treatment of branched functions was a bit short-sighted (who would have guessed that, hu? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ). In order to make progress, I have for now been ignoring problems related to branches/arguments; but by now this is the last big problem before my branch can finally become &#8220;pull request ready&#8221; (more on that in friday&#8217;s post). Let me first describe the problem(s) at hand. I have picked five (six) representative examples.</p>
<ol start="0">
<li><img src='http://s0.wp.com/latex.php?latex=IFT%5Cleft%5B%5Cfrac%7B1%7D%7B1+%2B+2%5Cpi+i+k%7D%5Cright%5D%28x%29%2C+x+%3E+0.&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='IFT&#92;left[&#92;frac{1}{1 + 2&#92;pi i k}&#92;right](x), x &gt; 0.' title='IFT&#92;left[&#92;frac{1}{1 + 2&#92;pi i k}&#92;right](x), x &gt; 0.' class='latex' /> (IFT stands for inverse fourier transform) As explained previously, this comes out as (roughly) <img src='http://s0.wp.com/latex.php?latex=e%5E%7B-x%7D+%5Cleft%28%5CGamma%280%2C+e%5E%7B2+%5Cpi+i%7D%29+-+%5CGamma%280%2C+1%29+%5Cright%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='e^{-x} &#92;left(&#92;Gamma(0, e^{2 &#92;pi i}) - &#92;Gamma(0, 1) &#92;right)' title='e^{-x} &#92;left(&#92;Gamma(0, e^{2 &#92;pi i}) - &#92;Gamma(0, 1) &#92;right)' class='latex' />. The <img src='http://s0.wp.com/latex.php?latex=e%5E%7B2+%5Cpi+i%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='e^{2 &#92;pi i}' title='e^{2 &#92;pi i}' class='latex' /> must not be simplified to <img src='http://s0.wp.com/latex.php?latex=1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='1' title='1' class='latex' /> here.</li>
<li><img src='http://s0.wp.com/latex.php?latex=IFT%5Cleft%5B+%5Cfrac%7B1%7D%7B1+%2B+2%5Cpi+i+k%7D+%5Cright%5D%28x%29%2C+x+%3C+0.&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='IFT&#92;left[ &#92;frac{1}{1 + 2&#92;pi i k} &#92;right](x), x &lt; 0.' title='IFT&#92;left[ &#92;frac{1}{1 + 2&#92;pi i k} &#92;right](x), x &lt; 0.' class='latex' /> As also explained previously, the G-function algorithm cannot compute this without realising that <img src='http://s0.wp.com/latex.php?latex=exp%28x%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='exp(x)' title='exp(x)' class='latex' /> is unbranched, i.e. that the argument of this function may indeed be converted to <img src='http://s0.wp.com/latex.php?latex=%28-%5Cpi%2C+%5Cpi%5D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='(-&#92;pi, &#92;pi]' title='(-&#92;pi, &#92;pi]' class='latex' />.</li>
<li><img src='http://s0.wp.com/latex.php?latex=MT%5Cleft%5B%5Cfrac%7B%28b+%2B+%5Csqrt%7Bb%5E2+%2B+x%5E2%7D%29%5Ea%7D%7B-%5Csqrt%7Bb%5E2+%2B+x%5E2%7D%7D+%5Cright%5D%2C+%5Ctext%7Bwhere+%7D+b+%3C+0&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='MT&#92;left[&#92;frac{(b + &#92;sqrt{b^2 + x^2})^a}{-&#92;sqrt{b^2 + x^2}} &#92;right], &#92;text{where } b &lt; 0' title='MT&#92;left[&#92;frac{(b + &#92;sqrt{b^2 + x^2})^a}{-&#92;sqrt{b^2 + x^2}} &#92;right], &#92;text{where } b &lt; 0' class='latex' />. (MT stands for mellin transform) This is curious. To understand what is going on, we have to realise that the function is actually represented as <img src='http://s0.wp.com/latex.php?latex=C+F%28x%5E2%2Fb%5E2%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='C F(x^2/b^2)' title='C F(x^2/b^2)' class='latex' /> for some constant <img src='http://s0.wp.com/latex.php?latex=C&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='C' title='C' class='latex' /> independent of <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='x' title='x' class='latex' />, and a function <img src='http://s0.wp.com/latex.php?latex=F%28z%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='F(z)' title='F(z)' class='latex' />. Thus <img src='http://s0.wp.com/latex.php?latex=b&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='b' title='b' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=x&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='x' title='x' class='latex' /> <em>together</em> determine the branch of the square root taken. Thus putting a negative <img src='http://s0.wp.com/latex.php?latex=b&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='b' title='b' class='latex' /> in above expression yields <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7B%28b+-+%5Csqrt%7Bb%5E2+%2B+x%5E2%7D%29%5Ea%7D%7B-%5Csqrt%7Bb%5E2+%2B+x%5E2%7D%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;frac{(b - &#92;sqrt{b^2 + x^2})^a}{-&#92;sqrt{b^2 + x^2}}' title='&#92;frac{(b - &#92;sqrt{b^2 + x^2})^a}{-&#92;sqrt{b^2 + x^2}}' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=%5Csqrt%7Bz%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;sqrt{z}' title='&#92;sqrt{z}' class='latex' /> for once denotes the principal branch. This is surely (?) not what the user had in mind when entering the above expression (and btw we cannot compute the answer for this argument anyway).</li>
<li><img src='http://s0.wp.com/latex.php?latex=%5Csqrt%7Bx%5E2+%2B+t%5E2%7D+%2B+t&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;sqrt{x^2 + t^2} + t' title='&#92;sqrt{x^2 + t^2} + t' class='latex' /> matches <img src='http://s0.wp.com/latex.php?latex=%5Csqrt%7Bx%5E2+%2B+b%5E2%7D+-+b&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;sqrt{x^2 + b^2} - b' title='&#92;sqrt{x^2 + b^2} - b' class='latex' /> with <img src='http://s0.wp.com/latex.php?latex=t+%3D+-b&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='t = -b' title='t = -b' class='latex' />. This is wrong for the same reason as the example above, but this time the problem is that matching code thinks <img src='http://s0.wp.com/latex.php?latex=%28-1%29%5E2+%3D+1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='(-1)^2 = 1' title='(-1)^2 = 1' class='latex' />.</li>
<li><img src='http://s0.wp.com/latex.php?latex=MT+%5Cleft%5Be%5E%7Bax%7D+%5Csin%7Bax%7D+%5Cright%5D.&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='MT &#92;left[e^{ax} &#92;sin{ax} &#92;right].' title='MT &#92;left[e^{ax} &#92;sin{ax} &#92;right].' class='latex' /> This mellin transform only exists for <img src='http://s0.wp.com/latex.php?latex=a&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='a' title='a' class='latex' /> in the left half plane. The unsimplified result has a term (roughly) like <img src='http://s0.wp.com/latex.php?latex=%28e%5E%7B2+%5Cpi+i%7Da%29%5Es&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='(e^{2 &#92;pi i}a)^s' title='(e^{2 &#92;pi i}a)^s' class='latex' />, except that it is more complicated so that powdenest() doesn&#8217;t put the <img src='http://s0.wp.com/latex.php?latex=s&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='s' title='s' class='latex' /> into the exponent. This only happens when calling simplify. The end result is that when we substitute the real <img src='http://s0.wp.com/latex.php?latex=%5Cpi&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;pi' title='&#92;pi' class='latex' /> for the dummy an important factor of <img src='http://s0.wp.com/latex.php?latex=e%5E%7B2+%5Cpi+i%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='e^{2 &#92;pi i}' title='e^{2 &#92;pi i}' class='latex' /> is lost. (In case this explanation is too confusing, look at this <a href="http://pastebin.com/raw.php?i=GyufFHh1">session log</a>. Crucially, the last equation has a factor of <img src='http://s0.wp.com/latex.php?latex=e%5E%7B-2%5Cpi+i+s%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='e^{-2&#92;pi i s}' title='e^{-2&#92;pi i s}' class='latex' /> right before the gamma function, whereas the first does not.)</li>
<li><img src='http://s0.wp.com/latex.php?latex=ILT+%5Cfrac%7Ba%5E%5Cnu+%28s+%2B+%5Csqrt%7Bs%5E2-a%5E2%7D%29%5E%7B-%5Cnu%7D%7D%7B%5Csqrt%7Bs%5E2+-+a%5E2%7D%7D.&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='ILT &#92;frac{a^&#92;nu (s + &#92;sqrt{s^2-a^2})^{-&#92;nu}}{&#92;sqrt{s^2 - a^2}}.' title='ILT &#92;frac{a^&#92;nu (s + &#92;sqrt{s^2-a^2})^{-&#92;nu}}{&#92;sqrt{s^2 - a^2}}.' class='latex' /> (ILT stands for inverse laplace transform) In this case a double minus sign is cancelled, for similar reasons as above. (Here is a <a href="http://pastebin.com/raw.php?i=AiD1y03c">log</a>.)</li>
</ol>
<p>I think the following conclusions can be drawn from these examples:</p>
<ol>
<li>powdenest(force=True) is not a reliable way to propagate exponents and thus not sufficient to be sure that we can safely substitute <img src='http://s0.wp.com/latex.php?latex=%5Cpi&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;pi' title='&#92;pi' class='latex' /> for a dummy. [It has other problems as well, e.g. powdenest(abs(x), force=True) == x, and that's probably not even a bug.]</li>
<li>It is (thus) not tenable to try to hide all branch computations from the user in the way I tried so far (i.e. to return a result with fully computed branches, where <img src='http://s0.wp.com/latex.php?latex=-1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='-1' title='-1' class='latex' />-s can be cancelled in etc).</li>
<li>There needs to be a function similar to arg() and unbranched_argument() that can return reduced arguments if this is known to be correct.</li>
<li>It would be desirable to to have functions somewhat like powdenest(force=True) that do all simplifications valid on the riemann surface of the logarithm. Note that fore=True works by pretending all symbols are positive, this is not necessarily the same thing.</li>
</ol>
<p><strong>I&#8217;m looking for an unintrusive way to solve the above four problems.</strong></p>
<p>I&#8217;m toying with the idea of adding a new assumption &#8220;polar&#8221; to sympy. I think almost no code needs to know about it, and it seems like it could solve my problems. I&#8217;m not very experienced with the sympy core, though, so I may be wrong. I imagine that this assumption can be set on various objects to make them behave like numbers on the riemann surface of the logarithm. In particular exp(z, polar=True) stops exp(2*pi*I) == 1. We could also allow this on e.g. I or -1, so that exp(pi*I, polar=True) can return -1 with the polar=True flag set. Multiplying two such factors together will propagate back to exp. Also polar=True should stop exp from being expanded trigonometrically (since adding polar numbers does not really make sense, as far as I can see—adding shouldn&#8217;t be disallowed though, since it can be useful formal notation). Matching code could propagate this flag (I&#8217;m fuzzy on the details). Similarly powdenest etc could watch out for it.</p>
<p>This solves all but (3), for which I could just make a new function. My existing machinery for handling branch cuts should be adapted, obviously (actually most of it could go now). argument_dummy can go of course.</p>
<p>It might even be advantageous to have an assumption &#8220;period&#8221; which can have a numerical value (where the old behaviour means period=None, and the above behaviour means period=oo); but I think assumptions must be flags so this cannot work. If it would, it might allow for a unified treatment of (1-4), but that&#8217;s probably not worth it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nessgrh.wordpress.com/276/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nessgrh.wordpress.com/276/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=276&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nessgrh.wordpress.com/2011/07/13/a-question-of-the-argument%e2%80%94or-tricky-branch-cuts-revisited/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19a106c007b937829625d57470b0c19c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nessgrh</media:title>
		</media:content>
	</item>
		<item>
		<title>Status Update—Week 7</title>
		<link>http://nessgrh.wordpress.com/2011/07/08/status-update%e2%80%94week-7/</link>
		<comments>http://nessgrh.wordpress.com/2011/07/08/status-update%e2%80%94week-7/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 22:26:52 +0000</pubDate>
		<dc:creator>nessgrh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nessgrh.wordpress.com/?p=259</guid>
		<description><![CDATA[I&#8217;m starting to get into a phase were results of my new code are not as impressive as one might wish. Basically I hit one obscure integral that doesn&#8217;t work, and then I spend hours hunting down some bugs to fix it. These bugs can be minor typos or rather deep conceptual problems (see the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=259&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m starting to get into a phase were results of my new code are not as impressive as one might wish. Basically I hit one obscure integral that doesn&#8217;t work, and then I spend hours hunting down some bugs to fix it. These bugs can be minor typos or rather deep conceptual problems (see the branch cuts post), but nonetheless they are not very user-visible.</p>
<p>In any case, this week I fixed the combsimp algorithm for gamma functions, I implemented most of the expansion algorithm for G functions, I added classes to represent unevaluated transforms (as suggested in a comment to my last blog post), and I just about started to to extend the lookup tables. The last part turns out to be a real stress test for my code (since obviously we want to derive the formulas wherever possible, instead of putting them all into tables).</p>
<p>As I said before, there is not a lot to show off. Perhaps one word of clarification: there was code to expand meijer g-functions all the time. It works by evaluating the defining integral(s) using the residue theorem, i.e. using the (generalised) slater theorem. However, in some cases this does not work, because the series are properly non-hypergeometric. This can be quite annoying. Consider, for example <img src='http://s0.wp.com/latex.php?latex=G_%7B1%2C+2%7D%5E%7B2%2C+1%7D%5Cleft%28+y+%5Catop+%7B0%2C+y%7D+%5Cmiddle%7C+x+%5Cright%29+%3D+e%5E%7Bx%7D+%5CGamma%5Cleft%281+-+y+%5Cright%29+%5CGamma%28y%2C+x%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='G_{1, 2}^{2, 1}&#92;left( y &#92;atop {0, y} &#92;middle| x &#92;right) = e^{x} &#92;Gamma&#92;left(1 - y &#92;right) &#92;Gamma(y, x)' title='G_{1, 2}^{2, 1}&#92;left( y &#92;atop {0, y} &#92;middle| x &#92;right) = e^{x} &#92;Gamma&#92;left(1 - y &#92;right) &#92;Gamma(y, x)' class='latex' />. This formula holds for all <img src='http://s0.wp.com/latex.php?latex=y&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='y' title='y' class='latex' /> that are not positive integers (that is for all <img src='http://s0.wp.com/latex.php?latex=y&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='y' title='y' class='latex' /> so that the G-function on the left hand side makes sense). But for negative integers, slater&#8217;s theorem does not apply! This is quite a shame, since obviously substituting them in the end result is no problem at all, there does not seem to be a limit involved. But this is not the case, there is some gamma function cancellation going on. In fact, whenever Slater&#8217;s theorem applies, we know that the G-function is a sum of terms of the form <img src='http://s0.wp.com/latex.php?latex=z%5Ea+F%28z%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='z^a F(z)' title='z^a F(z)' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=F%28z%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='F(z)' title='F(z)' class='latex' /> is unbranched at the origin. But <img src='http://s0.wp.com/latex.php?latex=%5CGamma%28-n%2C+z%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;Gamma(-n, z)' title='&#92;Gamma(-n, z)' class='latex' /> has logarithmic monodromy at the origin. Thus there really is a limiting process.</p>
<p>Hence I spent about 1.5 days developing this new code. And then another half a day thinking about the branch cuts. Let&#8217;s see how much longer it is going to take until there is a satisfactory solution ^^.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nessgrh.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nessgrh.wordpress.com/259/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=259&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nessgrh.wordpress.com/2011/07/08/status-update%e2%80%94week-7/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19a106c007b937829625d57470b0c19c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nessgrh</media:title>
		</media:content>
	</item>
		<item>
		<title>Tricky branch cuts</title>
		<link>http://nessgrh.wordpress.com/2011/07/07/tricky-branch-cuts/</link>
		<comments>http://nessgrh.wordpress.com/2011/07/07/tricky-branch-cuts/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 20:19:44 +0000</pubDate>
		<dc:creator>nessgrh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nessgrh.wordpress.com/?p=227</guid>
		<description><![CDATA[This post will elaborate on the recent problems I&#8217;m having with &#8220;multivalued&#8221; functions. My usual status update will come tomorrow. I shall try to be almost pedantically clear in my description, both in order to clear my own thoughts and to increase the chance of someone suggesting a way out. In what follows, will denote [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=227&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This post will elaborate on the recent problems I&#8217;m having with &#8220;multivalued&#8221; functions. My usual status update will come tomorrow. I shall try to be almost pedantically clear in my description, both in order to clear my own thoughts and to increase the chance of someone suggesting a way out. In what follows, <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' /> will denote the riemann surface of the logarithm (this only means infinitely many copies of the complex line, glued together approprietely so that <img src='http://s0.wp.com/latex.php?latex=%5Clog%7Bz%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;log{z}' title='&#92;log{z}' class='latex' /> becomes an entire, single-valued function on <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' />). Zero is not an element of <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' />.</p>
<p>The problem we will study is how to compute the inverse fourier transform <img src='http://s0.wp.com/latex.php?latex=f%28t%29+%3D+%5Cint_%7B-%5Cinfty%7D%5E%5Cinfty+e%5E%7Bi+t+x%7D+%5Cfrac%7B%5Cmathrm%7Bd%7Dx%7D%7Bi+x+%2B+1%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='f(t) = &#92;int_{-&#92;infty}^&#92;infty e^{i t x} &#92;frac{&#92;mathrm{d}x}{i x + 1}' title='f(t) = &#92;int_{-&#92;infty}^&#92;infty e^{i t x} &#92;frac{&#92;mathrm{d}x}{i x + 1}' class='latex' />. First of all it is easy to see that the integral converges only for real, non-zero <img src='http://s0.wp.com/latex.php?latex=t&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='t' title='t' class='latex' />. Also using contour integration it is easily established that <img src='http://s0.wp.com/latex.php?latex=f%28t%29+%3D+2%5Cpi+H%28t%29+e%5E%7B-t%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='f(t) = 2&#92;pi H(t) e^{-t}' title='f(t) = 2&#92;pi H(t) e^{-t}' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=H%28t%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='H(t)' title='H(t)' class='latex' /> denotes the Heaviside step function.</p>
<p>How does the Meijer G-function algorithm compute this integral? First of all it is split up into two parts, <img src='http://s0.wp.com/latex.php?latex=I_1+%3D+%5Cint_0%5E%5Cinfty+e%5E%7Bi+t+x%7D+%5Cfrac%7B%5Cmathrm%7Bd%7Dx%7D%7Bi+x+%2B+1%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='I_1 = &#92;int_0^&#92;infty e^{i t x} &#92;frac{&#92;mathrm{d}x}{i x + 1}' title='I_1 = &#92;int_0^&#92;infty e^{i t x} &#92;frac{&#92;mathrm{d}x}{i x + 1}' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=I_2+%3D+%5Cint_%7B-%5Cinfty%7D%5E0+e%5E%7Bi+t+x%7D+%5Cfrac%7B%5Cmathrm%7Bd%7Dx%7D%7Bi+x+%2B+1%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='I_2 = &#92;int_{-&#92;infty}^0 e^{i t x} &#92;frac{&#92;mathrm{d}x}{i x + 1}' title='I_2 = &#92;int_{-&#92;infty}^0 e^{i t x} &#92;frac{&#92;mathrm{d}x}{i x + 1}' class='latex' />. Let&#8217;s concentrate on <img src='http://s0.wp.com/latex.php?latex=I_1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='I_1' title='I_1' class='latex' /> for now. The integral exists if the exponential has a decaying component, or if it is oscillatory. That is to say it converges for <img src='http://s0.wp.com/latex.php?latex=Im%28t%29+%5Cge+0%2C+t+%5Cne+0&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='Im(t) &#92;ge 0, t &#92;ne 0' title='Im(t) &#92;ge 0, t &#92;ne 0' class='latex' />. But let&#8217;s be a bit more specific: all meijer G functions are defined on <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' />, and may or may not descend to <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathbb{C}' title='&#92;mathbb{C}' class='latex' />. Thus define <img src='http://s0.wp.com/latex.php?latex=I_1%3A+%5Cmathcal%7BS%7D+%5Csupset+D+%5Crightarrow+%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='I_1: &#92;mathcal{S} &#92;supset D &#92;rightarrow &#92;mathbb{C}' title='I_1: &#92;mathcal{S} &#92;supset D &#92;rightarrow &#92;mathbb{C}' class='latex' /> to be our integral (where <img src='http://s0.wp.com/latex.php?latex=D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='D' title='D' class='latex' /> denotes the region of convergence). Of course <img src='http://s0.wp.com/latex.php?latex=I_1%28z%29+%3D+I_1%28e%5E%7B2%5Cpi+i%7D+z%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='I_1(z) = I_1(e^{2&#92;pi i} z)' title='I_1(z) = I_1(e^{2&#92;pi i} z)' class='latex' /> when the integral converges (note that this equation is not vacuous: <img src='http://s0.wp.com/latex.php?latex=e%5E%7B2%5Cpi+i%7D+%5Cne+1&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='e^{2&#92;pi i} &#92;ne 1' title='e^{2&#92;pi i} &#92;ne 1' class='latex' /> on <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' />). We thus find:</p>
<blockquote><p>The integral <img src='http://s0.wp.com/latex.php?latex=I_1%28t%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='I_1(t)' title='I_1(t)' class='latex' /> converges if <img src='http://s0.wp.com/latex.php?latex=%282n-1%29+%5Cpi+%5Cle+Arg%28t%29+%5Cle+2n+%5Cpi&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='(2n-1) &#92;pi &#92;le Arg(t) &#92;le 2n &#92;pi' title='(2n-1) &#92;pi &#92;le Arg(t) &#92;le 2n &#92;pi' class='latex' />, for some integer <img src='http://s0.wp.com/latex.php?latex=n&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='n' title='n' class='latex' />.</p></blockquote>
<p>Having established this, let&#8217;s see what the algorithm <a href="http://pastebin.com/raw.php?i=JiwwnUgN">computes</a>. I should explain the output. Note that debugging output is enabled. The first piecewise result is what would ordinarily be presented to the user: there is a closed expression, holding under various conditions. And there is the &#8220;otherwise&#8221; part of the piecewise, which just says that if the conditions do not hold, we don&#8217;t know the answer. Consider the conditions. unbranched_argument(t) means the argument of <img src='http://s0.wp.com/latex.php?latex=t+%5Cin+%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='t &#92;in &#92;mathcal{S}' title='t &#92;in &#92;mathcal{S}' class='latex' /> (whereas arg(t) would mean some value between <img src='http://s0.wp.com/latex.php?latex=-%5Cpi&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='-&#92;pi' title='-&#92;pi' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=%5Cpi&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;pi' title='&#92;pi' class='latex' />, and that function is not continuous either). Thus the conditions are just a funny way of saying <img src='http://s0.wp.com/latex.php?latex=0+%5Cle+Arg%28t%29+%5Cle+%5Cpi&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='0 &#92;le Arg(t) &#92;le &#92;pi' title='0 &#92;le Arg(t) &#92;le &#92;pi' class='latex' />. Now consider the claimed result. It looks a bit daunting, but this is because the functions in which it is written are defined on <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathbb{C}' title='&#92;mathbb{C}' class='latex' />, not <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' />. The debugging output line &#8220;Result before branch substitutions &#8230;&#8221; shows what the result would be on <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' />. I have computed this in output [8] (notice that what looks like <img src='http://s0.wp.com/latex.php?latex=%5Cpi&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;pi' title='&#92;pi' class='latex' /> here is a dummy, to stop evaluation of <img src='http://s0.wp.com/latex.php?latex=e%5E%7B%5Cpi+i%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='e^{&#92;pi i}' title='e^{&#92;pi i}' class='latex' /> etc). Of course <img src='http://s0.wp.com/latex.php?latex=%5Cexp%28z%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;exp(z)' title='&#92;exp(z)' class='latex' /> is an unbranched function on <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathbb{C}' title='&#92;mathbb{C}' class='latex' />, so the first two factors are uninteresting. But the last factor is not: we see that the result is related to the upper incomplete gamma function. This is a branched function, i.e. it is properly defined on <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' /> and it does not descend to <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathbb{C}' title='&#92;mathbb{C}' class='latex' />. If <img src='http://s0.wp.com/latex.php?latex=t&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='t' title='t' class='latex' /> is a positive real number, then the incomplete gamma function is to be evaluated at argument <img src='http://s0.wp.com/latex.php?latex=-%5Cpi&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='-&#92;pi' title='-&#92;pi' class='latex' />. <em>This</em> is where the extra terms (like argument_period()) come from: on <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathbb{C}' title='&#92;mathbb{C}' class='latex' /> argument <img src='http://s0.wp.com/latex.php?latex=-%5Cpi&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='-&#92;pi' title='-&#92;pi' class='latex' /> means negative reals. But with the branch cut conventions as implemented (in mpmath, effectively, but also enforced throughout sympy), negative reals mean argument <img src='http://s0.wp.com/latex.php?latex=%2B%5Cpi&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='+&#92;pi' title='+&#92;pi' class='latex' />. So the answer cannot just be <img src='http://s0.wp.com/latex.php?latex=%5CGamma%280%2C+-t%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;Gamma(0, -t)' title='&#92;Gamma(0, -t)' class='latex' />, because this would end up on the wrong branch. Thus we conclude (or rather the algorithm did for us):</p>
<blockquote><p>Define <img src='http://s0.wp.com/latex.php?latex=g%3A+%5Cmathcal%7BS%7D+%5Crightarrow+%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='g: &#92;mathcal{S} &#92;rightarrow &#92;mathbb{C}' title='g: &#92;mathcal{S} &#92;rightarrow &#92;mathbb{C}' class='latex' /> by <img src='http://s0.wp.com/latex.php?latex=g%28z%29+%3D+-i+e%5E%7B-t%7D+%5CGamma%280%2C+e%5E%7B-i+%5Cpi%7D+t%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='g(z) = -i e^{-t} &#92;Gamma(0, e^{-i &#92;pi} t)' title='g(z) = -i e^{-t} &#92;Gamma(0, e^{-i &#92;pi} t)' class='latex' />. Then for <img src='http://s0.wp.com/latex.php?latex=0+%5Cle+Arg%28t%29+%5Cle+%5Cpi%2C+I_1%28t%29+%3D+g%28t%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='0 &#92;le Arg(t) &#92;le &#92;pi, I_1(t) = g(t)' title='0 &#92;le Arg(t) &#92;le &#92;pi, I_1(t) = g(t)' class='latex' />.</p></blockquote>
<p>Notice in particular that our original integral has two natural extensions to <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' />: the naive definition <img src='http://s0.wp.com/latex.php?latex=I_1%28t%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='I_1(t)' title='I_1(t)' class='latex' />, and the analytic continuation <img src='http://s0.wp.com/latex.php?latex=g%28t%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='g(t)' title='g(t)' class='latex' />. The algorithm <strong>has to</strong> return some subset of the first definition, and <strong>not</strong> the second. In a sense this is why the convergence condition is necessary (although technically it is there because the integral representation of the G-functions used to establish this formula diverges outside the region specified by the convergence conditions).</p>
<p>We could now do a similar analysis for <img src='http://s0.wp.com/latex.php?latex=I_2&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='I_2' title='I_2' class='latex' />. The story is essentially the same, with the upper half plane replaced by the lower half plane (<img src='http://s0.wp.com/latex.php?latex=-%5Cpi+%5Cle+Arg%28t%29+%5Cle+0&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='-&#92;pi &#92;le Arg(t) &#92;le 0' title='-&#92;pi &#92;le Arg(t) &#92;le 0' class='latex' />) throughout. So when can we compute the combined integral? We already noted that this should be the case exactly when <img src='http://s0.wp.com/latex.php?latex=t&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='t' title='t' class='latex' /> is real, and working in <img src='http://s0.wp.com/latex.php?latex=%5Cmathbb%7BC%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathbb{C}' title='&#92;mathbb{C}' class='latex' /> this is easy to see: the intersection of the (closed) upper and lower half planes is the real axis. But notice how this <strong>fails</strong> on <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D.&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}.' title='&#92;mathcal{S}.' class='latex' /> The intersection of <img src='http://s0.wp.com/latex.php?latex=0+%5Cle+Arg%28t%29+%5Cle+%5Cpi&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='0 &#92;le Arg(t) &#92;le &#92;pi' title='0 &#92;le Arg(t) &#92;le &#92;pi' class='latex' /> (where we can evaluate the first integral) and <img src='http://s0.wp.com/latex.php?latex=-%5Cpi+%5Cle+Arg%28t%29+%5Cle%28t%29&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='-&#92;pi &#92;le Arg(t) &#92;le(t)' title='-&#92;pi &#92;le Arg(t) &#92;le(t)' class='latex' /> is <img src='http://s0.wp.com/latex.php?latex=Arg%28t%29+%3D+0&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='Arg(t) = 0' title='Arg(t) = 0' class='latex' />, i.e. only <em>positive</em> <img src='http://s0.wp.com/latex.php?latex=t&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='t' title='t' class='latex' />.</p>
<p>To further amplify the confusion, computing said fourier transform with argument <img src='http://s0.wp.com/latex.php?latex=-t&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='-t' title='-t' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=t&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='t' title='t' class='latex' /> is declared positive, works. This is because before &#8220;switching&#8221; to working on <img src='http://s0.wp.com/latex.php?latex=%5Cmathcal%7BS%7D&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='&#92;mathcal{S}' title='&#92;mathcal{S}' class='latex' />, the algorithm carelessly cancels some minus signs &#8230; which is fine for entire functions, of course.</p>
<p>Here ends this rather lengthy explanation. It remains to figure out how we can teach the algorithm that the integrals are periodic in argument <img src='http://s0.wp.com/latex.php?latex=2%5Cpi&amp;bg=FFFFFF&amp;fg=000000&amp;s=0' alt='2&#92;pi' title='2&#92;pi' class='latex' />, instead of knowing them only on one half-sheet. I have some vague ideas for this, but input is appreciated. In any case, I&#8217;ll think about this for a while. For now there is enough other work to do.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nessgrh.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nessgrh.wordpress.com/227/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nessgrh.wordpress.com&#038;blog=22546379&#038;post=227&#038;subd=nessgrh&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nessgrh.wordpress.com/2011/07/07/tricky-branch-cuts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/19a106c007b937829625d57470b0c19c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nessgrh</media:title>
		</media:content>
	</item>
	</channel>
</rss>
