Computer implementation and computer algebra

[15/100%]
Show
LaTeX

Give an efficient implementation of a group in C++ and LISP. For C++ use map<pair<G,G>,G> or map<G,map<G,G> > from the Standard Template Library. The map class in C++ implements a many to one relationship between keys and values. The map class is a template class map<keytype,valuetype> which can be used in similar way to arrays, i.e. m[key]=value. Consider for example the simplest non-trivial group {a,b}\left\{ a,b\right\} with group operation ⋅\cdot given by a⋅a=b⋅b=aa \cdot a = b \cdot b = a and a⋅b=b⋅a=ba \cdot b = b \cdot a = b.

?

Consider the permutation group S3S_{3}. Write a C++ program for the composition of the group elements using the map class of the Standard Template Library. Then implement the inverse of each group element. Finally we determine the conjugacy classes. The group consists of six elements which we denote by a[0],a[1],…,a[5]a[0], a[1], \ldots , a[5]. The neutral (identity) element is denoted by a[0]a[0]. Thus we have

a[0]∗a[j]=a[j]∗a[0]=a[j] a[0]*a[j] = a[j]*a[0] = a[j]

for j=0,1,…,5j=0,1,\ldots ,5.

?

Consider the 2×22 \times 2 matrix

A(α0,α1,α2)=((cos⁡α0cos⁡α1+isin⁡α0sin⁡α1)eiα2−cos⁡α0sin⁡α1+isin⁡α0cos⁡α1cos⁡α0sin⁡α1+isin⁡α0cos⁡α1(cos⁡α0cos⁡α1−isin⁡α0sin⁡α1)e−iα2) A(\alpha _{0}, \alpha _{1}, \alpha _{2}) = \begin{pmatrix} (\cos \alpha _{0}\cos \alpha _{1}+i\sin \alpha _{0}\sin \alpha _{1})e^{i\alpha _{2}} & -\cos \alpha _{0}\sin \alpha _{1}+i\sin \alpha _{0}\cos \alpha _{1} \\ \cos \alpha _{0}\sin \alpha _{1}+i\sin \alpha _{0}\cos \alpha _{1} & (\cos \alpha _{0}\cos \alpha _{1}-i\sin \alpha _{0}\sin \alpha _{1})e^{-i\alpha _{2}} \end{pmatrix}

where −π≤α0<π-\pi \leq \alpha_{0} < \pi, −π≤α1<π-\pi \leq \alpha_{1} < \pi, 0≤α2≤π0 \leq \alpha_{2} \leq \pi. Write a Computer algebra program in SymbolicC++ that calculates

∂∂αjA(α0,α1,α2)∣α0=0,α1=0,α2=0 \left. \frac{\partial }{\partial \alpha _{j}} A(\alpha _{0}, \alpha _{1}, \alpha _{2}) \right|_{\alpha _{0}=0, \alpha _{1}=0, \alpha _{2}=0}

and thus finds the generators

X0=(0ii0),X1=(0−110),X2=(i00−i). X_{0} = \begin{pmatrix} 0 & i \\ i & 0 \end{pmatrix}, \qquad X_{1} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}, \qquad X_{2} = \begin{pmatrix} i & 0 \\ 0 & -i \end{pmatrix} .

Thus

A(α0,α1,α2)=exp⁡(α0X0+α1X1+α2X2). A(\alpha _{0}, \alpha _{1}, \alpha _{2}) = \exp (\alpha _{0}X_{0}+\alpha _{1}X_{1}+\alpha _{2}X_{2}) .
?

Let α∈R\alpha \in \mathbb {R}. Given the matrix

A(α)=(cosh⁡α00sinh⁡α0cos⁡αsin⁡α00−sin⁡αcos⁡α0sinh⁡α00cosh⁡α). A(\alpha ) = \begin{pmatrix} \cosh \alpha & 0 & 0 & \sinh \alpha \\ 0 & \cos \alpha & \sin \alpha & 0 \\ 0 & -\sin \alpha & \cos \alpha & 0 \\ \sinh \alpha & 0 & 0 & \cosh \alpha \end{pmatrix} .

