16 January 2009

Mathematical Preparations For Lagrangians

Mathematics is the key and door to the sciences

I would like to discuss Classical mechanics quite a bit, specifically about math necessary for Lagrangian mechanics in this post. I am going off of a derivation that John Baez made fairly rigorous, but my target audience is not as mathematically savvy as to just read his beautiful lecture notes (available here) so I will need to discuss the math first, then the actual physics.

Differentials and Infinitesimals

Suppose we are working with some function f(x). Suppose we can Taylor expand it about x_{0}

f(x) = f(x_{0}) + f'(x_{0})(x-x_{0}) + \mathcal{O}([x-x_{0}]^2).

If we introduce some new “number”, lets call it \varepsilon, that is a “number” in the sense that \sqrt{-1}=i is a “number”, that satisfies

\varepsilon^2 = 0

while we insist that \varepsilon\neq 0, we can do the following. We can find, by Taylor expanding, f(x+\varepsilon) to be

f(x+\varepsilon) = f(x) + \varepsilon f'(x) + \mathcal{O}(\varepsilon^2).

We keep only the first order, since anything of order \varepsilon^2 is necessarily 0. Why? Well, that’s how we defined it! So, we are then left with

f(x+\varepsilon) = f(x) + \varepsilon f'(x)

which can be thought of as sort of intuitively if we rearrange this to look look like

f(x+\varepsilon) - f(x) = \varepsilon f'(x).

This should remind everyone of the definition of a derivative, if only we could divide through by \varepsilon. But, we don’t know if the inverse of \varepsilon exists, so we cannot do it.

What does this mean? Well, the intuition of \varepsilon is that it is an “infinitesimal” or “a very tiny amount”. So we have for some “sufficiently small amount”

f(x + \text{some tiny amount}) - f(x) = (\text{some tiny amount}) f'(x)

which is superb. The left hand side can be thought of as a sort of “really small deformation” of f(x). It turns out that this is equal to the derivative of f at x times the “really small deformation of x“. This is quite
beautiful.

But it is quite problematic. Wouldn’t the very definition of \varepsilon be inconsistent? Since

\sqrt{\varepsilon^2} = \varepsilon = 0?

Well, as always, yes and no. Yes, this is a bit of a problem, and many have railed against it (ranging from bloggers to the Church). No, this is no problem, as long as the square root operation is not defined for \varepsilon alone. In fact, we could use matrices instead of numbers to have

\varepsilon = \begin{bmatrix}0 & 1\\ 0 & 0\end{bmatrix}

which is a nilpotent matrix, so when we square it, it vanishes as desired. We also set 1=I to be the identity matrix to make everything work out. But this is still a bit irritating. How do we do anything productive?

We can do something really clever instead. We can say, let \delta x be some variable or perhaps a function. Then we can have

\displaystyle\left.\frac{d}{ds} f(x+s\delta x)\right|_{s=0} = f'(x)\delta x

which is precisely what we had when we wrote

f(x+\varepsilon)-f(x)=\varepsilon f'(x)

making the switch of \varepsilon for \delta x.

But there is a subtlety here — we introduced a dummy parameter s. What is it? How should we interpret it? This is worth a book in and of itself, but for the time being just think of it as a sort of dummy parameter used to find the “deformation” of f with respect to x.

This is nice and cute for one dimensional functions, but what about e.g. f(x,y)? Well, we do the same song and dance, we just have

\displaystyle\left.\frac{d}{ds}f(x+s\delta x, y+s\delta y)\right|_{s=0} = \left.\frac{\partial f}{\partial (x+s\delta x)}\frac{d(x+s\delta x)}{ds}\right|_{s=0} + \left.\frac{\partial f}{\partial (y+s\delta y)}\frac{d(y+s\delta y)}{ds}\right|_{s=0}

This reduces to

\displaystyle\left.\frac{d}{ds}f(x+s\delta x, y+s\delta y)\right|_{s=0} = \frac{\partial f(x,y)}{\partial x}\delta x + \frac{\partial f(x,y)}{\partial y}\delta y.

So we are happy, we found a generalization for two dimensions. We can further generalize this to n dimensions by merely summing over the number of dimensions and taking the partial derivative with respect to the k^{th} dimension and multiplying it by \delta x_{k} where x_k indicates that it is the k^{th} coordinate we are differentiating with respect to. This should look familiar, remember when we have the differential of f, we take

\displaystyle\frac{df(x,y)}{dt} = \frac{\partial f(x,y)}{\partial x}\frac{dx}{dt} + \frac{\partial f(x,y)}{\partial y}\frac{dy}{dt}.

If, being physicists, we just multiply through by dt, we find

\displaystyle df = \frac{\partial f(x,y)}{\partial x}dx + \frac{\partial f(x,y)}{\partial y}dy

where dx = (dx/dt)dt, dy = (dy/dt)dt. This is remarkably similar to what we have, if we replace dx\to\delta x, etc. Why not run with it? See what happens!

I am tempted to introduce Grassmann algebras, and show that the exterior derivative could be set up using noncommuting variables allowing us to have the rule d^2f=0, but I will resist this urge for now. We should just bear in mind that we really only do this once, if we do the exterior derivative (find df) twice, we get 0. There is a bunch of other technical conditions when working with differential forms that we need to bear in mind, such as noncommutativity, etc. For now, do not worry about it, it is not necessary to continue on.

I will end the work here and continue on another time, to discuss Classical Mechanics directly.

17 November 2008

Lecture Notes Four: A Panicked Introduction to Fourier Series and the Fourier Transform

Readme first! I am still in the process of revising these notes, and I have posted my first version, and the vastly updated revision.

Alrighty, in this epic tome I introduced the Fourier series. I reviewed the Gibbs phenomena, when we have discontinuities the partial sums appear to sort of “overshoot” the function near the discontinuities; the Fourier series converges everywhere else except at the discontinuous points if there are countably many discontinuities and if the function is C^{1}. I then introduced the Fourier transform as a sort of generalization of the Fourier Series when we take the interval from [-\ell, \ell] under the limit \ell\to\infty giving us the interval (-\infty,+\infty) which is unbounded. In general, when we have unbounded intervals, we use Fourier transforms; when we have bounded intervals, we have the Fourier series.

At any rate, I didn’t get to any real application unfortunately. That will be next time! I did refer to two free sets of lecture notes available on the math.ucdavis.edu site; one is the “Advanced Linear Algebra” lecture notes (the math 67 text), the other is the graduate level analysis book (which is freely available online).

Download (fourth(?) version) my lecture notes. As always, comments welcome! (Addendum I’ve just finished a great deal of notes on Fourier transforms and Fourier series, so I’ve made the notes “beta version” but still under construction!)

Next time I think I will give a few examples of using the Fourier series and transform to solve various differential equations, or just jump ahead to the Spherical Harmonics and Legendre Polynomials…the professor really is racing along quite well. Addendum (3 January 2009) I’ve covered a number of things, and I think that I will try to get to spherical harmonics next, but I am also typing up my notes on abstract algebra. I think that my notes on abstract algebra are rather straightforward and really quite keen, but I don’t know whether it’ll be coherent enough. I’ve got plenty of examples, and loosely follow Serge Lang’s book Algebra. When I am done with group theory, I’ll upload those notes.

12 November 2008

Lecture Notes Three: A different Approach to the Residue Theorem

I’ve been so unsatisfied with every proof of the residue theorem, it really does just look like magic! So I tried doing it slightly differently, in a way that is to me straightforward and logical.

Unfortunately, however, I didn’t get to evaluating definite integrals or infinite sums using residues so I had me a good cry :’( Next time I’ll get there! Then that will be it for complex analysis! I’ll begin discussing thinking of functions as vectors, Fourier analysis, and…other stuff!

At any rate, download my lecture notes. The rough outline is: singularities and poles, messing with the region of integration in complex variables, the residue theorem, then the Cauchy integral formulas.

I think when I get done with my next batch of notes on complex analysis, I’ll also upload a version which includes the other two notes on complex analysis.

As always…Comments Welcome!

Update

The professor has decided to replace quality with quantity. Why, just yesterday he got to second quantization! He asks the class “You’ve done this in Physics 9D right?” I turn to one of my study buddies and say “Yeah, we did this in sixth grade.” I think the professor took me seriously, so I’m gonna skip ahead to Fourier Analysis, spherical harmonics, etc. next…

10 November 2008

Lecture Notes Two: An Introduction to Complex Analysis

I’ve been quickly writing up notes on complex analysis, and here is the first batch of notes on complex analysis. I cover analytic functions and basic contour integration. I haven’t gotten to meremorphic functions yet, nor the Residue theorem, so you’ll have to wait until next time to see them…

Here are the lecture notes, and as always comments are welcome and appreciated :)

Next bat time, the topics covered will be: the deformation theorem and homotopy stuff, residues and meromorphic functions, and how to evaluate definite integrals and infinite sums.

Changelog:
* Updated the title

P.S.

Since our classical mechanics book uses limericks, for some strange reason, I have been inspired to post one of my very own:

‘It seems to me that limericks
should really contain no physics
its content ought to be
full of vulgarity
instead of physics principles basic.’

Eat it Morin!

6 November 2008

Lecture Notes One: An Introduction to Matrix Groups

Since the mathematical methods of physics course is thus far entirely complex analysis and not really geared towards undergrads, I wrote up some ancient lecture notes. So here are my lecture notes, comments are welcome.

Download my lecture notes.

I will probably be covering complex analysis, followed by differential equations and (“God willing”) differential geometry from there! Anyways, enjoy these notes and comments are welcome!

2 November 2008

Lazy Tiddlywiki Notebook Tutorial…

Suppose you want your own e-notebook because you can email it around to yourself as opposed to lugging around loose paper or fearing your notebook being torn to shreds or something. The best solution (best here meaning “requiring least work for most satisfaction”, i.e. laziest) would be TiddlyWiki.

So, what you do is you download it (you have to go to their website to do that).

What I do is I create a directory “TemplateNotebook”, then move the empty.html file into it. I also rename it to be notebook.html or Template.html or something. I will refer to ~/TemplateNotebook as the directory where the notebook’s in. (The reason I have a template notebook is so I can have one for scratch work, one for lecture notes, one for notes on papers and books, etc.)

Since I’m a mathematical physicist, I download jsMath and unzip it to a folder ~/TemplateNotebook/jsMath. You also need to install the TeX Fonts by making a directory ~/TemplateNotebook/jsMath/fonts and extracting them into it. This way I can use LaTeX in my notes.

Now, how to install a plugin? It seems complicated, no? Well it’s simple, you can simply “edit” the “tiddler” on the website involving the LaTeX plugin, copy and paste into a tiddler on your wiki.

So to sum up: get jsMath, extract it and put it in a folder in your wiki’s folder, get the TeX fonts, put it in the /jsMath/fonts/ directory, and then create a “tiddler” (wiki entry). You really only need to copy/paste the following code:

