示例#1
0
def _paralleleval_combineLikeTerms(args):
    termSetId = args[0]
    expr = args[1]
    print ">> [MT] Combining like terms for set " + str(termSetId) + "."

    A = pt.combineLikeTerms(expr)
    return A
示例#2
0
 def tY01():
     Mup = pt.MatrixM( False, "up" )
     Mdn = pt.MatrixM( False, "dn" )
     Dup = pt.MatrixK( "up" )
     Dup.fourierTransform()
     Dup.indices = 0
     Ddn = pt.MatrixK( "dn" )
     Ddn.fourierTransform()
     Ddn.indices = 0
     A = pt.Product( [pt.CoefficientFloat( 1.0 ), pt.TermA(), pt.DetM( Mup ), pt.DetM( Mdn ), Ddn, Dup ] )
     B = pt.Product( [pt.CoefficientFloat( 2.0 ), pt.TermA(), pt.DetM( Mup ), pt.DetM( Mdn ), Dup, Ddn ] )
     C = pt.Sum( [ A, B ] )
     D = pt.combineLikeTerms( C )
     D.simplify()
     return str( D )
示例#3
0
 def tY04():
     Mup = pt.MatrixM( False, "up" )
     Mdn = pt.MatrixM( False, "dn" )
     Dup = pt.MatrixK( "up" )
     Dup.fourierTransform()
     Dup.indices = 0
     Ddn = pt.MatrixK( "dn" )
     Ddn.fourierTransform()
     Ddn.indices = 0
     A1 = pt.Product( [pt.CoefficientFloat( 1.0 ), pt.TermA(), pt.DetM( Mup ), pt.DetM( Mdn ), Ddn, Dup ] )
     A2 = pt.Product( [pt.CoefficientFloat( 9.0 ), pt.TermA(), pt.DetM( Mup ), pt.DetM( Mdn ), Dup, Dup ] )
     A3 = pt.Product( [pt.CoefficientFloat( 2.0 ), pt.TermA(), pt.DetM( Mup ), pt.DetM( Mdn ), Dup, Ddn ] )
     A4 = pt.Product( [pt.CoefficientFloat( 5.0 ), pt.TermA(), pt.DetM( Mup ), pt.DetM( Mdn ), Dup, Dup ] )
     D = pt.Sum( [ A3, A2, A4, A1 ] )
     E = pt.combineLikeTerms( D )
     E.simplify()
     return str( E )
示例#4
0
文件: main.py 项目: aloheac/amaunet
print "Indexing matrices..."
Z = pt.indexExpr(Z)

print "Computing path integral..."
Z = pt.pathIntegrateExpression(Z)

print "Expanding..."
Z = ptmt.execParallelSumExpansion(Z)
#Z = Z.getExpandedExpr()
Z.reduceTree()
Z.reduceTree()
print "Computing analytic Fourier transform..."
Z = pt.fourierTransformExpr(Z)

print "Combining like terms..."
Z = pt.combineLikeTerms(Z)
Z = ptmt.execParallelCombineLikeTerms(Z, 50)
Z.simplify()

print "Writing expressions to file..."
f = open("8thAOrderExpansionExpr.txt", 'w')
f.write(str(Z))
f.close()

f = open("8thAOrderExpansionInterpreter.txt", 'w')
f.write(ptout.outputExprToInterpreterFormat(Z))
f.close()

print Z
#KK = pt.Sum([Z.terms[-1]])
#KK = pt.fourierTransformExpr( KK )