Feeds:
Posts

## LaTeX Tip: Dynkin Diagrams using Tikz

Hi everyone, I’ve include the code for drawing Dynkin diagrams using Tikz package in LaTeX

\begin{center}
\begin{tikzpicture}[scale=.4]
\draw (-1,0) node[anchor=east]  {$A_n$};
\foreach \x in {0,...,5}
\draw[xshift=\x cm,thick] (\x cm,0) circle (.3cm);
\draw[dotted,thick] (0.3 cm,0) -- +(1.4 cm,0);
\foreach \y in {1.15,...,4.15}
\draw[xshift=\y cm,thick] (\y cm,0) -- +(1.4 cm,0);
\end{tikzpicture}
\end{center}

\begin{center}
\begin{tikzpicture}[scale=.4]
\draw (-1,0) node[anchor=east]  {$B_n$};
\foreach \x in {0,...,4}
\draw[xshift=\x cm,thick] (\x cm,0) circle (.3cm);
\draw[xshift=5 cm,thick,fill=black] (5 cm, 0) circle (.3 cm);
\draw[dotted,thick] (0.3 cm,0) -- +(1.4 cm,0);
\foreach \y in {1.15,...,3.15}
\draw[xshift=\y cm,thick] (\y cm,0) -- +(1.4 cm,0);
\draw[thick] (8.3 cm, .1 cm) -- +(1.4 cm,0);
\draw[thick] (8.3 cm, -.1 cm) -- +(1.4 cm,0);
\end{tikzpicture}
\end{center}

\begin{center}
\begin{tikzpicture}[scale=.4]
\draw (-1,0) node[anchor=east]  {$C_n$};
\foreach \x in {0,...,4}
\draw[xshift=\x cm,thick,fill=black] (\x cm,0) circle (.3cm);
\draw[xshift=5 cm,thick] (5 cm, 0) circle (.3 cm);
\draw[dotted,thick] (0.3 cm,0) -- +(1.4 cm,0);
\foreach \y in {1.15,...,3.15}
\draw[xshift=\y cm,thick] (\y cm,0) -- +(1.4 cm,0);
\draw[thick] (8.3 cm, .1 cm) -- +(1.4 cm,0);
\draw[thick] (8.3 cm, -.1 cm) -- +(1.4 cm,0);
\end{tikzpicture}
\end{center}

\begin{center}
\begin{tikzpicture}[scale=.4]
\draw (-1,0) node[anchor=east]  {$D_n$};
\foreach \x in {0,...,4}
\draw[xshift=\x cm,thick] (\x cm,0) circle (.3cm);
\draw[xshift=8 cm,thick] (30: 17 mm) circle (.3cm);
\draw[xshift=8 cm,thick] (-30: 17 mm) circle (.3cm);
\draw[dotted,thick] (0.3 cm,0) -- +(1.4 cm,0);
\foreach \y in {1.15,...,3.15}
\draw[xshift=\y cm,thick] (\y cm,0) -- +(1.4 cm,0);
\draw[xshift=8 cm,thick] (30: 3 mm) -- (30: 14 mm);
\draw[xshift=8 cm,thick] (-30: 3 mm) -- (-30: 14 mm);
\end{tikzpicture}
\end{center}

\begin{center}
\begin{tikzpicture}[scale=.4]
\draw (-1,0) node[anchor=east]  {$G_2$};
\draw[thick] (0 ,0) circle (.3 cm);
\draw[thick,fill=black] (2 cm,0) circle (.3 cm);
\draw[thick] (30: 3mm) -- +(1.5 cm, 0);
\draw[thick] (0: 3 mm) -- +(1.4 cm, 0);
\draw[thick] (-30: 3 mm) -- +(1.5 cm, 0);
\end{tikzpicture}
\end{center}