//{{{

// AJAX code adapted from http://timmorgan.org/mini
// This is already loaded by ziddlywiki...
if(typeof(window["ajax"]) == "undefined") {
  ajax = {
      x: function(){try{return new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e){return new XMLHttpRequest()}}},
      gets: function(url){var x=ajax.x();x.open('GET',url,false);x.send(null);return x.responseText}
  }
}

// Load jsMath
jsMath = {
  Setup: {inited: 1},          // don't run jsMath.Setup.Body() yet
  Autoload: {root: new String(document.location).replace(/[^\/]*$/,'jsMath/')}  // URL to jsMath directory, change if necessary
};
var jsMathstr;
try {
  jsMathstr = ajax.gets(jsMath.Autoload.root+"jsMath.js");
} catch(e) {
  alert("jsMath was not found: you must place the 'jsMath' directory in the same place as this file.  "
       +"The error was:\n"+e.name+": "+e.message);
  throw(e);  // abort eval
}
try {
  window.eval(jsMathstr);
} catch(e) {
  alert("jsMath failed to load.  The error was:\n"+e.name + ": " + e.message + " on line " + e.lineNumber);
}
jsMath.Setup.inited=0;  //  allow jsMath.Setup.Body() to run again

// Define wikifers for latex
config.formatterHelpers.mathFormatHelper = function(w) {
    var e = document.createElement(this.element);
    e.className = this.className;
    var endRegExp = new RegExp(this.terminator, "mg");
    endRegExp.lastIndex = w.matchStart+w.matchLength;
    var matched = endRegExp.exec(w.source);
    if(matched) {
        var txt = w.source.substr(w.matchStart+w.matchLength,
            matched.index-w.matchStart-w.matchLength);
        if(this.keepdelim) {
          txt = w.source.substr(w.matchStart, matched.index+matched[0].length-w.matchStart);
        }
        e.appendChild(document.createTextNode(txt));
        w.output.appendChild(e);
        w.nextMatch = endRegExp.lastIndex;
    }
}

