コード例 #1
0
def F(w0, qbp, qb, wt, rt, tb, t, w0p, qp, q):
    """
	Calculates the F coefficient for full calculation
	rbp, rb come from initila unit tensor 
"""
    f1 = 0
    f2 = 0
    if (qp, q) == (qbp + tb, qb - t):
        f1 = (
            math.sqrt(
                utils.choose(qp, tb) * utils.choose(qb, t)
                #(1.
                #*math.factorial(qp)
                #*math.factorial(qb)
                #/math.factorial(qbp)
                #/math.factorial(tb)
                #/math.factorial(q)
                #/math.factorial(t)
            ) * u3.coupling_9lm(SU3State(0, tb), SU3State(0, t), wt.conj(), 1,
                                SU3State(qp, 0), SU3State(0, q), w0p, 1,
                                SU3State(qbp, 0), SU3State(0, qb), w0, 1, 1, 1,
                                rt))
    if ((qp, q) == (qbp + tb + t, qb)) and (wt.su3 == SU3State(t + tb, 0)):
        f2 = (math.sqrt(1. * math.factorial(qp) / math.factorial(t) /
                        math.factorial(tb) / math.factorial(qbp)) *
              u3.U(SU3State(0, t + tb), SU3State(qp, 0), w0, SU3State(0, qb),
                   SU3State(qbp, 0), 1, 1, w0p, 1, 1))
    fcoef = f1 - f2
    return fcoef
コード例 #2
0
def C_n(psipred, psired, r0=1):
    """
  Matrix element of C acting on the raising polynomial space
  """
    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
        matrix = u3.U(s, n, wp, SU3State(1, 1), w, r, r0, n, 1,
                      rp) * u3.C_su3(n)
    return matrix
コード例 #3
0
def C_n_conj(psipred, psired, r0=1):
    """
  Conjugate matrix element of Cn_weylboson
  """
    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
        matrix = utils.parity(w.pt() - wp.pt()) * numpy.sqrt(
            w.dim() / wp.dim()) * u3.U(s, n, w, SU3State(1, 1), wp, rp, 1, n,
                                       1, r) * u3.C_su3(n)
    return matrix
コード例 #4
0
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
コード例 #5
0
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
コード例 #6
0
ファイル: sp3r.py プロジェクト: yuguxingzhe/spncci
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
コード例 #7
0
def A(psipred, psired, r0=1):
    """
  Calculates (s np rp wp||a^\dagger|s n r w)

  Args:
    s: symplectic bandhead.  u3 class variable. 
    np: U(3) label for raising polynomial of final state. u3 class var. 
    rp: SU(3) outer multiplicity of s x np -> wp.  Integer var. 
    wp: U(3) label for symplectic weight of final state. u3 class var
    n: U(3) label for raising polynomail of initial state. U2 class var. 
    r: SU(3) outer mult. of s x n ->w. Integer var. 
    w: U(3) label for symplectic weight of initial state. u3 class var.

  Returns:
    Matrix element (s np rp wp||a^\dagger|s n r w).  For example 
      wp=u3([22,15,10])
      np=u3([4,0,0])
      rp=1
      w=u3([21,14,10])
      n=u3([2,0,0])
      r=1
      s=u3([20,13,10])
      A_weylboson(s,np,rp,wp,n,r,w)
    returns 
      1.12687233964
  """
    matrix = 0.0
    if r0 == 1:
        s = psired.s
        n = psired.n
        r = psired.r
        w = psired.w
        np = psipred.n
        rp = psipred.r
        wp = psipred.w
        matrix = u3.U(s, n, wp, SU3State(2, 0), w, r, 1, np, 1, rp) * A_n(
            np, n)
    return matrix
コード例 #8
0
def ccoef(n, q, np):
    """
	Calculates the C coefficients in the expansion of the raising polynomial into a single jacobi particle and remaining jacobi particles 
	nbx(q,0)->n
	Args: 
		q: even int
		n, nb: U3State or SU3State class variables 

	Returns:
		Coef, for example 
			CCoef(10,6,2,2,4,2)
		returns
			1.96396101212
	"""
    if (n, q, np) in Cdict:
        Coef = Cdict[n, q, np]
    else:
        ####################################################################
        N = n.N
        lbdaN = n.su3.lbda
        muN = n.su3.mu
        Coef = 0.0
        ## base case
        if q == 0:
            if n == np:
                Coef = 1
        ##recursion relation
        else:
            ## special case
            if n.su3 == SU3State(N, 0):
                if SU3State(N - q, 0) == np.su3:
                    Coef = math.sqrt(
                        math.factorial(N / 2) * math.factorial(q) /
                        (math.factorial(N / 2 - q / 2) * 2**
                         (q / 2))) / math.factorial(q / 2)
            ## recurance
            else:
                [m1, m2, m3] = n.cartesian()
                n2list = []
                if (m1 - 2) >= m2:
                    nb = U3State([m1 - 2, m2, m3])
                elif (m2 - 2) >= m3:
                    nb = U3State([m1, m2 - 2, m3])
                elif (m3 - 2) >= 0:
                    nb = U3State([m1, m2, m3 - 2])
                else:
                    return 0.0
                coef1 = ccoef(nb, q - 2, np) * u3.U(SU3State(
                    2, 0), SU3State(q - 2, 0), n, np, SU3State(
                        q, 0), 1, 1, nb, 1, 1) * math.sqrt(q * (q - 1) / 2.)
                ## coef2
                coef2 = 0
                [m1, m2, m3] = np.cartesian()
                ## obtain list of possible n2's
                if (m1 - 2) >= m2:
                    n2list.append(U3State([m1 - 2, m2, m3]))
                if (m2 - 2) >= m3:
                    n2list.append(U3State([m1, m2 - 2, m3]))
                if (m3 - 2) >= 0:
                    n2list.append(U3State([m1, m2, m3 - 2]))
                ## sum over possible n2's
                for n2 in n2list:
                    coef2 = coef2 + u3boson.A_n(np, n2) * ccoef(
                        nb, q, n2) * u3.Z(SU3State(q, 0), n2, n, SU3State(
                            2, 0), nb, 1, 1, np, 1, 1)
                #print n,nb
                Coef = (coef1 + coef2) / u3boson.A_n(n, nb)
            #################################################################
        Cdict[n, q, np] = Coef
    return Coef
コード例 #9
0
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