Sunday, March 25, 2012

xTras for xAct

I'm a big fan of xAct, a tensor algebra package for Mathematica. While there are other tensor packages for Mathematica on the market, xAct is by far the best. It canonicalizes tensorial expressions blazingly fast, and its perturbation capabilities are state-of-the-art. If you've always wanted to do second-order perturbations of four-derivative curvature tensors but were afraid the actual calculation might take you some weeks, xAct is your man. It does it in a few seconds, and more importantly, doesn't mess up minus signs.

In fact, I like xAct so much, I wrote an additional package for. It's aptly called xTras, and its available over on www.xact.es/xtras. It brings some functionality that I found missing in xAct, like computing equations of motion for the metric, perturbations around AdS spaces, and Young projectors (yes, this also includes Bianchi identities).

I'll demonstrate some of the new functionality by computing the linearization of the Einstein tensor around AdS spaces. Here goes!
First, open up Mathematica, and enter the following line:
   In:    <<xAct`xTras`
This loads the xTras package (assuming you're managed to download and install it). Next we'll define a manifold and a metric:
   In:    DefConstantSymbol[dimension,PrintAs->"D"]
   In:    DefManifold[M,dimension,IndexRange[a,f]]
   In:    DefMetric[-1,g[-a,-b],CD]
We'll be doing stuff on AdS spaces, which has a constant curvature. Hence we need to define a constant symbol to indicate that curvature:
   In:    DefConstantSymbol[L]
Now we're ready to define the standard Lagrangian for gravity with a cosmological constant:
   In:    lagrangian = RicciScalarCD[] -(dimension-2)(dimension-1)L
We'd like to compute the equations of motion that follow from this Lagrangian. To do so, we first write the command
   In:    DefMetricVariation[g,h,eps]
This command makes it possible to do covariant metric variations. It also registers the command VarL, which varies Lagrangians:
   In:    eom = VarL[g[a,b]][lagrangian] //TensorCollect
Out:    \( \frac{1}{2} (2 - 3 D + D^2) L g_{ab} + R_{ab} - \frac{1}{2} g_{ab} R\)
The equations of motion should allow for AdS spaces. To check this, we first generate a list of replacement rules for curvature tensors of the covariant derivative CD on symmetric spaces:
   In:    AdSrules = SymmetricSpaceRules[CD,L]
 And indeed, the equations of motion are zero for this background:
   In:    eom /. AdSrules // ToCanonical
Out:    \( 0 \)
This means we can perturb around this solution. So without any further ado, here's the linear perturbation of the Einstein tensor:
   In:    ExpandBackground[eom, BackgroundSolution -> AdSrules] // TensorCollect
Out:    \( (l -  D l) h^{1}{}_{ab} + \frac{1}{2} (-1 + D) l g_{ab} h^{1c}{}_{c} - \frac{1}{2} \triangledown_{a}\triangledown_{b}h^{1c}{}_{c} + \frac{1}{2} \triangledown_{c}\triangledown_{a}h^{1}{}_{b}{}^{c} + \frac{1}{2} \triangledown_{c}\triangledown_{b}h^{1}{}_{a}{}^{c} \)
                                      \(- \frac{1}{2} \triangledown_{c}\triangledown^{c}h^{1}{}_{ab} - \frac{1}{2} g_{ab} \triangledown_{d}\triangledown_{c}h^{1cd} + \frac{1}{2} g_{ab} \triangledown_{d}\triangledown^{d}h^{1c}{}_{c} \)
 And that's it! Granted, we could also have done this by hand. But the power of xAct is that it can do much more complicated calculations without breaking a sweat. If we would like to know the second order pertubation of the Einstein tensor, we can simply replace the above input by ExpandBackground[eom,2,BackgroundSolution->AdSrules]. Pretty cool, right?

Monday, March 29, 2010

Affine root systems

Currently I'm working on my PhD thesis. It isn't finished yet, but I decided the following images were worth a sneak peak:


Besides looking nice, the pictures actually convey some information. They're so-called Hasse diagrams of the root systems of a few affine Lie algebras. From left to right we have the following affine algebras: (a) A1+, (b) C2+, (c) D4+, (d) A8+, (e) D7+, and (f) E7+. But luckily you don't need to fully understand the mathematical background, which is admittedly quite complicated, to enjoy their beauty.

Tuesday, February 16, 2010

Matching fonts in Keynote and LaTeX

LaTeX is great if you want to typeset documents with lots of mathematics in them, but what if you want to make presentations with lots of math? Sure, there are LaTeX packages like Beamer with which you can straightforwardly make decent looking presentations using nothing but LaTeX. But none of those packages lets you easily control where items end up on a page, make subtle changes to overall lay-out, or add some motion to your slides.

Keynote does all of those things, and a bit more. Here's for example a slide of presentation I gave some time ago:


The things in the image are all created within Keynote (not in a separate drawing program like Adobe Illustrator), and some of them are even animated. This is simply impossible to do solely with LaTeX, and that's why I've been using Keynote for quite some time now for all my presentations.

However, there was always something annoying me: the fonts in formulae I got from LaTeXiT (a small program that lets you insert LaTeX formula in Keynote) didn't match the font over the overall presentation. And if you're a typesetting nerd like me, that's pretty annoying. Luckily, I found a solution. Here's an example with both type of fonts:


The difference is subtle, but certainly noticable. The greek letters haven't changed, but the others are in the same font in the second equation. Here is how you change fonts:

  1. First, go to the LaTeXiT preferences, and change the default configuration to use xelatex instead of pdflatex:

  2. Next, add the following to the LaTeXiT preamble:

    \usepackage{mathspec}
    \usepackage{xunicode}
    \usepackage{xltxtra}
    \setmainfont{Gill Sans}
    \setmathsfont(Digits,Latin,Greek){Gill Sans}


    Be sure to change the "Gill Sans" to match whatever font you're using in Keynote.

And that's it! After restarting LaTeXiT, all new equations you'll typeset will be in the correct font. Enjoy!

Sunday, January 3, 2010

End of the year lists

2009 is behind us, which can only mean one thing: endless amounts of end-of-the-year-lists! Around this time of the year every respectable music website or blogger will produce his or her list of best albums, best singles, and whatnot. For example, have a look at the lists of  Pitchfork, Paste, and Kindamuzik (Dutch). Having compiled my list for the Vera poll, it's a small effort to also put it here. So here are my two cents for 2009:



10. Built To Spill - There is no enemy 
MP3: Hindsight

Myspace


9. Throw Me The Statue - Createresque
MP3: Ancestors

Myspace

8. Wake The President - You can't change that boy
Myspace


7. Jay Reatard - Watch me fall
MP3: Wounded

Myspace


6. The Pains Of Being Pure At Heat - s/t

Myspace

5. Sunset Rubdown - Dragonslayer

Myspace


4. Phoenix - Wolfgang Amadeus Phoenix
MP3: 1901

Myspace

3. The Maccabees - Wall of arms

Myspace

2. Dan Auerbach - Keep it hid

Myspace


1. Bill Callahan - Sometimes I wish we were an eagle

Myspace





Sunday, November 1, 2009

Mac free software list

Having updated to Snow Leopard this weekend, I once more downloaded and installed the latest version of all the free applications I use. Almost all of them were compatible with Snow Leopard, a thing I checked beforehand for only a few of them. Here's a careful selection of the apps I couldn't live without:

Internet related:
  • Adium
    The multi-protocol instant messaging client for the Mac. Handy if you have MSN, ICQ, and Google Talk accounts (like me).
  • GlimmerBlocker
    The only adblocker for Safari that isn't implemented as a hack -- this one is actually a proxy that filters out the stuff you don't want to see.
  • Transmission
    Simply the best torrent client for OS X.
  • Google Notifier + Google + Growl
    A menu bar app that notifies you when there's new mail in you Gmail inbox. The Google + Growl utility makes sure the notifications are Growl compliant.
LaTeX:
  • BasicTex
    A TeX distribution that's small (54mb) but still has all you need.
  • LaTeXiT
    Unmissable app if you quickly want to typeset formulas and paste them into, say, Keynote.
  • TeXlipse
    A plugin for Eclipse that turns it into one of the most powerful LaTeX editors around.
System tools:
  • Growl
    A notification system for Mac OS X. Many programs are capable of using it, and it's a functionality that's lacking by default in OS X.
  • USB Overdrive
    The default mouse acceleration is really crappy on OS X. USB Overdrive lets you change it according to your own tastes.
  • CDto
    CDto adds a button to Finder that opens a Terminal window and changes its active directory to the Finder directory.
Media:
  • Plex
    Plex is a home theatre app that is much more versatile than Front Row. Amongst other things, it can pull content directly from the internet to your TV.
  • Perian
    Perian adds playback support to QuickTime for a whole range of media format.
  • Flip4Mac
    Adds WMV support to QuickTime.
  • ScrobblePod
    If you've got a Last.FM account, this little app is for you. It scrobbles all your plays in iTunes.
Other:
  • Jin
    Jin is the only chess client that runs on a Mac and supports the Free Internet Chess Server. So if you're a cheap bastard like me and enjoy a game of chess, Jin is the way to go.

Wednesday, October 21, 2009

Symmetry in and of nature



In part three of "What on earth has Teake been doing for the last four years?" I'll talk a little on how symmetry appears in nature. When considering this subject, it seems natural to think of symmetric things that appear in nature. Snowflakes, like the one above, are good examples, but also flowers, the wings of butterflies, and sea stars (to name a few) all show some form of symmetry. They fall into the category "things in nature that look kind of symmetric", but in fact have little or nothing to do with the physicist's concept of the symmetry of nature.

One definition of symmetry in physics is as follows: the symmetries of nature are those transformations that do not change the laws of physics. To illustrate this concept, have a look at the following four clocks:


The first clock obviously satisfies the laws of physics. We now apply two different transformations, namely a mirror operation and a time reversal operation. Both give a clock that is distinct from the original one -- you can see the dial moving in the opposite direction. So the clock is not invariant under these transformations, and thus they are not symmetries of the clock. However, there's nothing physically wrong with a clock running in the opposite direction, apart from the fact that it's broken. Therefore parity (a fancy word for a mirror operation) and time reversal are symmetries of the laws of physics of this particular system. In general parity and time reversal are broken, but that's another story.

As a side note, you can see that the combined actions of parity (C) and time reversal (T) do leave the clock invariant, so CT is a symmetry of the clock.

This concept of symmetry is quite powerful. For instance, Special Relativity can be derived by demanding that the laws of physics are invariant under translations, rotations, and boosts (which together make the Poincaré group). Modern physics is to a large extent build on similar considerations of symmetry. So the study of group theory is not just a nice mathematical exercise; it actually has some useful applications throughout the field of physics. In the upcoming blogposts on "What on earth has Teake been doing for the last four years?" I'll try to explain how I applied some fancy group theory to even fancier things like supergravity. Stay tuned!

Tuesday, October 20, 2009

Band rebus

Can you guess what bands the images below are supposed to represent? The answers can be found after the break!

  1.  
  2.   
In case you're wondering, I made these images for a popquiz I held with some friends. It was pretty fun, not in the least because of the Lego album covers we also put in.
Anyway, the answers are ... :