Fix sage B coefficients

Former-commit-id: 3c1f08ffdd12b5a0ceb0a0ccd5072512df0a2dc1
This commit is contained in:
Marek Nečada 2018-02-28 11:49:41 +02:00
parent a9580b7fd4
commit 4226ed86cd
1 changed files with 5 additions and 4 deletions

View File

@ -19,6 +19,7 @@ def gaunta_p(M, n, mu, nu, p): # [Xu](5)
wigner_3j(n, nu, p, 0, 0, 0) * wigner_3j(n, nu, p, M, mu, -M-mu)) wigner_3j(n, nu, p, 0, 0, 0) * wigner_3j(n, nu, p, M, mu, -M-mu))
def bCXcoeff(M, n, mu, nu, p): # [Xu](61) def bCXcoeff(M, n, mu, nu, p): # [Xu](61)
#print(M,n,mu,nu,p,file=sys.stderr)
return (-1)**(M+mu) * (2*p + 3) * sqrt( return (-1)**(M+mu) * (2*p + 3) * sqrt(
factorial(n+M) * factorial(nu+mu) * factorial(p+1-M-mu) factorial(n+M) * factorial(nu+mu) * factorial(p+1-M-mu)
/ factorial(n-M) / factorial(nu-mu) / factorial(p+1+M+mu)) * ( / factorial(n-M) / factorial(nu-mu) / factorial(p+1+M+mu)) * (
@ -32,10 +33,10 @@ def ACXcoeff(m, n, mu, nu, q): # [Xu](58)
def BCXcoeff(m, n, mu, nu, q): # [Xu](59) def BCXcoeff(m, n, mu, nu, q): # [Xu](59)
p = p_q(q,n,nu) p = p_q(q,n,nu)
return ((-1)**(m+1) * (2*nu + 1) * factorial(nu+m) * factorial(nu-mu) / ( return ((-1)**(m+1) * (2*nu + 1) * factorial(n+m) * factorial(nu-mu) / (
2 * n * (n+1) * factorial(n-m) * factorial(nu+mu)) * I**(p+1) * 2 * n * (n+1) * factorial(n-m) * factorial(nu+mu)) * I**(p+1) *
sqrt(((p+1)**2-(n-nu)**2) * ((n+nu+1)**2-(p+1)**2)) sqrt(((p+1)**2-(n-nu)**2) * ((n+nu+1)**2-(p+1)**2))
* gaunta_p(-m,n,mu,nu,p)) * bCXcoeff(-m,n,mu,nu,p))
def printACXcoeffs(lMax, file=sys.stdout): def printACXcoeffs(lMax, file=sys.stdout):
for n in IntegerRange(lMax+1): for n in IntegerRange(lMax+1):
@ -45,7 +46,7 @@ def printACXcoeffs(lMax, file=sys.stdout):
for q in IntegerRange(qmax(-m,n,mu,nu)): for q in IntegerRange(qmax(-m,n,mu,nu)):
#print(m, n, mu, nu, q, p_q(q,n,nu), file=sys.stderr) #print(m, n, mu, nu, q, p_q(q,n,nu), file=sys.stderr)
coeff= ACXcoeff(m, n, mu, nu, q); coeff= ACXcoeff(m, n, mu, nu, q);
print(N(ACXcoeff(m, n, mu, nu, q), prec=53), print(N(coeff, prec=53),
", // %d, %d, %d, %d, %d," % (m,n,mu,nu,q), ", // %d, %d, %d, %d, %d," % (m,n,mu,nu,q),
coeff, coeff,
file=file) file=file)
@ -59,7 +60,7 @@ def printBCXcoeffs(lMax, file=sys.stdout):
for q in IntegerRange(1, Qmax(-m,n,mu,nu)): for q in IntegerRange(1, Qmax(-m,n,mu,nu)):
#print(m, n, mu, nu, q, p_q(q,n,nu), file=sys.stderr) #print(m, n, mu, nu, q, p_q(q,n,nu), file=sys.stderr)
coeff= BCXcoeff(m, n, mu, nu, q); coeff= BCXcoeff(m, n, mu, nu, q);
print(N(BCXcoeff(m, n, mu, nu, q), prec=53), print(N(coeff, prec=53),
", // %d, %d, %d, %d, %d," % (m,n,mu,nu,q), ", // %d, %d, %d, %d, %d," % (m,n,mu,nu,q),
coeff, coeff,
file=file) file=file)