-
Notifications
You must be signed in to change notification settings - Fork 0
/
CoulombMatrixFunctions.py
51 lines (41 loc) · 1.43 KB
/
CoulombMatrixFunctions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#Coulomb matrix element functions
"""
These functions are for calculating relavent matrix elements for the Coulomb interaction between TWO electrons in the lowest
Landau level.
These formulea are taken directly from 'Composite Fermions', by J. K. Jain.
The names of the functions are the symbols given in the book for consistency.
This code is followable if one looks at these formulas.
"""
import math
import scipy
import scipy.special
import mpmath
mpmath.mp.dps = 10
#set mpmath precision
def AIntegrand(r,s,t,i):
f = mpmath.gamma
g = mpmath.factorial
x = mpmath.binomial(s,i)*(f(i+1/2)/g(r+i))*(f(1/2+r+i)/f(3/2+r+t+i))
return x
def BIntegrand(r,s,t,i):
return AIntegrand(r,s,t,i)*(1/2 + r + 2*i)
def A(r,s,t):
return sum([AIntegrand(r,s,t,i) for i in range(s+1)])
def B(r,s,t):
return sum([BIntegrand(r,s,t,i) for i in range(s+1)])
def matrixElementC(magneticLength, m1Prime, m2Prime, m1, m2):
if (m1Prime + m2Prime == m1 + m2):
if m2 >= m2Prime:
t = m2Prime
s = m1
r = m2 - t
f = mpmath.factorial
g = mpmath.gamma
x = mpmath.sqrt((f(s+r)/f(s))*(f(t+r)/f(t)))
y = g(r+s+t+3/2)/(mpmath.pi*mpmath.power(2, r+s+t+2))
z = A(r,s,t)*B(r,t,s) + B(r,s,t)*A(r,t,s)
return x*y*z/magneticLength
else:
return matrixElementC(magneticLength,m1,m2,m1Prime,m2Prime)
else:
return 0