\begin{center}
\begin{tikzpicture}[scale=.4]
\draw (-3,0) node[anchor=east]  {$F_4$};
\draw[thick] (-2 cm ,0) circle (.3 cm);
\draw[thick] (0 ,0) circle (.3 cm);
\draw[thick,fill=black] (2 cm,0) circle (.3 cm);
\draw[thick,fill=black] (4 cm,0) circle (.3 cm);
\draw[thick] (15: 3mm) -- +(1.5 cm, 0);
\draw[xshift=-2 cm,thick] (0: 3 mm) -- +(1.4 cm, 0);
\draw[thick] (-15: 3 mm) -- +(1.5 cm, 0);
\draw[xshift=2 cm,thick] (0: 3 mm) -- +(1.4 cm, 0);
\end{tikzpicture}
\end{center}

\begin{center}
\begin{tikzpicture}[scale=.4]
\draw (-1,1) node[anchor=east]  {$E_6$};
\foreach \x in {0,...,4}
\draw[thick,xshift=\x cm] (\x cm,0) circle (3 mm);
\foreach \y in {0,...,3}
\draw[thick,xshift=\y cm] (\y cm,0) ++(.3 cm, 0) -- +(14 mm,0);
\draw[thick] (4 cm,2 cm) circle (3 mm);
\draw[thick] (4 cm, 3mm) -- +(0, 1.4 cm);
\end{tikzpicture}
\end{center}

\begin{center}
\begin{tikzpicture}[scale=.4]
\draw (-1,1) node[anchor=east]  {$E_7$};
\foreach \x in {0,...,5}
\draw[thick,xshift=\x cm] (\x cm,0) circle (3 mm);
\foreach \y in {0,...,4}
\draw[thick,xshift=\y cm] (\y cm,0) ++(.3 cm, 0) -- +(14 mm,0);
\draw[thick] (4 cm,2 cm) circle (3 mm);
\draw[thick] (4 cm, 3mm) -- +(0, 1.4 cm);
\end{tikzpicture}
\end{center}

\begin{center}
\begin{tikzpicture}[scale=.4]
\draw (-1,1) node[anchor=east]  {$E_8$};
\foreach \x in {0,...,6}
\draw[thick,xshift=\x cm] (\x cm,0) circle (3 mm);
\foreach \y in {0,...,5}
\draw[thick,xshift=\y cm] (\y cm,0) ++(.3 cm, 0) -- +(14 mm,0);
\draw[thick] (4 cm,2 cm) circle (3 mm);
\draw[thick] (4 cm, 3mm) -- +(0, 1.4 cm);
\end{tikzpicture}
\end{center}

Bye

DOX

## Table of all possible irreps of Lie groups

Last weekend, I wrote a program in SAGE that list all possible irreps of a Lie group, one specified the group (in Cartan’s classification) and the maximum sum of the Dynkin labels.

Check the notebook in here.

Since I’m not a programmer, please feel free to leave comments, specially if you find ways to optimize the program

Cheers,

DOX

## Young tableaux in LaTeX

I few month ago I was studying group theory, and the question of How to do Young tableaux in LaTeX pops up.

After question some people, ask in groups and searching in CTAN, here I present the answer, ytableau package.

#### Installation

• Get the zip package ytableau
• Open a terminal and run the following series of commands: (you’ll need sudo power)
$cd /usr/share/texmf-texlive/tex/latex/$ sudo unzip ~/Downloads/ytableau.zip \$ sudo texhash
• Now the package is ready to be used!

Check the manual, inside the zip file or on-line.

Enjoy!

Dox

From time to time when one works with operators, such as in Quantum mechanics, something like an exponential of the operator appears (this is also the case in many areas of Mathematics like group theory of differential geometry). This exponentiation of a matrix should be understood as the series expansion of the exponential.

SAGE knows how to do this exponentiation,

