def nlist(s, w): """ Creates a dictionary of symplectic multiplicities (n,rmax) Args: s: Symplectic irrep labes (u3State class) w: u3 label of symplectic weight (u3State class) Returns: nl: dictionary """ N = int(w.N - s.N) nl = {} if N % 2 != 0: pass #If om is a weight state in the irrep s then their N value must differ by a multiple of 2. else: #this is generating a list of possible n's such that sxn->omega if N == 2: mlt = u3.mult(s, SU3State(2, 0), w) if mlt > 0: n = U3State([2, 0, 0]) nl[n] = 1 else: for a in range( 0, N / 3 * 2 + 1, 2 ): #N/4 comes from the fact that for n to be a u3 state, n1>=n2>=n3 and even for b in range(0, N / 3 + 1, 2): if (N - a) >= (a - b) >= b: n = U3State([N - a, a - b, b]) #Calculate the multiplicity of (lambda_omega,mu_omega) in the coupling (lambda_s,mu_s)X(lambda_n,mu_n) mlt = u3.mult(s, n, w) if mlt >= 1: nl[n] = mlt return nl
def moshinsky(state1, state2, stater, statec, state, type): """ calculates the moshinsky coefficients used to transform between the two-particle and relative-center of mass frames. w1 x w2->w wr x wc->w type can be either "SU3" or "SO3" if type=="SU3": state1,state2,stater,statec,state are simply SU3State class if type=="SO3" then state1 etc are (n1,L1) where N1=2*n1+L1 and w1=SU3State(N1,0) state=L """ mosh = 0 if type == "SU3": #check SU3 coupling if u3.mult(state1, state2, state) * u3.mult(stater, statec, state) != 0: mosh = mosh_SU3(state1, state2, stater, statec, state) if type == "SO3": #check that angular momentum coupling is allowed and that N1+N2=Nr+Nc (n1, L1) = state1 (n2, L2) = state2 (nr, Lr) = stater (nc, Lc) = statec L = state if (so3.mult(L1, L2, L) != 0) and (so3.mult(Lc, Lr, L) != 0) and ( (2 * n1 + L1 + 2 * n2 + L2) == (2 * nr + Lr + 2 * nc + Lc)): mosh = mosh_SO3((n1, L1), (n2, L2), (nr, Lr), (nc, Lc), L) return mosh
def C_s1(psi2red, psi1red, r0=1): """ Reduced matrix elements of restricted C operator caculated via VCS theory args: psi2red,psi1red are reduced symplectic basis state (SpStateReduced class) r0 is the outer multiplicity of psi1redxB->psi2red (int=1) """ #Defining the U3 variables matrix = 0.0 if psi1red.check() and psi2red.check(): s = psi1red.s n2 = psi2red.n p2 = psi2red.r w2 = psi2red.w n1 = psi1red.n p1 = psi1red.r w1 = psi1red.w K2, n2itr = kmatrix(s, w2) K1, n1itr = kmatrix(s, w1) K1inv = K1**(-1) i2 = n2itr[n2, p2] j1 = n1itr[n1, p1] for nb, rb in n1itr: i1 = n1itr[nb, rb] psi1bred = SpStateReduced(s, nb, rb, w1) rbpmax = u3.mult(s, nb, w2) for rbp in range(1, rbpmax + 1): j2 = n2itr[nb, rbp] psi2bred = SpStateReduced(s, nb, rbp, w2) matrix = matrix + K2[i2, j2] * u3boson.C_s2( psi2bred, psi1bred, r0) * K1inv[i1, j1] if abs(matrix) < (10**(-13)): matrix = 0.0 return matrix
def check(self): rmax = u3.mult(self.s, self.n, self.w) check = False if self.r in range(1, rmax + 1): if self.s.check() and self.n.check() and self.w.check(): if self.n.N % 2 == 0: check = True return check
def SU3RME(self, psi2red, psi1red, r): ME = 0.0 if (self.su3Conserved == True) and (r != 1): return ME rmax = u3.mult(psi1red.w, self.u3, psi2red.w) if r > rmax: return ME if psi1red.s == psi2red.s: ME = self.RME(*(psi2red, psi1red, r)) return ME
def CoupledOperators_Sp3R(operator1, operator2, w0, r0, psi2, psi1, r0p): s = psi1.s w1 = psi1.w n1 = psi1.n r1 = psi1.r w2 = psi2.w n2 = psi2.n r2 = psi2.r matrix = 0.0 m1 = 0 m2 = 0 m3 = 0 if (w1.N + operator1.u3.N + operator2.u3.N) != w2.N: return matrix #coupling w to first tensor #Checking if operators are C operators and restricting w12 accordingly w12set = u3.couple(w1, operator2.u3) r1max = u3.mult(s, n1, w1) r2max = u3.mult(s, n2, w2) for lambdamu12 in w12set: mult1 = u3.mult(lambdamu12, operator1.u3, w2) #mult1=min(mult1max,r2max) if mult1 == 0: continue mult2 = w12set[lambdamu12] #mult2=min(mult2max, r1max) w12 = U3State(w1.N + operator2.u3.N, lambdamu12) n12set = u3boson.nlist(s, w12) if n12set == {}: continue for n12 in n12set: r12max = n12set[n12] #mult2=min(mult2max,r12max) for r12 in range(1, r12max + 1): psi12 = SpStateReduced(s, n12, r12, w12) for r1p in range(1, mult1 + 1): for r2p in range(1, mult2 + 1): matrix = matrix + (u3.U( w1, operator2.u3, w2, operator1.u3, w12, r2p, r1p, w0, r0, r0p) * operator1.SU3RME(psi2, psi12, r1p) * operator2.SU3RME(psi12, psi1, r2p)) return matrix
def C_s1(psi2red, psi1red, r0=1): matrix = 0.0 if psi2red.check() and psi1red.check(): n1 = psi1red.n n2 = psi2red.n if n2 == n1: s = psi1red.s w1 = psi1red.w r1 = psi1red.r w2 = psi2red.w r2 = psi2red.r mult1max = u3.mult(s, n1, w1) mult2max = u3.mult(s, n2, w2) for r1p in range(1, mult1max + 1): for r2p in range(1, mult2max + 1): matrix = matrix + (u3.phi(s, n1, w1, r1, r1p) * u3.phi( n1, s, w2, r2, r2p) * u3.U(n1, s, w2, SU3State( 1, 1), w1, r1p, r0, s, 1, r2p) * u3.C_su3(s)) return matrix
def CoupledOperators_Sp3R_SO3(operator1, k1, L1, operator2, k2, L2, k0, L0, psip, psi, c1=0, c2=0): matrix = 0.0 w = psi.w wp = psip.w w1 = operator1.u3 w2 = operator2.u3 lm0set = u3.couple(w1, w2) for lm0 in lm0set: k0max = so3.multk(lm0, L0) if k0max == 0: continue r0pmax = u3.mult(w, lm0, wp) r0max = lm0set[lm0] for r0 in range(1, r0max + 1): for r0p in range(1, r0pmax + 1): for k0 in range(1, k0max + 1): matrix = matrix + ( u3.W(operator2.u3, k2, L2, operator1.u3, k1, L1, lm0, k0, L0, r0, c1=c2, c2=c1) * u3.W(w, psi.k, psi.L, lm0, k0, L0, wp, psip.k, psip.L, r0p) * CoupledOperators_Sp3R(operator1, operator2, lm0, r0, psip.red(), psi.red(), r0p)) #matrix=numpy.sqrt(2*Lp+1)*matrix if abs(matrix) < (10**(-10)): matrix = 0.0 return matrix
def C_s3(psipred, psired, r0=1): """ Incorrect derivation reflected in order causing minus sign error. Need to check with Escher thesis. """ matrix = 0.0 n = psired.n np = psipred.n if np == n: s = psired.s r = psired.r w = psired.w rp = psipred.r wp = psipred.w r1max = u3.mult(s, n, wp) for r1 in range(1, r1max + 1): matrix = matrix + (u3.phi(n, s, wp, r1, rp) * u3.Z( n, s, wp, SU3State(1, 1), w, r, r0, s, 1, r1) * u3.C_su3(s)) return matrix
def P(n0, psipred, psired, r0): """ Calculates the matrix element of the polynomial of A's with u3 character n0 args: n0 is U(3) symmetry of polynomial (U3State class) psipred,psired are reduced basis states (SpStateReduced class) r0 is outer multiplicity of psired.wxA->psipred.w returns: prme which is the reduced matrix element of P (float) """ # if (n0,psipred,psired,r0) in Pdic: # prme=Pdic[n0,psipred,psired,r0] # else: prme = 0 ## Calculate the K matrix element and generating index list K, nitr = kmatrix(psired.s, psired.w) ## inverting the K matrix Kinv = K**(-1) ## calculating the Kp matrix and generating index list Kp, npitr = kmatrix(psipred.s, psipred.w) ## obtaining index of psired.n,psired.r in K matrix i = nitr[psired.n, psired.r] ## obtaining index of psipred.n,psipred.r in Kp matrix ip = npitr[psipred.n, psipred.r] # suming over index values of n1,r1 in K matrix for n1, r1, in nitr: ## obtaining index of n1,r1 in K matrix j = nitr[n1, r1] # suming over index values of n1p,r1p in Kp matrix for n1p, r0p in npitr: ## obtaining index of n1p,r1p in Kp matrix jp = npitr[n1p, r0p] ## Calculating the max multiplicity of sxn1p->wp r1pmax = u3.mult(n0, n1, n1p) ## summing over multiplicity for r1p in range(1, r1pmax + 1): ##calculating RME of P prme = prme + (Kinv[i, j] * u3.U( n0, n1, psipred.w, psired.s, n1p, r1p, r0p, psired.w, r1, r0) * coef.bcoef(n0, n1, n1p, r1p) * Kp[ip, jp]) #Pdic[n0,psipred,psired,r0]=prme return prme
def C_n_asymptotic(psi2red, psi1red, r0=1): """ Calculated reduced matrix element of the n-space C operator using the asymptotic approximation in the symplectic basis args: psi2red,psi1red are reduced symplectic basis state (SpStateReduced class) r0 is the outer multiplicity of psi1redxB->psi2red (int) """ matrix = 0.0 #check that psi2red and psi1red are good reduced symplectic states if psi2red.check() and psi1red.check(): s = psi1red.s n2 = psi2red.n p2 = psi2red.r w2 = psi2red.w n1 = psi1red.n p1 = psi1red.r w1 = psi1red.w #Calculate the K matrices for psi1red and psi2red K1, n1itr = kmatrix_asymptotic(s, w1) K2, n2itr = kmatrix_asymptotic(s, w2) #inver the psi1red K matrix K1inv = K1**(-1) #look up indices of desired K-matrix elements i2 = n2itr[n2, p2] j1 = n1itr[n1, p1] #sum over symplectic multiplicities for nb, rb in n1itr: i1 = n1itr[nb, rb] psi1bred = SpStateReduced(s, nb, rb, w1) rbpmax = u3.mult(s, nb, w2) for rbp in range(1, rbpmax + 1): j2 = n2itr[nb, rbp] psi2bred = SpStateReduced(s, nb, rbp, w2) matrix = matrix + K2[i2, j2] * u3boson.C_n( psi2bred, psi1bred, r0) * K1inv[i1, j1] # setting matrix elements whose absolute value is less than 10^(-13) to zero if abs(matrix) < (10**(-13)): matrix = 0.0 return matrix
def C_n(psi2red, psi1red, r0=1): """ Calculate the reduced matrix element of the n-space C operator in the symplectic basis args: psi2red,psi1red are reduced symplectic basis state (SpStateReduced class) r0 is the outer multiplicity of psi1redxB->psi2red (int=1) """ matrix = 0.0 #check that psi2red and psi1red are good reduced symplectic states if psi2red.check() and psi1red.check(): s = psi1red.s n2 = psi2red.n p2 = psi2red.r w2 = psi2red.w n1 = psi1red.n p1 = psi1red.r w1 = psi1red.w #compute K matrices for psi2red and psi1red K2, n2itr = kmatrix(s, w2) K1, n1itr = kmatrix(s, w1) #invert K matrix of psi1red K1inv = K1**(-1) #obtain indexes of desired K-matrix elements i2 = n2itr[n2, p2] j1 = n1itr[n1, p1] #sum over symplectic multipliciites for nb, rb in n1itr: i1 = n1itr[nb, rb] psi1bred = SpStateReduced(s, nb, rb, w1) rbpmax = u3.mult(s, nb, w2) for rbp in range(1, rbpmax + 1): j2 = n2itr[nb, rbp] psi2bred = SpStateReduced(s, nb, rbp, w2) matrix = matrix + K2[i2, j2] * u3boson.C_n( psi2bred, psi1bred, r0) * K1inv[i1, j1] if abs(matrix) < (10**(-13)): matrix = 0.0 return matrix
def B(psi2, psi1, r0=1): """ Exact RME B in the symplectic basis calculated using VCS theory args: psi2,psi1 are reduced symplectic basis states (class SpStateReduced) r0 is outer mutplicity of psi1xB->psi2 Example: s=U3([20,13,10]) wp=U3([22,15,10]) np=U3([4,0,0]) rp=1 w=U3([21,14,10]) n=U3([2,0,0]) r=1 psip=SpStateReduced(s,np,rp,wp) psi=SpStateReduced(s,n,r,w) B(psip,psi,1) returns -7.13059078469 """ #Calculate k and U for w1 and s, then k and U for s and w2. #sum over all n states for w1 but only need to sum over 3 possible n states for w2. matrix = 0.0 if psi1.check() and psi2.check(): s = psi2.s n2 = psi2.n p2 = psi2.r w2 = psi2.w n1 = psi1.n p1 = psi1.r w1 = psi1.w K2, nitr2 = kmatrix(s, w2) K1, nitr1 = kmatrix(s, w1) if K1.all() == 0 or K2.all() == 0: return matrix K2 = K2**(-1) K1inv = K1 #position of (n2,p2) in K2 matrix i2 = nitr2[n2, p2] #position of (n1,p1) in K1 matrix j1 = nitr1[n1, p1] #sum is restricted by the coupling of n2x(2,0)->n1 for m2, r2 in nitr2: j2 = nitr2[m2, r2] psim2 = SpStateReduced(s, m2, r2, w2) #first possibility for n2 given that n1X(2,0)->n2 m1set = [ U3State([m2.one() + 2, m2.two(), m2.three()]), U3State([m2.one(), m2.two() + 2, m2.three()]), U3State([m2.one(), m2.two(), m2.three() + 2]) ] for m1 in m1set: if m1.check() == True: #multiplicity of the sxm1 coupling r1max = u3.mult(s, m1, w1) #summing over m1,r1 for r1 in range(1, r1max + 1): # index for picking element of K matrix for w2 i1 = nitr1[m1, r1] psim1 = SpStateReduced(s, m1, r1, w1) matrix = matrix + K2[i2, j2] * u3boson.B( psim2, psim1) * K1inv[j1, i1] #second possibility for n2 return matrix
def smatrix(s, wp, n1p, r1p, n2p, r2p): """ Calculates the matrix element of S=K^2 and stores the calculated value in the global dictionary Sdictioanry Args: s-Symplectic irrep label (U3state class) w-symplectic weight (U3State class) (n1,r1p) and (n2,r2p) are symplectic multiplicities of w in s (U3state class, int). Examples s=U3State([20,13,10]) w=U3State([22,15,10]) n1=U3State([2,2,0]) r1=1 n2=U3State([4,0,0]) r2=1 smatrix(s,w,n1,r1,n1,r1) returns 1014.0 Smatrix(s,w,n1,r1,n2,r2) returns -28.9827534924 """#results are given in Rowe 1984 jmp 25 np1 = {} np2 = {} wnp1 = {} wnp2 = {} Sm = 0 ############################################################################################# #Check if the matrix element of S is already calculated and stored in the global dictioanry Sdictionary # if stored return matrix element otherwise calcuate the matrix element and store it. ############################################################################################# if (s, wp, n1p, r1p, n2p, r2p) in Sdictionary: Sm = Sdictionary[s, wp, n1p, r1p, n2p, r2p] return Sm ############################################################################################# #Smatrix Calculation ############################################################################################# # If wp is a bandhead the the matrix element is trivial 1 if wp == s: Sm = 1 #Otherwise, use recursion relationship to calculate S else: psi1pred = SpStateReduced(s, n1p, r1p, wp) psi2pred = SpStateReduced(s, n2p, r2p, wp) ############################################################################################ #Generating sets of n1 and n2 which will have nonzero u3boson.A_n matrix elements ############################################################################################ #set of allowed n1 n1set = [] [m1, m2, m3] = n1p.cartesian() if m1 - 2 >= m2: n1set.append(U3State([m1 - 2, m2, m3])) if m2 - 2 >= m3: n1set.append(U3State([m1, m2 - 2, m3])) if m3 - 2 >= 0: n1set.append(U3State([m1, m2, m3 - 2])) #generating list of allowed n2's n2set = [] [m1, m2, m3] = n2p.cartesian() if m1 - 2 >= m2: n2set.append(U3State([m1 - 2, m2, m3])) if m2 - 2 >= m3: n2set.append(U3State([m1, m2 - 2, m3])) if m3 - 2 >= 0: n2set.append(U3State([m1, m2, m3 - 2])) ############################################################################################ #summing over w,n1,r1,n2,r2 to obtain the matrix element of S ############################################################################################ Nw = wp.N - 2 #compute list of w labels for states that may have nonzero matrix elements of u3boson.A_n lmset = u3.couple(wp, SU3State(0, 2)) #summing over w for lm in lmset: #converging SU3State lm to U3State w w = U3State(Nw, lm) #summing over possible n1 for n1 in n1set: #checking for each s, n1, and w if (s, n1,r, w) are a state in the symplectic irrep s r1max = u3.mult(s, n1, w) if r1max == 0: continue #summing over possible for n2 in n2set: #checking for each s, n2, and w if (s, n1,r, w) are a state in the symplectic irrep s r2max = u3.mult(s, n2, w) if r2max == 0: continue #suming over r1 for r1 in range(1, r1max + 1): psi1red = SpStateReduced(s, n1, r1, w) #summing over r2 for r2 in range(1, r2max + 1): psi2red = SpStateReduced(s, n2, r2, w) #calcualting the matrix element of S via a recursion relation Sm = Sm + ( omega(n1p, wp) - omega(n1, w)) * u3boson.A( psi1pred, psi1red) * u3boson.A( psi2pred, psi2red) * smatrix( s, w, n1, r1, n2, r2) #this will be the calculation ## Sm = 2 * Sm / (wp.N - s.N) #Storing the calculated matrix element of S in a global dictionary Sdictionary[(s, wp, n1p, r1p, n2p, r2p)] = Sm return Sm
def A(psi2, psi1, r0=1): """ Exact matrix elements for Adagger Args: psi1,psi1 are reduced basis states (SpStateReduced class) r0 is outer multiplicity of coupling psi1xA->psi2 Example: s=U3State([20,13,10]) wp=U3State([22,15,10]) np=U3State([4,0,0]) rp=1 w=U3State([21,14,10]) n=U3State([2,0,0]) r=1 psip=SpStateReduced(s,np,rp,wp) psi=SpStateReduced(s,n,r,w) A(psip,psi) returns 6.272527136548157 """ #Calculate k and U for w1 and s, then k and U for s and w2. #sum over all n states for w1 but only need to sum over 3 possible n states for w2. matrix = 0.0 if r0 == 1: s = psi2.s n2 = psi2.n p2 = psi2.r w2 = psi2.w n1 = psi1.n p1 = psi1.r w1 = psi1.w K2, nitr2 = kmatrix(s, w2) K1, nitr1 = kmatrix(s, w1) if K1.all() == 0 or K2.all() == 0: return matrix K1inv = K1**(-1) #position of (n2,p2) in K2 matrix j2 = nitr2[n2, p2] #position of (n1,p1) in K1 matrix j1 = nitr1[n1, p1] #sum over all (n,p) multiplicities of w1 ######problem for m1, r1 in nitr1: i1 = nitr1[m1, r1] psim1 = SpStateReduced(s, m1, r1, w1) #first possibility for n2 m2set = [ U3State([m1.one() + 2, m1.two(), m1.three()]), U3State([m1.one(), m1.two() + 2, m1.three()]), U3State([m1.one(), m1.two(), m1.three() + 2]) ] for m2 in m2set: if m2.check() == True: r2max = u3.mult(s, m2, w2) # this is summing over su3 multiplicities of w2 multiplicities for r2 in range(1, r2max + 1): # index for picking element of K matrix for w2 i2 = nitr2[m2, r2] psim2 = SpStateReduced(s, m2, r2, w2) matrix = matrix + K2[j2, i2] * u3boson.A( psim2, psim1) * K1inv[j1, i1] return matrix
def smatrix_asymptotic(s, wp, n1p, r1p, n2p, r2p): """ Calculates the matrix element of S=K^2 using the asymptotic approxiamtion . Args: s is the symplectic irrep label (U3state class) w is the symplectic weight (U3state class) (n1,r1p) and (n2,r2p) are symplectic multiplicities of w in s. (U3State class,int) Examples s=U3State([20,13,10]) w=U3State([22,15,10]) n1=U3State([2,2,0]) r1=1 n2=U3State([4,0,0]) r2=1 smatrix_asymptotic(s,w,n1,r1,n1,r1) returns 1014.0 """ ############################################################################################# # Check if the matrix element of S is already calculated and stored in the global dictioanry Sdictionary # if stored return matrix element otherwise calcuate the matrix element and store it. ############################################################################################# if (s, wp, n1p, r1p, n2p, r2p) in SAdictionary: SmA = SAdictionary[s, wp, n1p, r1p, n2p, r2p] ############################################################################################# #Smatrix Calculation ############################################################################################# else: np1 = {} np2 = {} wnp1 = {} wnp2 = {} SmA = 0 #In asymptotic limit, off diagonal matrix elements are set to zero. if (n1p != n2p) or (r1p != r2p): SmA = 0.0 else: # If wp is a bandhead the the matrix element is trivial 1 if wp == s: SmA = 1 #Otherwise, use recursion relationship to calculate S else: ############################################################################################## #Smatrix Calculation ############################################################################################## psipred = SpStateReduced(s, n1p, r1p, wp) #Generating sets of n which will have nonzero u3boson.A_n matrix elements nset = [] nn = U3State([n1p.one() - 2, n1p.two(), n1p.three()]) if nn.check(): nset.append(nn) nn = U3State([n1p.one(), n1p.two() - 2, n1p.three()]) if nn.check(): nset.append(nn) nn = U3State([n1p.one(), n1p.two(), n1p.three() - 2]) if nn.check(): nset.append(nn) #summing over w,n,r ############################################## Nw = wp.N - 2 lmset = u3.couple(wp, SU3State(0, 2)) #generating list of w's and summing over them for lm in lmset: w = U3State(Nw, lm) #summing over n for n in nset: #checking state (s,n,r,w) is allowed for some r rmax = u3.mult(s, n, w) if rmax == 0: continue for r in range(1, rmax + 1): psired = SpStateReduced(s, n, r, w) #Calculating the asymptotic S matrix SmA = SmA + ((omega(n1p, wp) - omega(n, w)) * u3boson.A(psipred, psired) * u3boson.A(psipred, psired) * smatrix_asymptotic(s, w, n, r, n, r)) ## SmA = 2 * SmA / (n1p.N) #caching S matrix element in SAdictionary SAdictionary[s, wp, n1p, r1p, n2p, r2p] = SmA return SmA
####################################################################################################### def mosh_SO3((n1, L1), (n2, L2), (nr, Lr), (nc, Lc), L): mosh = 0 ##defining the SU(3) content of states w1 = SU3State(2 * n1 + L1, 0) w2 = SU3State(2 * n2 + L2, 0) wr = SU3State(2 * nr + Lr, 0) wc = SU3State(2 * nc + Lc, 0) # generating list of w's wset = u3.couple(w1, w2) ## summing over w in wset for w in wset: ## check that w is also in {wrxwc} if u3.mult(wr, wc, w) == 0: continue ## calculate max branching multiplicity of L in w kmax = so3.multk(w, L) ## summing over branching multplicity from 1 to kmax for k in range(1, kmax + 1): ## calculating moshinksy coefficient mosh = mosh + (u3.W(wr, 1, Lr, wc, 1, Lc, w, k, L, 1) * u3.W(w1, 1, L1, w2, 1, L2, w, k, L, 1) * mosh_SU3(w1, w2, wr, wc, w) * utils.parity(n1 + n2 + nr + nc)) return mosh #######################################################################################################
def bcoef(n1, n2, n3, r): """ Calculates the B coefficient needed for the coupling of two symplectic raising polynomials Args: n1, n2, n3: U3State class variable r: integers, coupling multiplicity of n1xn2->n3 Returns: b coefficient. For example, n1=U3State([2,2,0]) n2=U3State([2,2,0]) n3=U3State([4,2,2]) bcoef(n1,n2,n3,1) returns 1.63299316186 """ #Should probably check that the elements in the su3lib table are correct if we get multiplicity if (n1, n2, n3, r) in bdict: coef = bdict[n1, n2, n3, r] else: nset = [] coef = 0.0 n0 = U3State([0, 0, 0]) #I'm not sure why I had if n3p==[0,0,0], so I'm eliminating it for now. #if n1 or n2 is 0(0,0) then coefficient is trivial if n1 == n0 or n2 == n0: coef = 1 else: rmax = u3.mult(n1, n2, n3) m1 = n3.one() m2 = n3.two() m3 = n3.three() if (m1 - 2) >= m2: nset.append(U3State([m1 - 2, m2, m3])) if (m2 - 2) >= m3: nset.append(U3State([m1, m2 - 2, m3])) if (m3 - 2) >= 0: nset.append(U3State([m1, m2, m3 - 2])) t1 = n1.one() t2 = n1.two() t3 = n1.three() if (t1 - 2) >= t2: n1p = U3State([t1 - 2, t2, t3]) else: if (t2 - 2) >= t3: n1p = U3State([t1, t2 - 2, t3]) else: if (t3 - 2) >= 0: n1p = U3State([t1, t2, t3 - 2]) else: print("n1 not valid") n1p = 0 for np in nset: rpmax = u3.mult(n1p, n2, np) for rp in range(1, rpmax + 1): #print SU3State(2,0),n1p,n3,n2,n1,1,r,np,rp,1 coef = coef + u3boson.A_n( n3, np) * bcoef(n1p, n2, np, rp) * u3.U( SU3State(2, 0), n1p, n3, n2, n1, 1, r, np, rp, 1) coef = coef / u3boson.A_n(n1, n1p) bdict[n1, n2, n3, r] = coef return coef