Esempio n. 1
0
def cleanup_normalordered(result, deltas):
    t0 = time.clock()
    length = len(result)
    for t in result:
        t.contractDeltaFuncs_new()
    sqa.removeVirtOps_sf(result)
    sqa.termChop(result)
    sqa.combineTerms(result)
    result2 = []
    for t in result:
        result2 += sqa.contractCoreOps_sf(t)
    for t in result2:
        t.contractDeltaFuncs_new()
    sqa.termChop(result2)
    sqa.combineTerms(result2)
    result = []
    for r in result2:
        item1 = geraldCode.replaceRepeatIndicesWithDeltas(r, deltas)
        item2 = geraldCode.replaceSingleKdeltaWithDeltas(item1, deltas)
        result.append(geraldCode.replaceAllKdeltaWithDeltas(item2, deltas))
    print 'cleanup time: (', length, '->', len(result), ')', time.clock() - t0
    del result2
Esempio n. 2
0
result = sqa.normalOrder(sqa.multiplyTerms(Op2, Op1))

# Simplify the result
for t in result:
    t.contractDeltaFuncs_new()
sqa.removeVirtOps_sf(result)
sqa.termChop(result)
sqa.combineTerms(result)
extendedR=[]
for t in result:
    extendedR += sqa.contractCoreOps_sf(t)
for t in extendedR:
    t.contractDeltaFuncs_new()
sqa.termChop(extendedR)
sqa.combineTerms(extendedR)
result = []
rdmDelta = [deltaC, deltaA, deltaV]
for r in extendedR:
    item1=geraldCode.replaceRepeatIndicesWithDeltas(r, rdmDelta)
    item2=geraldCode.replaceSingleKdeltaWithDeltas(item1, rdmDelta)
    result.append(geraldCode.replaceAllKdeltaWithDeltas(item2, rdmDelta))

# Write out the equation for A.p
print '//Number of terms : ', nbrEqs
print '  FEqInfo EqsRes[%i] = {\n'%(nbrEqs)
geraldCode.WriteCodeSimple(result, AllTensors, CommentKey)
print '\n  };'



Esempio n. 3
0
    t.contractDeltaFuncs_new()
sqa.termChop(extendedR)
sqa.combineTerms(extendedR)

#for t in extendedR:
#    print t
#print


result = []
rdmDelta = [deltaC, deltaA, deltaV]


#********this adds delta funcstion when we have repeat indices****************#
for r in extendedR:
    result.append(geraldCode.replaceRepeatIndicesWithDeltas(r, rdmDelta))



print "//Number of terms : ", len(result)

print "\tFEqInfo EqsRes[%i] = {\n"%(len(result))
geraldCode.WriteCode_lccSimple(result, AllTensors, CommentKey)
print "\n\t};"

bindex = AllTensors.index("b")
Vindex = AllTensors.index("V")
E1index = AllTensors.index("deltac")

print pDomains
print	"\tFEqInfo Overlap[4] = {"
Esempio n. 4
0
for t in extendedR4:
    t.contractDeltaFuncs_new()
sqa.termChop(extendedR4)
sqa.combineTerms(extendedR4)



result1 = []
result2 = []
result3 = []
result4 = []
rdmDelta = [deltaC, deltaA, deltaV]

#********this adds delta funcstion when we have repeat indices****************#
for r in extendedR1:
    result1.append(geraldCode.replaceRepeatIndicesWithDeltas(r, rdmDelta))
for r in extendedR2:
    result2.append(geraldCode.replaceRepeatIndicesWithDeltas(r, rdmDelta))
for r in extendedR3:
    result3.append(geraldCode.replaceRepeatIndicesWithDeltas(r, rdmDelta))
for r in extendedR4:
    result4.append(geraldCode.replaceRepeatIndicesWithDeltas(r, rdmDelta))


print "//Number of terms : ", len(result1+result2+result3+result4)


print "\tFEqInfo EqsRes[%i] = {\n"%(len(result1+result2+result3+result4))
geraldCode.WriteCode_lcc(result1, AllTensors, ["Ci", "Ap", "Aq", "Va"], "JRSB", CommentKey,"p1", "Ap1")
print "//"
geraldCode.WriteCode_lcc(result2, AllTensors, ["Ci", "Ap", "Aq", "Va"], "JRSB", CommentKey,"p1", "Ap2")