sage: reset()
sage: var('a,b,c', domain=RR)
sage: A = a*I*matrix([[0,1],[1,0]])
sage: B = b*I*matrix([[0,-I],[I,0]])
sage: C = c*I*matrix([[1,0],[0,-1]])
sage: A.exp()
[1/2*(e^(2*I*a) + 1)*e^(-I*a) 1/2*(e^(2*I*a) - 1)*e^(-I*a)]
[1/2*(e^(2*I*a) - 1)*e^(-I*a) 1/2*(e^(2*I*a) + 1)*e^(-I*a)]
sage: B.exp()
[   1/2*(e^(2*I*b) + 1)*e^(-I*b) -1/2*(I*e^(2*I*b) - I)*e^(-I*b)]
[ 1/2*(I*e^(2*I*b) - I)*e^(-I*b)    1/2*(e^(2*I*b) + 1)*e^(-I*b)]
sage: C.exp()
[ e^(I*c)        0]
[       0 e^(-I*c)] 

The only problem here is that, even when the relations are simple in this example, I’ve not found a trivial’ way of simplifying the matrix elements of the exponentiation, not even with the procedure post in here. I didn’t try with the rewrite package

Enjoy.

Dox

Two days ago I was trying to expand in series a lot of functions… so I ask myself, Could it be done in SAGE? It should be possible… but, How? 😛

#### Solution by Andrzej Chrzeszczyk

sage: var('r');
sage: f=2*r/sinh(2*r)
sage: f.taylor(r,0,5)
14/45*r^4 - 2/3*r^2 + 1
sage: maxima(f).powerseries('r',0)
-4*r*'sum((2^(2*i2-1)-1)*2^(2*i2-1)*bern(2*i2)*r^(2*i2-1)/
(2*i2)!,i2,0,inf)

This solution uses a power series expansion from maxima… really nice feature! Isn’t it?
Ah… and this expansion is around $r=0$.

If one would like the asymptotic expansion $r\to\infty$,

sage: maxima(f).powerseries('r',infinity)
-4*r*'sum((2^(2*i3-1)-1)*2^(2*i3-1)*bern(2*i3)*r^(2*i3-1)/
(2*i3)!,i3,0,inf)

However, note that this expansion coincides with the previous one, i.e., it’s the function itself. It couldn’t be that perfect. 😉

#### Solution by Francois Maltey

Use the Taylor command of SAGE,

• Around zero
sage: taylor (2*x/sinh(2*x), x, 0, 10)
-292/13365*x^10 + 254/4725*x^8 - 124/945*x^6 + 14/45*x^4 - 2/3*x^2 + 1
• Around infinity… a trick! change $x\mapsto 1/x$ and expand around zero 🙂
sage: taylor (2*1/x/((exp(2/x)-exp(-2/x))/2), x, 0, 12)
4*e^(-10/x)/x + 4*e^(-6/x)/x + 4*e^(-2/x)/x
• Thank you guys!

Enjoy!

Dox

## SAGE tip: rewriting expressions

Today I was calculating some stuff with the help of SAGE, and realize that the expressions got a lot (really, a lot) simpler if they where written in terms of  hyperbolic functions instead of exponentials.

$e^x = \cosh(x)+\sinh(x)$

$e^{-x} = \cosh(x)-\sinh(x)$

So I enter the sage-devel channel of IRC (freenode), but there was a lazy day around… Sunday. Therefore I decided to write to the sage-dev group on Google groups.

Francois Maltey answer my question on how to do the transformation… He has written a package that does it!

• Go to page http://wiki.sagemath.org/symbolics/rewrite
look at the second line the “attachement” (in smaller characters)
and get the most recent file.
• Then put this file in your Sage directory
In Sage, type : load “/the/good/file/in/the/good/directory’
Then call the rewrite function.
• Thank you Francois

#### Example

Suppose the path to the file is “/home/me/rewrite-xxx.sage”

sage: load "/home/me/rewrite-xxx.sage" sage: A = exp(x) + exp(-x) sage: rewrite(A, 'exp2sinhconh') 2*cosh(x)`

If you go to http://wiki.sagemath.org/symbolics/rewrite, will find all possible commands which perform such transformations.

Enjoy!

Dox