Write a SymbolicC++ program that calculates the vector

A(α)(x0x1x2x3) A(\alpha ) \begin{pmatrix} x_{0} \\ x_{1} \\ x_{2} \\ x_{3} \end{pmatrix}

and shows that x02+x12+x22−x32x_{0}^{2}+x_{1}^{2}+x_{2}^{2}-x_{3}^{2} is invariant.

?
?
(i)

Let LL be a three dimensional Lie algebra with basis a,b,ca, b, c and the commutation relations (simple Lie algebra so(3)\mathfrak {so}(3))

[a,b]=c,[b,c]=a,[c,a]=b . [a,b] = c, \qquad [b,c] = a, \qquad [c,a] = b \, .

Write a SymbolicC++ program to test whether the Jacobi identity is satisfied.

(ii)

Let LL be a three dimensional Lie algebra with basis a,b,ca, b, c and the commutation relations (solvable Lie algebra)

[a,b]=0,[b,c]=a+kb,[c,a]=−ka+b,k>0 . [a,b] = 0, \qquad [b,c] = a+kb, \qquad [c,a] = -ka+b, \qquad k > 0 \, .

Write a SymbolicC++ program to test whether the Jacobi identity is satisfied.

Let LL be a Lie algebra. One analyzes the structure of a Lie algebra LL by studying its ideals. A subspace II of a Lie algebra LL is called an ideal of LL if x∈Lx \in L and y∈Iy \in I together imply [x,y]∈I[x,y] \in I. If LL has no ideals except itself and 0, and if moreover [L,L]≠0[L,L] \neq 0 we call the Lie algebra LL simple.

If LL is a Lie algebra and x∈Lx \in L, the operator ad⁡X\operatorname {ad}X that maps yy to [x,y][x,y] is a linear transformation of LL into itself

(ad⁡x)y:=[x,y] . (\operatorname {ad}x)y := [x,y] \, .

Then x→ad⁡xx \to \operatorname {ad}x is a representation of the Lie algebra LL with LL itself considered as the vector space of the representation. The Killing form of a Lie algebra is the symmetric bilinear form

K(x,y):=\tr(ad⁡xad⁡y) K(x,y) := \tr (\operatorname {ad}x\operatorname {ad}y)

where \tr\tr denotes the trace. If xjx_{j} (j=0,1,…,n−1j = 0,1,\ldots ,n-1) form a basis of LL then

gjk=K(xj,xk) g_{jk} = K(x_{j},x_{k})

is called the metric tensor for LL. Note that a Lie algebra is semisimple if and only if the matrix (gjk)(g_{jk}) is nonsingular, i.e., det⁡((gjk))≠0\det ((g_{jk})) \neq 0.

We consider the simple Lie algebra so(3)\mathfrak {so}(3) with the basis elements x(0),x(1),x(2)x(0), x(1), x(2) and the commutation relations

[x(0),x(1)]=x(2),[x(1),x(2)]=x(0),[x(2),x(0)]=x(1) . [x(0),x(1)] = x(2), \qquad [x(1),x(2)] = x(0), \qquad [x(2),x(0)] = x(1) \, .

We find

ad⁡x(0)=(00000−1010),ad⁡x(1)=(001000−100), \operatorname {ad}x(0) = \begin{pmatrix} 0 & 0 & 0 \\ 0 & 0 & -1 \\ 0 & 1 & 0 \end{pmatrix}, \qquad \operatorname {ad}x(1) = \begin{pmatrix} 0 & 0 & 1 \\ 0 & 0 & 0 \\ -1 & 0 & 0 \end{pmatrix}, ad⁡x(2)=(0−10100000) . \operatorname {ad}x(2) = \begin{pmatrix} 0 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix} \, .