config.formatters.push({
  name: "displayMath1",
  match: "\\\$\\\$",
  terminator: "\\\$\\\$\\n?", // 2.0 compatability
  termRegExp: "\\\$\\\$\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

config.formatters.push({
  name: "inlineMath1",
  match: "\\\$",
  terminator: "\\\$", // 2.0 compatability
  termRegExp: "\\\$",
  element: "span",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

var backslashformatters = new Array(0);

backslashformatters.push({
  name: "inlineMath2",
  match: "\\\\\\\(",
  terminator: "\\\\\\\)", // 2.0 compatability
  termRegExp: "\\\\\\\)",
  element: "span",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

backslashformatters.push({
  name: "displayMath2",
  match: "\\\\\\\[",
  terminator: "\\\\\\\]\\n?", // 2.0 compatability
  termRegExp: "\\\\\\\]\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

backslashformatters.push({
  name: "displayMath3",
  match: "\\\\begin\\{equation\\}",
  terminator: "\\\\end\\{equation\\}\\n?", // 2.0 compatability
  termRegExp: "\\\\end\\{equation\\}\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

// These can be nested.  e.g. \begin{equation} \begin{array}{ccc} \begin{array}{ccc} ...
backslashformatters.push({
  name: "displayMath4",
  match: "\\\\begin\\{eqnarray\\}",
  terminator: "\\\\end\\{eqnarray\\}\\n?", // 2.0 compatability
  termRegExp: "\\\\end\\{eqnarray\\}\\n?",
  element: "div",
  className: "math",
  keepdelim: true,
  handler: config.formatterHelpers.mathFormatHelper
});

// The escape must come between backslash formatters and regular ones.
// So any latex-like \commands must be added to the beginning of
// backslashformatters here.
backslashformatters.push({
    name: "escape",
    match: "\\\\.",
    handler: function(w) {
        w.output.appendChild(document.createTextNode(w.source.substr(w.matchStart+1,1)));
        w.nextMatch = w.matchStart+2;
    }
});

config.formatters=backslashformatters.concat(config.formatters);

window.wikify = function(source,output,highlightRegExp,tiddler)
{
    if(source && source != "") {
        if(version.major == 2 && version.minor > 0) {
            var wikifier = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler);
            wikifier.subWikifyUnterm(output);
        } else {
            var wikifier = new Wikifier(source,formatter,highlightRegExp,tiddler);
            wikifier.subWikify(output,null);
        }
        jsMath.ProcessBeforeShowing();
    }
}
//}}}

Make it have the tag systemConfig. If you want to include asmath and amssymb you need to do a little more work.

You need to download msam fonts and msbm 10 fonts then use the following code instead for the latex plugin tiddler:

//{{{

// AJAX code adapted from http://timmorgan.org/mini
// This is already loaded by ziddlywiki...
if(typeof(window["ajax"]) == "undefined") {
  ajax = {
      x: function(){try{return new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e){return new XMLHttpRequest()}}},
      gets: function(url){var x=ajax.x();x.open('GET',url,false);x.send(null);return x.responseText}
  }
}

// Load jsMath
jsMath = {
  Controls: {cookie: {scale: 133}},
  Setup: {inited: 1},          // don't run jsMath.Setup.Body() yet
  Autoload: {root: new String(document.location).replace(/[^\/]*$/,'jsMath/')}  // URL to jsMath directory, change if necessary
};
var jsMathstr;
try {
  jsMathstr = ajax.gets(jsMath.Autoload.root+"jsMath.js");
} catch(e) {
  alert("jsMath was not found: you must place the 'jsMath' directory in the same place as this file.  "
       +"The error was:\n"+e.name+": "+e.message);
  throw(e);  // abort eval
}
try {
  window.eval(jsMathstr);
} catch(e) {
  alert("jsMath failed to load.  The error was:\n"+e.name + ": " + e.message + " on line " + e.lineNumber);
}
jsMath.Setup.inited=0;  //  allow jsMath.Setup.Body() to run again
jsMath.Font.Load("msam10");
jsMath.Font.Load("msbm10");

// Define wikifers for latex
config.formatterHelpers.mathFormatHelper = function(w) {
    var e = document.createElement(this.element);
    e.className = this.className;
    var endRegExp = new RegExp(this.terminator, "mg");
    endRegExp.lastIndex = w.matchStart+w.matchLength;
    var matched = endRegExp.exec(w.source);
    if(matched) {
        var txt = w.source.substr(w.matchStart+w.matchLength,
            matched.index-w.matchStart-w.matchLength);
        if(this.keepdelim) {
          txt = w.source.substr(w.matchStart, matched.index+matched[0].length-w.matchStart);
        }
        e.appendChild(document.createTextNode(txt));
        w.output.appendChild(e);
        w.nextMatch = endRegExp.lastIndex;
    }
}

config.formatters.push({
  name: "displayMath1",
  match: "\\\$\\\$",
  terminator: "\\\$\\\$\\n?", // 2.0 compatability
  termRegExp: "\\\$\\\$\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

config.formatters.push({
  name: "inlineMath1",
  match: "\\\$",
  terminator: "\\\$", // 2.0 compatability
  termRegExp: "\\\$",
  element: "span",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

var backslashformatters = new Array(0);

backslashformatters.push({
  name: "inlineMath2",
  match: "\\\\\\\(",
  terminator: "\\\\\\\)", // 2.0 compatability
  termRegExp: "\\\\\\\)",
  element: "span",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

backslashformatters.push({
  name: "displayMath2",
  match: "\\\\\\\[",
  terminator: "\\\\\\\]\\n?", // 2.0 compatability
  termRegExp: "\\\\\\\]\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

backslashformatters.push({
  name: "displayMath3",
  match: "\\\\begin\\{equation\\}",
  terminator: "\\\\end\\{equation\\}\\n?", // 2.0 compatability
  termRegExp: "\\\\end\\{equation\\}\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

// These can be nested.  e.g. \begin{equation} \begin{array}{ccc} \begin{array}{ccc} ...
backslashformatters.push({
  name: "displayMath4",
  match: "\\\\begin\\{eqnarray\\}",
  terminator: "\\\\end\\{eqnarray\\}\\n?", // 2.0 compatability
  termRegExp: "\\\\end\\{eqnarray\\}\\n?",
  element: "div",
  className: "math",
  keepdelim: true,
  handler: config.formatterHelpers.mathFormatHelper
});

// The escape must come between backslash formatters and regular ones.
// So any latex-like \commands must be added to the beginning of
// backslashformatters here.
backslashformatters.push({
    name: "escape",
    match: "\\\\.",
    handler: function(w) {
        w.output.appendChild(document.createTextNode(w.source.substr(w.matchStart+1,1)));
        w.nextMatch = w.matchStart+2;
    }
});

config.formatters=backslashformatters.concat(config.formatters);

window.wikify = function(source,output,highlightRegExp,tiddler)
{
    if(source && source != "") {
        if(version.major == 2 && version.minor > 0) {
            var wikifier = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler);
            wikifier.subWikifyUnterm(output);
        } else {
            var wikifier = new Wikifier(source,formatter,highlightRegExp,tiddler);
            wikifier.subWikify(output,null);
        }
        jsMath.ProcessBeforeShowing();
    }
}
jsMath.Extension.Require('AMSmath');
jsMath.Extension.Require('AMSsymbols');
//}}}

Then you are golden.

What I then do is create a directory /home/user/scratch and copy/paste the contents of ~/templateNotebook/ into it (renaming TemplateNotebook.html for scratchWork.html or something).

Last (But not Least!)

If one does not like to keep cookies on one’s computer, one can create a tiddler “configDefault” with tag systemConfig whose contents read

config.options.chkAnimate = false;
config.options.txtUserName = "boogeyMan"; // instead of "YourName"
config.options.txtBackupFolder = "back";

so when you clear your cookies, you will have the same default value options.

18 October 2008

Mathematical Structure of Floating Point Numbers

Floating Point Arithmetic

I am going to review a little bit the idea of floating point arithmetic, these ideas can be found in any elementary textbook on Numerical Analysis, or Knuth’s The Art of Computer Programming Volume II. When necessary I will introduce algorithms if I find them relevant…

OK, so the basic idea behind floating point is that we use a sort of generalization of the rational numbers. A rational number is a number of the form p/q where p,q\in\mathbb{Z} are integers with q being nonzero. With our fancy pants base 10 number system, we can use scientific notation to represent numbers like 214.51231 = 2.1451231\times 10^{2}, or 0.01213 = 1.213\times 10^{-2}.

Now here’s a bit of a thing we do in practice with calculations: we keep only so many digits. If we keep only 3 digits, the above two numbers become (in scientific notation) 2.14\times 10^{2} and 1.21\times 10^{-2}.

What we can also do is write these numbers as a sort of “ordered pair” (f,e) where f is the fractional part and e is the exponent part. We can translate it back to a number by the following relation

(f,e)\mapsto f\times 10^{e}

So we can translate our two numbers into this “order pair” form as:

2.14\times 10^{2}\mapsto (2.14, 2)
1.21\times 10^{-2}\mapsto (1.21, -2)

Now, in general, if we are working on a computer, we will be working with numbers in base 2. What does this mean? Well, observe we have written 2.14 and 1.21 for the fractional parts. We cannot do this on a computer, we have to translate it to base 2. I don’t know about the reader, but when I was first told this in numerical analysis, I thought “Great, how the in heck do you propose to do this?!” It’s actually quite simple. Lets translate \pi into base 2. We have \pi \approx 3.14159.

We’ll go step by step. Step One translate 3 into base 2. It is 11, because (10)_{2} = (2)_{10} where ()_b means we’re using base b, and 3-2=1 so we need to add the equivalent of 1 in base 2 which is 1. Thus 10+1=11.

Step Two The fractional part is always the hard part. I alway forget what to do, but this is the basic trick: we have 0.14159, so we simply multiply by 2:

0.14159\times 2 = 0.28318 + 0 so the first bit is 0, we multiply by 2 again
0.28318\times 2 = 0.56636 + 0 so the second bit is 0
0.56636\times 2 = 0.13272 + 1 so the third bit is 1
0.13272\times 2 = 0.26544 + 0 the fourth bit is 0
0.26544\times 2 = 0.53088 + 0 the fifth bit is 0
0.53088\times 2 = 0.06176 + 1 the sixth bit is 1
0.06176\times 2 = 0.12352 + 0 the seventh bit is 0
0.12352\times 2 = 0.24704 + 0 the eighth bit is 0
0.24704\times 2 = 0.49408 + 0 the ninth bit is 0
0.49408\times 2 = 0.98816 + 0 the tenth bit is 0
0.98816\times 2 = 0.97632 + 1 the eleventh bit is 1
0.97632\times 2 = 0.95264 + 1 the twelfth bit is 1
0.95264 \times 2 = 0.90528 + 1 the thirteenth bit is 1

And so on…as you can tell, this won’t be represented precisely in floating point. Most of the time, we get round off errors. Now, we can represent the number 3.14159 approximately in floating point as

11.0010010000111

We “normalize” so the first digit is always 1, which means we introduce an exponent

1.10010010000111\times 2^{1}

and this can be represented in our form as an ordered pair as

1.10010010000111\times 2^{1}\mapsto (1.10010010000111,1).

Of course it should be noted that because we gave up at the thirteenth bit after the decimal, our number 11.0010010000111 is really translated in base 10 to 3.141479492187500 instead of 3.14159, there is an error of 1.2\times 10^{-4} if we just take the difference between the two numbers. And of course, after normalization we find

1.10010010000111 = 1.57073974609375 in base 10.

So there is a bit of error here…If the reader is as unsatisfied with my explanation as I am, then the reader may refer to A Better Tutorial on Converting Decimal to Floating-Point.

To sum up, how can we talk mathematically about these things? Well, the ordered pair (f,e) has the fractional part which consists of some fixed number of bits, and an exponential part which consists of a fixed number of bits. Why not represent this as the direct sum of two vector spaces over \mathbb{Z}_{2}? That’s what I am going to do for all practical purposes (if this bothers you, and it may possibly bother me later, then just treat it as two tuples).

There is floating point addition/subtraction, and multiplication/division operations. We would like our floating point to be closed under both operations (in other words, if we think of these things as functions which eat in two elements in our set of floating point numbers, it should spit something out that’s a floating point number!). It’s mathematically nice that way! I won’t go into detail about floating point arithmetic, as it’s far too long for me to discuss in any effective detail. The interested reader may refer to A Book on the Subject freely available online.

Floating Point Special Numbers

There are several special numbers we include in the set of floating point numbers, in addition to the set as constructed by the ordered pair of two vectors, we have \pm\texttt{INF} and \texttt{NaN}. These are three special “numbers”. Why?

Well, suppose we divide by zero, what happens? We go to hell, but additionally we end up with \texttt{NaN}. If we end up multiplying two “really huge numbers” that can no longer be meaningfully represented by floating point, since we have only a finite number of bits, we then have \texttt{INF}. If one of those numbers is negative, we get -\texttt{INF}. There is a natural question that arises: if we use b bits for the fractional part, what’s the smallest number greater than one that we can represent that? The answer is surprisingly simple: it’s \varepsilon = 2^{-b}.

So for a floating point type with 53 bits in the fractional part, we have our \varepsilon be precisely

\varepsilon = 1.11022302462515654042363166809082031250\times 10^{-16}.

We will use half-precision in base 10 for all example purposes which has 11 digits for the fractional part and 5 digits for the exponent. Note that we can represent only 10^{16} numbers with this precisely, everything else will have roundoff error.

The Two Floating Point Operations

There are two floating point operations we are concerned with: addition and
multiplication, so lets consider both of these operations and what mathematical
structure is formed by the set of floating point numbers with a fixed number of
bits for the fractional part and the exponent part.

Addition

Let the set of floating point numbers equipped with floating point addition be denoted by (FP, \oplus).

Proposition The double (FP, \oplus) is closed under addition (it may generate infinity or \texttt{NaN} as a result).

Proposition The double (FP, \oplus) is commutative.

Proposition The double (FP, \oplus) nonassociative.

Proposition There is a unique number 0\in FP such that for any p\in FP we have p\oplus 0 = 0\oplus p = p (Existence of Additive Identity).

Remark We almost have an additive inverse for every element, except infinity and \texttt{NaN}…which is a pity. So it cannot be an Abelian group, since \oplus is not associative, nor is there always an inverse element.

Multiplication

Let us now consider the set of floating point numbers with a fixed number of bits equipped with the floating point multiplication operator (FP,\otimes).

Proposition The double (FP,\otimes) is closed under the \otimes operator.

Proposition The \otimes is commutative.

Proposition The \otimes is not necessarily associative due to use of finite bits in the fractional and exponent parts of the floating point number.

Remark The double (FP,\otimes) cannot be a monoid.

Proposition There is an element 1\in FP such that for any p\in FP we have p\otimes 1 = 1\otimes p = p (i.e. we have the multiplicative identity).

Remark The double (FP,\otimes) is unital.

Proposition The floating point multiplication operation does not distribute over the floating point addition operation, due to the finiteness of bits used in the floating point number.

Remark Sadly, due to the lack of distributivity, we cannot even have this form a nonassociative Ring. :(

Remark If we get rid of \texttt{NaN}, and insisted on the following rules to hold:

0\otimes(\pm\infty) = 0
0/0 = \infty/\infty = (-\infty)/(-\infty) = 1
(-\infty)/(\infty) = (\infty)/(-\infty) = -1
(\infty) + (-\infty) = 0

We can then have the double (FP, \oplus) be an Abelian group. Further, the double (FP, \otimes) has a multiplicative inverse. So it forms an Abelian group too. The lack of distributivity is what’s preventing this from being a nonassociative ring! Wo is me!

17 October 2008

Numerology and DNA…

This is a really short post that is a random thought I had while discussing genetics with a friend over dinner. Here’s the idea: DNA has 4 nucleotides that pair up thus as AT and CG. Now, there are 4 possible nucleotides, so lets use modular arithmetic (yep \mathbb{Z}_{4}).

If we randomly pick one of the nucleotides, e.g. A, and assign it some element in {0,1,2,3}, say 3. We then assign a weight 1 to T so the sum A+T=1+3=0 mod 4.

We consequently have C and G have weights 0 and 2 (it doesn’t matter which gets which). Observe its sum is C+G=0+2=2 mod 4.

Now DNA is a sequence of such pairs, but we have reduced it to a sequence of zeros and twos. If we normalize these values, we get a sequence of ones and zeros. Holy cow, this looks like a binary string!

Of course, DNA is such a huge source of data, you’ll probably end up with stuff like lines from Shakespeare translated to ancient Greek backwards, or some other phenomenal coincidence like that.

Just a random thought that I thought was interesting…what is also interesting is that the quadratic residue of each sequence is zero mod 4. That is:

(A+T)^2 = 0^2 = 0 mod 4

(C+G)^2 = 2^2 = 0 mod 4

Remember that if we have a number squared it is 0 or 1 mod 4. Why? Well, suppose we have an even number 2n, when we square it we get 4n which is 0 mod 4. If we have an odd number, 2n+1, then we see (2n+1)^2 = 4n^2 + 4n + 1 = 1 mod 4.

What does this mean? It means that this numerological DNA thingy involves squares of even numbers!

Perhaps if we treat it as a sort of code, there is an error-correcting mechanism built into it? Perhaps if it’s a Reed-Muller code, we can bust out some Galois theory and do some finite group analysis. Or if we treat it as a lattice, sphere packings could get involved. Or we could treat it as a sort of binary continued fraction? There’s quite a bit one can do from here!

Well, I’m exhausted, but I thought this random coincidence was worthy of note…

Post Script A thought just occurred to me too, if we treat every e.g. 16 digits (more generally N digits) as a sort of “floating point” data type, that is we have

d_0 2^0 + d_1 2^{-1} + d_2 2^{-2} + \ldots + d_{N-1}2^{1-N}

where d_1,\ldots,d_{N-1} are N consecutive ones and zeros from the genetic code. What do we have? Well, floating point numbers forms a nondistributive, commutative pseudo-Algebra (I say “pseudo-Algebra” because my intuition is that it is an algebra, but I have no proof of this). Coincidentally, the Griess Algebra is a commutative, nonassociative 8 dimensional algebra…perhaps one can contrive some sort of connection between DNA and the Griess algebra?

Remark: Next time I’ll ramble on about the floating point arithmetic as a formal algebra, or whatever it is. I’ll try to provide some pseudo-rigorous proofs…

7 September 2008

Book Review: Peskin and Schroeder’s “An Introduction to Quantum Field Theory”

I’ve been doing a lot of work recently just on a toy model, but I wanted to do a book review. I think I shall discuss Peskin and Schroeder’s An Introduction to Quantum Field Theory, since I have been studiously working out every problem in it just for fun (yeah, I’m weird, I do every problem in the books I read). (If you are a poor college student, you can find free lecture notes that cover essentially the entire book written very well by Dr Osborn…did I mention, it’s free?)

It’s neatly divided into three parts, dealing with a seeming historical introduction to the subject (starting with the Klein Gordon and Dirac equations, then getting to some QED); renormalization; and non-abelian gauge theory (respectively).

The writing style is very peculiar…kind of like Karl Marx’s Das Kapital: if you don’t studiously rewrite certain sections of this book word for word in terms you understand, you’ll miss a lot from it.

This is very bad, particularly because the section on Feynman diagrams is like this! So if you are reading this book to learn quantum field theory, I would urge you to first read Griffith’s Introduction to Elementary Particles to learn Feynman diagrams (its the best introduction for Feynman diagrams in my opinion) and Mandl and Shaw’s Quantum Field Theory.

Remarks on Section One

Unfortunately, the first two chapters appear to be this way as well…but, like Kapital, once you know Feynman diagrams and have rewritten the first two chapters in terms you understand (not that it’s particularly esoteric, but because there is so much information crammed into so few words), you can sail through the rest of the book easily.

It should be noted that the book is like any other modern book on the subject, there is a line somewhere remarking on how the canonical approach using commutators and the path integral approach using action are “complimentary”…so logically, we’ll only discuss path integrals and never ever mention the canonical approach ever again in this book. I was disappointed, particularly because I prefer the canonical method of quantization!

There are some topics which are not covered in near enough detail…the topic of bound states got roughly 2 pages. To be fair, 2 references were given for further investigation (one was an entry in a book, the other was G. T. Bodwin, D. R. Yennie, and M. A. Gregorio’s Recoil effects in the hyperfine structure of QED bound states in Review of Modern Physics, volume 57, Issue 3, pages 723 – 782 (1985)).

(If anyone knows a great book on the subject, I would be delighted if they would post it!)

The introduction to Feynman diagrams was frighteningly ambiguous. It was more of a deus ex machina than anything else. But I have found it most difficult to explain using Feynman diagrams and computing them to people who know nothing about them. This “introduction” included Wick’s theorem, which is frustratingly short.

The elementary processes of quantum electrodynamics are then introduced in the next chapter followed by radiative corrections in the next two chapters. I can’t really say one way or the other whether it was done well or poorly since I was already familiar with Feynman diagrams, but I would suspect there is much frustration if one didn’t know them well.

Remarks on Section Two

I think the section on Renormalization would scare the hell out of anyone who hasn’t read Griffith’s book I recommended above, or (if one is a mathematician) someone who doesn’t know combinatorics like the back of their hand.

Oddly enough, it begins with an introduction to the use of functional methods in Quantum Field Theory. I don’t see this as being bad, but I just didn’t think it tied in too well with the theme. I enjoyed the section though, I thought it was well written.

After that chapter, we get down to business and brass tacks: renormalization! It is mildly frustrating if one doesn’t know combinatorics (while trying to explain the “systematics” of renormalization, especially counting of divergences, to my friend he asked “Where are all these factorials coming from?”). Just remember n! = number of permutations of n objects, and “n choose k” is the number of different ways to choose k objects from n objects.

Goldstone’s theorem is covered mildly well, but the notion of spontaneous symmetry breaking was not. Remember, if there is a nonzero vacuum expectation value of a given field, then it’s spontaneously broken. This was dealt with better in Stefan Pokorski’s Gauge Field Theories in my opinion.

I admittedly skipped around and had a weird mathematical background prior to getting to the next chapter on Wilson’s approach and the Renormalization group. I don’t know how well one could learn about Wilson loops without knowledge of differential geometry (how can you know about Holonomy loops?) but meh I suppose it’s not the worst thing in the world.

The notion of running constants was introduced here as well, and they did an interesting job with it…using an analogy that Sidney Coleman came up with (comparing running constants to bacteria growing on a pipe). I was content with this section, but they could have done better with the renormalization group.

I kept jumping back and forth between analyzing what they were telling me; “It is a group, not it’s not, oh yes it is, no wait it isn’t, oh wait it is…hmmmm!” That was from my scratch notes on the section. (Consequently, I left more dazed and confused than when I came, so I referred to another book to see if it is a group or not and the answer is — as best as I can make sense of it — kind of but not really.)

So be warned about the section on renormalization, it’s frightningly weird! Or, if I may quote Dante:

“ABANDON ALL HOPE, YOU WHO ENTER HERE.
These words, dark in hue, I saw inscribed
over an archway. And then I said:
‘Master, for me their meaning is hard.’
And he, as one who understood:
‘Here you must banish all distrust,
here must all cowardice be slain.

‘We have come to where I said
you would see the miserable sinners
who have lost the good of the intellect.’”

Dante was talking about renormalization, err, I mean hell. It’s so hard to tell them apart…

Remarks on Section Three

But I must confess here that I have prior familiarity with Lie Algebras and Lie Groups, so chapter 15 Non-Abelian Gauge Invariance was relatively trivial. If you know nothing of Lie Algebras, I would highly advise reading Artin’s Algebra particularly the section on Lie Algebras (that’s where I learned it!). Then, given every matrix group (particularly the ones like O(n), SO(n), SL(n), U(n), Sp(n), SU(n)) find the lie algebra. Afterwards, read Daniel Bump’s Lie Groups. Then take two courses on Lie groups…And you’re set!

So in this way I cannot really comment too much on the coverage of the quantization of non-abelian gauge theories, since it seemed straightforward to me.

Naturally, isospin was given as the historical example…but a number of new tricks were introduced which may frighten some (e.g. Faddeev-Popov ghosts and BRST quantization).

The introduction to partons and QCD was frustrating to me, at least, since they more or less found it to be “god given” rather than cover the rich history behind strong force. Why, Regge theory isn’t even mentioned one bit!

The introduction to the standard model was kind of “god given” as well, just believe really really hard that there is no reason to derive it. But if one is versed in representation theory and Lie groups, by all means try your hand at doing Dr Baez’s homework problem sets on elementary particles here. It’s actually quite fun!

But it should be noted, armed with the tools previously covered like renormalization and radiative corrections, the standard model chapters just seem like an application to a bizarre gauge group SU(3)xSU(2)xU(1). There is a lot of Hocus Pocus with the Higgs mechanism, though…I would have liked to seen a better, more thorough section on this subject. What can one do?

Overall, the book is a great stepping stone to scarier texts like Ryder or Weinberg’s books…but as an introduction ab initio I would not recommend it.

Addendum: Spinors

I was disappointed with the introduction to spinors, but this is not uncommon for me. The only real introduction is Penrose and Rindler’s Spinors and Spacetime in my opinion. But they can be intimidating for those new to them, so I would urge them to read Griffith’s book first…he covers them in a way that is pragmatic for physicists. A mathematician would cry at how closed he is, as opposed to being as general as the Spin(n) group (which is a “better” definition since it’s far more vague and general). Just my two cents on how spinors are dealt with in this book…

15 November 2007

Thomas Thiemann’s “Modern Canonical Quantum General Relativity”

Disclaimer: I’m told that many of the books that I love are considered dry, boring, long, and unexciting in the eyes of others (I certainly don’t think they are in the least!). So my opinions on this book as fascinating ought to be taken in this light. (End of disclaimer.)

I’m not sure how long ago Thomas Thiemann published his tome Modern Canonical Quantum General Relativity but I picked up a copy the other day when I was getting paper for my printer at the UC Davis bookstore. Please let me emphasize this is a technical monograph with the intended audience being mathematically savvy individuals, not an introductory text for the lazy layman (even the hyperactive layman may have some difficulty).

The forward is written by Christopher Isham, who gives a rather interesting personal background on his personal interest in quantum general relativity stemming from his encounter in 1969 with a researcher named Abdus Salam.
The approach taken was perturbative quantization, which Isham notes:

“The perturbative quantum field theory schemes foundered on interactable ultra-violet divergences and gave way to super-gravity — the super-symmetric extension of standard general relativity. In spute of initial optimism, this approach succumbed to the same disease and was eventually replaced by the far more ambitious superstring theories” (Forward, paragraph 2).

Isham continues to explain his interest in canonical quantum gravity and in particular the Wheeler-DeWitt equation. The Wheeler-DeWitt equation is the Hamiltonian constraint in general relativity, it is the constraint corresponding to the time re-parametrization invariance gauge. It should be unsurprising that it is nightmarishly complicated and extremely difficult to solve in its traditional form using the metric tensor as the canonical position variable.

Thomas Thiemann pioneered the Master Constraint programme and did a tremendous amount of work on the Hamiltonian constraint that deserves the utmost respect (see these technical papers for a “small” taste: “Quantum Spin Dynamics“,
Quantum Spin Dynamics II. The Kernel of the Wheeler-DeWitt Constraint Operator“,
QSD III : Quantum Constraint Algebra and Physical Scalar Product in Quantum General Relativity“,
QSD IV : 2+1 Euclidean Quantum Gravity as a model to test 3+1 Lorentzian Quantum Gravity“,
QSD V : Quantum Gravity as the Natural Regulator of Matter Quantum Field Theories“,
QSD VI : Quantum PoincarĂ© Algebra and a Quantum Positivity of Energy Theorem for Canonical Quantum Gravity“,
Quantum Spin Dynamics VIII. The Master Constraint“,
Testing the Master Constraint Programme for Loop Quantum Gravity I. General Framework“). He covers the quantum Wheeler-DeWitt equation in chapter 10 section 3 (“Derivation of the Hamiltonian Constraint Operator”) of his book.

The book is very well written (for a physics monograph). Even in the “Outline of the book”, Thiemann demonstrates a superior command of math. In this section of his book, he outlines and describes various other approaches to quantum gravity citing sources for the interested reader to read.
This is something I always appreciate in books.

Unfortunately, I am sick, so I have had plenty of time to read the book! I am however a slow reader because I’m also taking notes as I’m reading. It’s a force of habit I’ve had since I’ve started reading. This book is an excellent introduction to modern canonical quantum gravity, that is to say Loop Quantum Gravity.

It covers the steps taken to introduce the subject matter. He begins by introducing the (ADM) Hamiltonian formulation of general relativity and he does it with unparalleled clarity. Thiemann continues on this subject matter to deal with the gauge symmetries and their constraints and the geometric interpretation of these constraints. He found the Legendre transform and the gauge constraints, then gave a mathematical definition for functional differentiability (more precisely that “…a functional G: \Phi\rightarrow C is functionally differentiable at…”).

I thought “Uhoh, Thiemann’s decided to go purely mathematical with his presentation!” But this initial fear was unfounded, I am relieved to report. Thiemann provides definitions from pure math on various mathematical objects that are relevant to the topic of each chapter and future chapters. This is actually something I appreciate, it allows the book to be more self-contained.

The next topic Thiemann tackles are the philosophical issues like the problem with time, locality in a relational formalism of general relativity, and various interpretations of quantum theory. This concludes chapter 2.

So far I’m on chapter 4, but I’m fascinated with the book. It is of a high quality and I recommend it for anyone remotely interested in modern developments of canonical quantum gravity…provided the reader has knowledge of classical general relativity and quantum theory. I can’t stress how well written this book is, it certainly makes up for the lack of such high quality books on the subject (there are how many others? One? How many are there on String theory? A thousand or two?).

And now back to studying for my classes and preparing for finals.