<?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/"
	>

<channel>
	<title>nklein software &#187; patterns</title>
	<atom:link href="http://nklein.com/tags/patterns/feed/" rel="self" type="application/rss+xml" />
	<link>http://nklein.com</link>
	<description>software development and consulting</description>
	<lastBuildDate>Thu, 22 Dec 2011 04:42:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Lisp Patterns Question W.R.T. Clifford Algebras</title>
		<link>http://nklein.com/2009/05/lisp-patterns-question-wrt-clifford-algebras/</link>
		<comments>http://nklein.com/2009/05/lisp-patterns-question-wrt-clifford-algebras/#comments</comments>
		<pubDate>Wed, 20 May 2009 20:07:03 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Clifford Algebras]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[domain-specific languages]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[patterns]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=399</guid>
		<description><![CDATA[Since I moved my website to WordPress, I have been watching what search-engine searches land people on my page. Sadly, two of the things that get people to my page most often still have not been moved over to the new site from the old. One of those things is a C++ template library for [...]]]></description>
			<content:encoded><![CDATA[<p>Since I moved my website to <a href="http://wordpress.org/">WordPress</a>, I have been watching what search-engine searches land people on my page.</p>
<p>Sadly, two of the things that get people to my page most often still have not been moved over to the new site from <a href="http://old.nklein.com/">the old</a>.  One of those things is a C++ template library for Clifford algebras.  I am going to move that stuff over this week, I promise.  But, I thought I might also make a Lisp library for Clifford algebras, too.</p>
<p>An example Clifford algebra might be <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_831cf499b3d1348025a0b041556dba53.png" title="C_{3,0}" style="vertical-align:-20%;" class="tex" alt="C_{3,0}" />.  A generic element in this algebra is of the form:<br />
<center><img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_4364cd217c74bd9a4b8208da1ff15007.png" title="a_0 + a_1 e_1 + a_2 e_2 + a_3 e_3 + a_{1,2} e_{1,2} + a_{1,3} e_{1,3} + a_{2,3} e_{2,3} + a_{1,2,3} e_{1,2,3}" style="vertical-align:-20%;" class="tex" alt="a_0 + a_1 e_1 + a_2 e_2 + a_3 e_3 + a_{1,2} e_{1,2} + a_{1,3} e_{1,3} + a_{2,3} e_{2,3} + a_{1,2,3} e_{1,2,3}" /></center><br />
where the <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_08c6fa8efe4c47cbbdfb20cbc36006e3.png" title="a_*" style="vertical-align:-20%;" class="tex" alt="a_*" /> are coefficients.  For ease in dealing with these items, I will probably store that in a vector that looks something like this:<br />
<center>#(<img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_68e97f9899a45c2ef63d1d486b523827.png" title="a_0" style="vertical-align:-20%;" class="tex" alt="a_0" /> #(<img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_2028c58b1756381efb66cd2ca9ae9c69.png" title="a_1" style="vertical-align:-20%;" class="tex" alt="a_1" /> <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_9ff693167d454c907a6c4430d1af2afe.png" title="a_2" style="vertical-align:-20%;" class="tex" alt="a_2" /> <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_3ff077cf8331764ea4d093cf9a57f8a2.png" title="a_3" style="vertical-align:-20%;" class="tex" alt="a_3" />) #(<img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_a1880757779020fa878faeb76bb0eb22.png" title="a_{1,2}" style="vertical-align:-20%;" class="tex" alt="a_{1,2}" /> <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_e8c5851192864ac75ecb00a7476ab90f.png" title="a_{1,3}" style="vertical-align:-20%;" class="tex" alt="a_{1,3}" /> <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_31175b4dff3c30ce0aa0dc8910165ccd.png" title="a_{2,3}" style="vertical-align:-20%;" class="tex" alt="a_{2,3}" />) <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_00f3e4fbf4438505c2b0482604c180a1.png" title="a_{1,2,3}" style="vertical-align:-20%;" class="tex" alt="a_{1,2,3}" />)</center></p>
<p>If you want a simple element though (where most of the coefficients are zero), you shouldn&#8217;t have to stare down all of that stuff or remember that <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_e8c5851192864ac75ecb00a7476ab90f.png" title="a_{1,3}" style="vertical-align:-20%;" class="tex" alt="a_{1,3}" /> comes before <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_31175b4dff3c30ce0aa0dc8910165ccd.png" title="a_{2,3}" style="vertical-align:-20%;" class="tex" alt="a_{2,3}" />.  I want you to be able to make <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_f5e1d7d8031d0112ab5f6f87544e3b69.png" title="3 + 4 e_1 + 5 e_{1,2,3}" style="vertical-align:-20%;" class="tex" alt="3 + 4 e_1 + 5 e_{1,2,3}" /> more simply.  Something like one of the following:</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span>defvar *a* <span style="color: #66cc66;">&#40;</span>ca-element '<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span> <span style="color: #cc66cc;">1</span> <span style="color: #cc66cc;">2</span> <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">:</span><span style="color: #555;">p</span> <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>defvar *a* <span style="color: #66cc66;">&#40;</span>ca-element '<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4</span> <span style="color: #66cc66;">.</span> <span style="color: #66cc66;">:</span><span style="color: #555;">e1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span> <span style="color: #66cc66;">.</span> <span style="color: #66cc66;">:</span><span style="color: #555;">e1-</span><span style="color: #cc66cc;">2</span>-<span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">:</span><span style="color: #555;">p</span> <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>defvar *a* <span style="color: #66cc66;">&#40;</span>ca-element <span style="color: #66cc66;">:</span><span style="color: #555;">s</span> <span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">:</span><span style="color: #555;">e1</span> <span style="color: #cc66cc;">4</span> <span style="color: #66cc66;">:</span><span style="color: #555;">e1-</span><span style="color: #cc66cc;">2</span>-<span style="color: #cc66cc;">3</span> <span style="color: #cc66cc;">5</span> <span style="color: #66cc66;">:</span><span style="color: #555;">p</span> <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>Similarly, I will define something akin to <strong>(aref &#8230;)</strong> so that one can check or change <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_a1880757779020fa878faeb76bb0eb22.png" title="a_{1,2}" style="vertical-align:-20%;" class="tex" alt="a_{1,2}" /> like one of the following:</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span>caref *a* <span style="color: #cc66cc;">1</span> <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>caref *a* <span style="color: #66cc66;">:</span><span style="color: #555;">e1-</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>By analogy with the complex numbers, I should instead have:</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span>e1-<span style="color: #cc66cc;">2</span> *a*<span style="color: #66cc66;">&#41;</span></pre></div>
<p>But, that just doesn&#8217;t scale very well.</p>
<p>I am leaning toward using a list of numbers to tell which <img src="http://nklein.com/wp-content/plugins/easy-latex/cache/tex_08c6fa8efe4c47cbbdfb20cbc36006e3.png" title="a_*" style="vertical-align:-20%;" class="tex" alt="a_*" /> is being referenced.  This would allow greater flexibility in other functions.  But, it&#8217;s also less mathy.</p>
<p>Does anyone have any suggestions?  Should I really be supporting both?  Through the same function names or through <strong>(caref &#8230;)</strong> and <strong>(caref* &#8230;)</strong> or something?</p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2009/05/lisp-patterns-question-wrt-clifford-algebras/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