Write a SymbolicC++ program that calculates the metric tensor for this Lie algebra using a two-dimensional array comm(i,j) to store the commutators, and determines whether the Lie algebra is semisimple.

?

Let P={P0,P2,…,Pk−1}P = \left\{ P_0, P_2, \ldots , P_{k-1} \right\} be a semi-group of permutations on the set Ω={0,1,…,n−1}\Omega = \left\{ 0,1,\ldots ,n-1 \right\}. A semi-group is closed under the group operation, but the inverse and identity need not be a member of the set. The transitivity set (or orbit) containing i∈Ωi \in \Omega is the set of images under the action of products of elements of PP. Write a C++ program which finds the orbits given PP and Ω\Omega.

?

Let Bn\mathcal{B}_n denote the braid group on n−1n-1 strands. Bn\mathcal{B}_n is generated by the elementary braids (generators) {b1,b2,…,bn−1}\left\{ b_1, b_2, \ldots , b_{n-1} \right\} with the braid relations

bjbj+1bj=bj+1bjbj+1,1≤j<n−1, b_j b_{j+1} b_j = b_{j+1} b_j b_{j+1}, \quad 1 \leq j < n-1, bjbk=bkbj,∣j−k∣≥2. b_j b_k = b_k b_j, \quad \left|j-k\right| \geq 2 .

Actually one should better write b12,b23,…,bn−1nb_{12}, b_{23}, \ldots , b_{n-1n} instead of b1,b2,…,bn−1b_1, b_2, \ldots , b_{n-1}. Let {e→1,e→2,…,e→n}\left\{ \overrightarrow {e}_1, \overrightarrow {e}_2, \ldots , \overrightarrow {e}_n \right\} denote the standard basis in Rn\mathbb {R}^{n}. Then u→∈Rn\overrightarrow {u} \in \mathbb {R}^{n} can be written as

u→=∑k=1ncke→k,c1,c2,…,cn∈R. \overrightarrow {u} = \sum _{k=1}^{n} c_k \overrightarrow {e}_k, \quad c_1, c_2, \ldots , c_n \in \mathbb {R} .

Consider the operators BjB_j (α,β,γ,δ∈R\alpha ,\beta ,\gamma ,\delta \in \mathbb {R} and α,γ≠0\alpha ,\gamma \neq 0) defined by

Bju→:=c1e→1+…+(αcj+1+β)e→j+(γcj+1+δ)e→j+1+…+cne→n B_j \overrightarrow {u} := c_1\overrightarrow {e}_1 + \ldots + (\alpha c_{j+1}+\beta )\overrightarrow {e}_j + (\gamma c_{j+1}+\delta )\overrightarrow {e}_{j+1} + \ldots + c_n\overrightarrow {e}_n

and the corresponding inverse operation

Bj−1u→:=c1e→1+…+1γ(cj+1−δ)e→j+1α(γcj−β)e→j+1+…+cne→n. B_j^{-1} \overrightarrow {u} := c_1\overrightarrow {e}_1 + \ldots + \frac{1}{\gamma }(c_{j+1}-\delta )\overrightarrow {e}_j + \frac{1}{\alpha }(\gamma c_j-\beta )\overrightarrow {e}_{j+1} + \ldots + c_n\overrightarrow {e}_n .

Use computer algebra to show that B1,B2,…,Bn−1B_1, B_2, \ldots , B_{n-1} satisfy the braid condition

BjBj+1Bju→=Bj+1BjBj+1u→ B_j B_{j+1} B_j \overrightarrow {u} = B_{j+1} B_j B_{j+1} \overrightarrow {u}

if

γβ+δ=αδ+β. \gamma \beta + \delta = \alpha \delta + \beta .
?

Write a C++ program that generates all n×nn \times n permutation matrices. In main we use these matrices to find the permutation matrix that satisfies

