In [1]:
%pylab inline
import sympy
sympy.init_printing()


Populating the interactive namespace from numpy and matplotlib

In [8]:
def mataf(h):
    'Array flatten a matrix list of appropriate dimensions'
    H=sympy.Matrix.hstack(*h[0])
    for sor in range(1,len(h)):
        H=sympy.Matrix.vstack(H,sympy.Matrix.hstack(*h[sor]))
    return H

In [9]:
S1=sympy.physics.matrices.msigma(1)
S2=sympy.physics.matrices.msigma(2)
S3=sympy.physics.matrices.msigma(3)
S0=S1*S1
N=0*S0
S=sympy.Matrix([[S1],[S2],[S3]])

In [10]:
m,th,ph,kx,ky=sympy.symbols('m theta phi kx ky',positive=True)
t,t1,t2,t3,mz=sympy.symbols('t t1 t2 t3 mz',positive=True)

In [11]:
a1=sympy.Matrix([[sqrt(3)],
           [1]])/2
a2=sympy.Matrix([[-sqrt(3)],
           [1]])/2
k=sympy.Matrix([[kx,ky]])

In [12]:
U=mataf([[N,N,N,N,t*S0,t*S0],
         [N,N,N,t*S0,t*S0,N],
         [N,N,N,t*S0,N,t*S0],
         [N,t*S0,t*S0,N,N,N],
         [t*S0,t*S0,N,N,N,N],
         [t*S0,N,t*S0,N,N,N]])
T1=mataf([[N,N,N,N,N,N],
          [N,N,N,N,N,t*S0],
          [N,N,N,N,N,N],
          [N,N,N,N,N,N],
          [N,N,N,N,N,N],
          [N,N,N,N,N,N]])
T2=mataf([[N,N,N,t*S0,N,N],
          [N,N,N,N,N,N],
          [N,N,N,N,N,N],
          [N,N,N,N,N,N],
          [N,N,N,N,N,N],
          [N,N,N,N,N,N]])
T3=mataf([[N,N,N,N,N,N],
          [N,N,N,N,N,N],
          [N,N,N,N,N,N],
          [N,N,N,N,N,N],
          [N,N,t*S0,N,N,N],
          [N,N,N,N,N,N]])

In [ ]: