static void emitreducecode(void) { int i, j, v1, v2; set ind1, ind2; for(i=0; i<vcs.sizet; i++) parsedverts[i]=parseVertex(i,1); fermprgemit(); formblocks(&n_vrt); makeprgcode(); for(i=0; i<vcs.sizet; i++) free(parsedverts[i]); for (i = n_vrt - 1; i >= 1; i--) { v1 = prgcode[i-1][0]; v2 = prgcode[i-1][1]; ind1=vertinfo[v1-1].ind; ind2=vertinfo[v2-1].ind; r_mult(v1,v2,set_and(ind1,ind2)); vertinfo[MIN(v1,v2)-1].g5 = vertinfo[v1-1].g5 + vertinfo[v2-1].g5; vertinfo[MIN(v1,v2)-1].ind= set_aun(set_or(ind1,ind2),set_and(ind1,ind2)); } for (i = 0; i < vcs.sizet; i++) for (j = 0; j <vcs.valence[i]; j++) { int mom,np; mom=vcs.vertlist[i][j].moment; np =vcs.vertlist[i][j].partcl; if (mom>0 && prtclbase1[np].hlp == 't') { writeF("Vrt_1:=Vrt_1*(%s**2",prtclbase1[np].massidnt); if(prtclbase1[ghostmother(np)].hlp=='*') writeF(")$\n"); else writeF("-p%d.p%d)$\n",mom,mom); } } writeF("%%\n"); }
static void fermprgemit(void) { int v, v1, l, lpcount, nn; set indexs; char * vertStr, * propStr; if (nloop == 0) { gammaflag = 0; return; } gammaflag = 1; for(v=0; v<nloop; v++) for(l=0;!fermloops[v].g5 && l<fermloops[v].len;l++) if(strstr(parsedverts[fermloops[v].vv[l]-1],"G(ln,A)")) fermloops[v].g5=1; for(v=0,numberg5=0; v<nloop; v++) if(fermloops[v].g5) numberg5++; for(v=0; v<2*maxvert; v++) vertmap[v]=0; for(lpcount=0; lpcount<nloop; lpcount++) { fermloopstp * FL=&(fermloops[lpcount]); writeF("%%------- Fermion loop calculation ------- \n"); writeF(" NoSpur ln$\n"); for(nn=0; nn<FL->len; nn++) { int v=FL->vv[nn]-1, l=FL->ll[nn]-1; if(vertexes[v].r_vert) writeF("%% reversed vertex\n"); vertStr=parsedverts[v]; if(FL->spin[nn]==1) propStr=fermPropagTxt(v,l,1); else propStr=spin3_2_propagator(v,l,1); if( FL->ind[nn][0]) writeF("Index m%d;\n",FL->ind[nn][0]); writeF(" Vrt_%d:=(%s)*(%s)$\n",1+nn+lpcount,vertStr,propStr); if( FL->ind[nn][0]) writeF("RemInd m%d;\n",FL->ind[nn][0]); free(propStr); vertmap[FL->vv[nn]-1] = nn +1+ lpcount; } for (v1=1; v1<FL->len; v1++) { int l,v,s,i; indexs=set_constr(_E); for(i=0;i<FL->nint[v1];i++) { l=FL->intln[v1][i]-1; v=FL->vv[v1]-1; s=prtclbase1[vcs.vertlist[v][l].partcl].spin; if(s==2) set_add1(&indexs, vcs.vertlist[v][l].lorentz); } if(FL->ind[v1-1][1]) set_add1(&indexs,FL->ind[v1-1][1]); if(v1==FL->len-1 && FL->ind[v1][1]) set_add1(&indexs,FL->ind[v1][1]); r_mult(lpcount+1,lpcount+1 + v1,indexs); for(i=0;i<FL->nint[v1];i++) { l=FL->intln[v1][i]-1; v=FL->vv[v1]-1; s=prtclbase1[vcs.vertlist[v][l].partcl].spin; if(s==4 && prtclbase1[vcs.vertlist[v][l].partcl].hlp!='t') { char vert[10]; char*txt=tPropagator6mass4(v,l,&indexs); writeF("tProp:=(%s)/(6*%s^4)$\n",txt,prtclbase1[vcs.vertlist[v][l].partcl].massidnt); free(txt); sprintf(vert,"Vrt_%d",lpcount+1); reducemult(vert,vert,"tProp",indexs); writeF("Clear tProp$\n"); } } } /*===========================================================*/ if(numberg5 == 1 && FL->g5) { writeF( " Vrt_%d:=Sub(A=0*A,Vrt_%d)$\n" /* " Vrt_%d:=(Vrt_%d where A=>0*ZERO_)$\n"*/ ,lpcount+1,lpcount+1); numberg5 = 0; FL->g5 = 0; } /* for (k = 1; k <= strlen(FL->invrt); k++) { v1 = FL->invrt[k-1]; indexs=set_constr(_E); for (l = 1; l <= vcs.valence[v1-1]; l++) { i = vcs.vertlist[v1-1][l-1].lorentz; if(i) set_add1(&indexs,i); } vertmap[v1-1] = lpcount + 2; writeF("Vrt_%d:=%s$\n",lpcount + 2,parsedverts[v1-1]); r_mult(lpcount+1,lpcount + 2,indexs); } */ writeF(" Spur ln $\n"); writeF(" Vrt_%d:=-4*Vrt_%d$\n",lpcount+1,lpcount+1); writeF("%%\n"); writeF(" Fl%d:=Vrt_%d$\n",lpcount+1,lpcount+1); writeF("%%\n"); } for (v1 = 0; v1 < 2 * maxvert; v1++) fermmap[v1] = vertmap[v1]; writeF("%%\n"); gammaflag = 0; }
set<ThRightNormalForm> ThRightNormalForm::computeCentralizer( ) const { const Permutation omega = Permutation::getHalfTwistPermutation( theRank ); set<ThRightNormalForm> result; map< ThRightNormalForm , ThRightNormalForm > new_states; map< ThRightNormalForm , ThRightNormalForm > unchecked_states; map< ThRightNormalForm , ThRightNormalForm > checked_states; if( theOmegaPower<0 ) { ThRightNormalForm rep = *this; rep.theOmegaPower = -theOmegaPower%2; cout << "Power = " << rep.theOmegaPower << endl; new_states[rep] = ThRightNormalForm( theRank ); } else new_states[*this] = ThRightNormalForm( theRank ); /* cout << endl << " init:" << endl; cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl; cout << (*new_states.begin( )).first; cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl; */ while( !new_states.empty( ) ) { { // was unsupported by MSVC++ // checked_states.insert( unchecked_states.begin(), unchecked_states.end() ); map< ThRightNormalForm , ThRightNormalForm >::iterator m_it = unchecked_states.begin( ); for( ; m_it!=unchecked_states.end( ) ; ++m_it ) checked_states.insert( *m_it ); } // process all new vertices: unchecked_states = new_states; new_states.clear( ); size_t counter = 0; map< ThRightNormalForm , ThRightNormalForm >::const_iterator it = unchecked_states.begin( ); for( ; it!=unchecked_states.end( ) ; ++it ) { ThRightNormalForm cur_el = (*it).first; ThRightNormalForm cur_conj = (*it).second; /* cout << endl << " cur_el:" << endl; cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl; cout << cur_el; cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl; */ // cout << "c1" << endl; // cout << cur_el << endl; // set<Permutation> conjugators = getSimpleSummitConjugators( G , cur_el ); set<Permutation> conjugators = cur_el.getSimpleConjugators( ); // cout << "c2" << endl; for( set<Permutation>::const_iterator conj_it = conjugators.begin( ) ; conj_it!=conjugators.end( ) ; ++conj_it ) { ThRightNormalForm r_mult( theRank , 0 , list<Permutation>( 1 , *conj_it ) ); if( *conj_it==omega ) r_mult = ThRightNormalForm( theRank , 1 , list<Permutation>( 0 ) ); ThRightNormalForm new_el = -r_mult * cur_el * r_mult; ThRightNormalForm new_conj = cur_conj * r_mult; /* cout << "**********************************************" << endl; cout << endl << " new_el:" << endl; cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl; cout << new_el; cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl; cout << endl << " new_conj:" << endl; cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl; cout << new_conj; cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl; */ // check whether we made a loop map< ThRightNormalForm , ThRightNormalForm >::const_iterator fit = new_states.find( new_el ); if( fit!=new_states.end( ) ) { result.insert( new_conj * -(*fit).second ); continue; } fit = unchecked_states.find( new_el ); if( fit!=unchecked_states.end( ) ) { result.insert( new_conj * -(*fit).second ); continue; } fit = checked_states.find( new_el ); if( fit!=checked_states.end( ) ) { result.insert( new_conj * -(*fit).second ); continue; } cout << "Size = " << new_states.size( ) << "," << unchecked_states.size( ) << "," << checked_states.size( ) << " (" << result.size( ) << ")" << endl; new_states[new_el] = new_conj; // cout << cur_el << endl; // cout << new_el; // cout << "+++++++++++++++++++++++++++++++" << endl; if( counter!=result.size( ) ) { ofstream of( "out.txt" ); set<ThRightNormalForm>::iterator r_it = result.begin(); for( ; r_it!=result.end( ) ; ++r_it ) { Word w = shortBraidForm( theRank , (*r_it).getShortWord() ); of << w << endl; } counter = result.size( ); } if( new_el.theOmegaPower<0 ) { cerr << "Fail" << endl; exit(1); } } } } cout << "+++++++++++++++++++++++++++++++" << endl; set<ThRightNormalForm>::iterator r_it = result.begin( ); for( ; r_it!=result.end( ) ; ++r_it ) { cout << *r_it << endl; ThRightNormalForm n = -(*r_it) * (*this) * (*r_it); if( n!=*this ) { cout << "Error!" << endl; exit( 23 ); } } return result; }