commutator += sqa.commutator(T_A, Omu) commutator += sqa.commutator(T_V, Omu) commutator += sqa.commutator(HD_A, Omu) result = [] for t in commutator: result += sqa.normalOrder(sqa.multiplyTerms(Onu, t)) result = simplify_all(result,[deltaC, deltaA, deltaV],cumulantE4=cumulantE4) # Perturber-dependent stuff Class = 'ACVV' tensors = mussardCode.make_tensors('eeca',pttype='NEVPT',df=True) tensors.append(['S1','S1','AA','D']) tensors.append(['S2','S2','aa','D']) AllTensors,nbrTensors,nbrEqs = mussardCode.write_tensors_and_equations('NEVPT_'+Class,result,tensors,commentE3=commentE3,df=True) nbr_bVec = mussardCode.bVec(Class,AllTensors,df=True) # Write out GetMethodInfo print ' static void GetMethodInfo(FMethodInfo &Out) {' print ' Out = FMethodInfo();' print ' Out.pName = "NEVPT_'+Class+'";' print ' Out.perturberClass = "'+Class+'";' print ' Out.pSpinClass = "restricted";' print ' Out.pTensorDecls = &TensorDecls[0];' print ' Out.nTensorDecls = %i;'%(nbrTensors) print ' Out.pDomainDecls = &DomainDecls[0];' print ' Out.nDomainDecls = 1;' print ' Out.EqsRes = FEqSet(&EqsRes[0], %i, "NEVPT_%s/Res");'%(nbrEqs,Class) print ' Out.bVec = FEqSet(&bVec[0], '+str(nbr_bVec)+', "NEVPT_'+Class+'/bVec");' print ' };'
if (len(result) != 0): global_result += result print '// <Psi1_{:5} | T_{:5} > ={:5} Class:{:6}'.format(\ indExOp_Psi1[nu][-1],\ code(listtau),\ len(result),\ indExOp_H2[tau][-1]) #print '( W'+indTens_Psi1[nu][-1],code(indTens_Psi1[nu][4:8]),code(listnu),')',\ # '(' ,name ,code(indTens_H2[tau][:2]) ,code(listtau),')' #print '( W'+indTens_Psi1[nu][-1],code(indTens_Psi1[nu][4:8]),code([listnu[i] for i in [0,2,3,1]]),')',\ # '(' ,name ,code(indTens_H2[tau][:2]) ,code(listtau),')' # Write out the tensors and the equations #global_result=mussardCode.simplify_all(result,[deltaC, deltaA, deltaV],cumulantE4=cumulantE4) if len(global_result) != 0: AllTensors, nbrTensors, nbrEqs = mussardCode.write_tensors_and_equations( 'MRLCC3', global_result, tensors, commentE3=commentE3) # Write out GetMethodInfo print ' static void GetMethodInfo(FMethodInfo &Out) {' print ' Out = FMethodInfo();' print ' Out.pName = "MRLCC3";' print ' Out.pSpinClass = "restricted";' print ' Out.pTensorDecls = &TensorDecls[0];' print ' Out.nTensorDecls = %i;' % (nbrTensors) print ' Out.EqsRes = FEqSet(&EqsRes[0], %i, "MRLCC3/Res");' % ( len(global_result)) print ' };' print '};' # print '\n\n\n\n\n\n\n\n' print ''