P(a0000a010b00b0100b10b110a1000a11)PT=(a00a01a10a11)⊕(b00b01b10b11) P \begin{pmatrix} a_{00} & 0 & 0 & a_{01} \\ 0 & b_{00} & b_{01} & 0 \\ 0 & b_{10} & b_{11} & 0 \\ a_{10} & 0 & 0 & a_{11} \end{pmatrix} P^T = \begin{pmatrix} a_{00} & a_{01} \\ a_{10} & a_{11} \end{pmatrix} \oplus \begin{pmatrix} b_{00} & b_{01} \\ b_{10} & b_{11} \end{pmatrix}

where ⊕\oplus is the direct sum.

?

Let nn be a positive integer. There are exactly as many irreducible representations of the permutation group SnS_n as there are partitions λj\lambda_j of nn

n=λ1+λ2+⋯+λn,λ1≥λ2≥⋯≥λn≥0. n = \lambda _1+\lambda _2+\cdots +\lambda _n, \quad \lambda _1 \geq \lambda _2 \geq \cdots \geq \lambda _n \geq 0 .

For example for n=4n=4 we have the 5 partitions 4000 3100 2200 2110 1111 Let k,nk, n be positive integers. The number of partitions p(1,n)p(1,n) can be found from the recursion

p(k,n)={0if k>n1if k=np(k+1,n)+p(k,n−k)otherwise p(k,n) = \begin{cases} 0 & \text{if } k > n \\ 1 & \text{if } k = n \\ p(k+1,n)+p(k,n-k) & \text{otherwise} \end{cases}
?
(i)

Give a C++ implementation of this recursion.

(ii)

Give a recursive implementation to find the partitions.

A number of Hamilton systems can be written in the form

dLdt=[A,L](t) \frac{dL}{dt} = [A,L](t)

where LL and AA are time-dependent n×nn \times n matrices. This is called the Lax representation of the Hamilton system. We find that

dLkdt=[A,Lk](t) \frac{dL^k}{dt} = [A,L^k](t)

and the that \tr[Lk]\tr [L^k] (k=1,2,…k=1,2,\ldots) are first integrals. Consider the Hamilton function (Toda lattice)

H(p→,q→)=12(p12+p22+p32)+exp⁡(q1−q2)+exp⁡(q2−q3)+exp⁡(q3−q1). H(\overrightarrow {p},\overrightarrow {q}) = \frac{1}{2}(p_1^2+p_2^2+p_3^2) + \exp (q_1-q_2) + \exp (q_2-q_3) + \exp (q_3-q_1) .

Introducing the quantities

aj:=12exp⁡(12(qj−qj+1)),bj:=12pj a_j := \frac{1}{2}\exp \left( \frac{1}{2}(q_j-q_{j+1}) \right), \quad b_j := \frac{1}{2}p_j

and cyclic boundary conditions (i.e., q4≡q1q_4 \equiv q_1) we find that the Hamilton equations of motion take the form (with b3=0b_3 = 0)

dajdt=aj(bj−bj+1),db1dt=−2a12,db2dt=2(a12−a22),db3dt=2a22 \frac{da_j}{dt} = a_j(b_j-b_{j+1}), \quad \frac{db_1}{dt} = -2a_1^2, \quad \frac{db_2}{dt} = 2(a_1^2-a_2^2), \quad \frac{db_3}{dt} = 2a_2^2

where j=1,2j=1,2. Introducing the matrices (Lax pair)

L:=(b1a10a1b2a20a2b3),A:=(0−a10a10−a20a20) L := \begin{pmatrix} b_1 & a_1 & 0 \\ a_1 & b_2 & a_2 \\ 0 & a_2 & b_3 \end{pmatrix}, \quad A := \begin{pmatrix} 0 & -a_1 & 0 \\ a_1 & 0 & -a_2 \\ 0 & a_2 & 0 \end{pmatrix}

the equations of motion can be written as Lax representation. From LL we find the first integral as \tr[Ln]\tr [L^n], where n=1,2,…n = 1,2,\ldots, where \tr\tr denotes the trace. We obtain

\trL=b1+b2+b3,\tr[L2]=b12+b22+b32+2a12+2a22. \tr L = b_1+b_2+b_3, \quad \tr [L^2] = b_1^2+b_2^2+b_3^2+2a_1^2+2a_2^2 .

Write a SymbolicC++ program lax.cpp that finds [L,A][L,A] and shows that \tr(L)\tr (L), \tr(L2)\tr (L^2) and the determinant of LL are first integrals.

?

The nn-qubit Pauli group is defined by

Pn:={I2,σx,σy,σz}⊗n⊗{±1,±i}(1) \mathcal{P}_n := \left\{ I_2, \sigma _x, \sigma _y, \sigma _z \right\} ^{\otimes n} \otimes \left\{ \pm 1, \pm i \right\} \tag {1}

where σx,σy,σz\sigma_x, \sigma_y, \sigma_z are the 2×22\times 2 Pauli matrices and I2I_2 is the 2×22\times 2 identity matrix. The dimension of the Hilbert space under consideration is dim⁡H=2n\dim \mathcal{H} = 2^n. Thus each element of the Pauli group Pn\mathcal{P}_n is (up to an overall phase ±1,±i\pm 1,\pm i) a Kronecker product of Pauli matrices and 2×22\times 2 identity matrices acting on nn qubits. The order of the Pauli group is 22n+22^{2n+2}. Thus for n=1n=1 we have the order 16. For n=2n=2 we have order 64. Write a SymbolicC++ program that implements the Pauli group for n=2n=2.

?

Let b1†,b2†b_1^\dagger , b_2^\dagger be Bose creation operator and let II be the identity operator. The semi-simple Lie algebra su(1,1)\mathfrak {su}(1,1) is generated by

K+:=b1†b2†,K−:=b1b2,K0:=12(b1†b1+b2†b2+I) K_+ := b_1^\dagger b_2^\dagger , \quad K_- := b_1b_2, \quad K_0 := \frac{1}{2}(b_1^\dagger b_1+b_2^\dagger b_2+I)

with the commutation relations

[K0,K+]=K+,[K0,K−]=−K−,[K−,K+]=2K0. [K_0,K_+] = K_+, \quad [K_0,K_-] = -K_-, \quad [K_-,K_+] = 2K_0 .

We use the ordering K+,K−,K0K_+, K_-, K_0 for the basis. Write a computer algebra program that finds the ajoint representation for the Lie algebra.

?

The exceptional Lie algebra g2\mathfrak {g}_2 has rank 2 and dimension 14. A basis is given by

H1,H2,X1,X2,X3,X4,X5,X6,Y1,Y2,Y3,Y4,Y5,Y6 H_1, H_2, X_1, X_2, X_3, X_4, X_5, X_6, Y_1, Y_2, Y_3, Y_4, Y_5, Y_6

with the commutation relations [H1,H2]=0[H_1,H_2] = 0 and

H1=[X1,Y1],H2=[X2,Y2],[H1,X1]=2X1,[H2,X2]=2X2. H_1 = [X_1,Y_1], \quad H_2 = [X_2,Y_2], \quad [H_1,X_1] = 2X_1, \quad [H_2,X_2] = 2X_2 .

Thus

[H1,Y1]=−2Y1,[H2,Y2]=−2Y2. [H_1,Y_1] = -2Y_1, \quad [H_2,Y_2] = -2Y_2 .

Thus H1,X1,Y1H_1, X_1, Y_1 and H2,X2,Y2H_2, X_2, Y_2 each span the sub Lie algebra sl(2,C)\mathfrak {sl}(2,\mathbb {C}) of g2\mathfrak {g}_2. The commutator table for g2\mathfrak {g}_2 (Table 4.1) is, where entry (i,j)(i,j) gives [rowi,columnj][\text{row}_i, \text{column}_j] for i<ji < j and is left blank (not part of the table) otherwise:

H2X1Y1X2Y2X3Y3X4Y4X5Y5X6Y6H102X1−2Y1−3X23Y2−X3Y3X4−Y43X5−3Y500H2−X1Y12X2−2Y2X3−Y300−X5Y5X6−Y6X1H1X302X4−3Y2−3X5−2Y30Y400Y10−Y33X2−2Y42X33Y5−X4000X2H20Y100−X600Y5Y2−X10000Y6−X50X3H1+3H2−3X62Y1000Y4Y3−2X13Y600−X40X42H1+3H20−Y10Y3Y4X10X30X5H1+H20−Y2Y5X20X6H1+2H2 \begin{array}{c|ccccccccccccc}& H_2 & X_1 & Y_1 & X_2 & Y_2 & X_3 & Y_3 & X_4 & Y_4 & X_5 & Y_5 & X_6 & Y_6 \\ \hline H_1 & 0 & 2X_1 & -2Y_1 & -3X_2 & 3Y_2 & -X_3 & Y_3 & X_4 & -Y_4 & 3X_5 & -3Y_5 & 0 & 0 \\ H_2 & & -X_1 & Y_1 & 2X_2 & -2Y_2 & X_3 & -Y_3 & 0 & 0 & -X_5 & Y_5 & X_6 & -Y_6 \\ X_1 & & & H_1 & X_3 & 0 & 2X_4 & -3Y_2 & -3X_5 & -2Y_3 & 0 & Y_4 & 0 & 0 \\ Y_1 & & & & 0 & -Y_3 & 3X_2 & -2Y_4 & 2X_3 & 3Y_5 & -X_4 & 0 & 0 & 0 \\ X_2 & & & & & H_2 & 0 & Y_1 & 0 & 0 & -X_6 & 0 & 0 & Y_5 \\ Y_2 & & & & & & -X_1 & 0 & 0 & 0 & 0 & Y_6 & -X_5 & 0 \\ X_3 & & & & & & & H_1+3H_2 & -3X_6 & 2Y_1 & 0 & 0 & 0 & Y_4 \\ Y_3 & & & & & & & & -2X_1 & 3Y_6 & 0 & 0 & -X_4 & 0 \\ X_4 & & & & & & & & & 2H_1+3H_2 & 0 & -Y_1 & 0 & Y_3 \\ Y_4 & & & & & & & & & & X_1 & 0 & X_3 & 0 \\ X_5 & & & & & & & & & & & H_1+H_2 & 0 & -Y_2 \\ Y_5 & & & & & & & & & & & & X_2 & 0 \\ X_6 & & & & & & & & & & & & & H_1+2H_2 \end{array}

Note that sl(3,C)\mathfrak {sl}(3,\mathbb {C}) is a sub Lie algebra of g2\mathfrak {g}_2. Write a SymbolicC++ program that finds the adjoint representation.

?

Let b1,b2,b3b_1, b_2, b_3 be Bose annihilation operators. Show that

H1=b1†b1−b2†b2,H2=b2†b2−b3†b3 H_1 = b_1^\dagger b_1 - b_2^\dagger b_2, \quad H_2 = b_2^\dagger b_2 - b_3^\dagger b_3 E12=b1†b2,E23=b2†b3,E13=b1†b3 E_{12} = b_1^\dagger b_2, \quad E_{23} = b_2^\dagger b_3, \quad E_{13} = b_1^\dagger b_3 E21=b2†b1,E32=b3†b2,E31=b3†b1 E_{21} = b_2^\dagger b_1, \quad E_{32} = b_3^\dagger b_2, \quad E_{31} = b_3^\dagger b_1

are a representation of the Lie algebra su(3)\mathfrak {su}(3). Write a SymbolicC++ program that implements this representation.

?

References

[STH12] Steeb W., Tanski I., Hardy Y. Problems and Solutions for Groups, Lie Groups, Lie Algebras with Applications. World Scientific Publishing, 2012.