Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

sw_maker.cpp

00001 #include "sw_maker.H"
00002 using namespace std;
00003 
00004 
00005 
00006 
00007 void SW_Maker::start(RealRepresentationRing *thesource, 
00008                      GradedAlgebra<F_2> *thetarget,
00009                      GradedAlgebra<F_2> *the_chern_ring){
00010 
00011   chern_ring= the_chern_ring;
00012   Exponentiator<F_2>::start((RepresentationRing *) thesource, thetarget, string("w"), 1);
00013 }
00014 
00015 
00016 void SW_Maker::create_regular_variables(string prefix){
00017   long i, j, k, dim;
00018   QQ d;
00019   Polynomial<F_2> zero_poly;
00020   ostringstream autoname;
00021   RealRepresentationRing *realsource;
00022   map< long, pair< long, long > > corresp;
00023   
00024   // looks for the largest dimension
00025   dim= 0;
00026   for(i=1; i <= source->variables_in_use(); i++){
00027     d= source->epsilon[i];
00028     if( d > dim)
00029       dim= ZZtolong(d);
00030   }
00031   
00032   max_dim= dim;
00033   
00034   var.resize(source->variables_in_use() +1, dim+1);
00035   zero_poly.alphabet= target;
00036   zero_poly.sets_to_zero();
00037   realsource= (RealRepresentationRing *) source;
00038   
00039   //now create the variables and populate var
00040   //takes the schur indices into account
00041   k= 0;
00042   corresp.clear();
00043   for(i=1; i <= source->variables_in_use(); i++){
00044     dim= ZZtolong( source->epsilon[i] );
00045     for(j=1; j<= dim; j++){ 
00046       // we need to take the schur index into account
00047       if( (j % realsource->schur_indices[i]) == 0 ){
00048         autoname.str("");
00049         autoname << prefix << "_" << j
00050                  << "(" << source->nameof(i) << ")";
00051         var(i,j)= target->new_variable(autoname.str(), factor*j);
00052         k++;
00053         corresp[k]= make_pair(i,j);
00054       }
00055       else
00056         var(i,j)= zero_poly;
00057     }// for j
00058   }// for i
00059 
00060   //now write the steenrod relations, using Wu's formula
00061   
00062   UnstableAlgebra *A;
00063   A= (UnstableAlgebra *) target;
00064   A->write_trivial_steenrod_operations();
00065   Polynomial<F_2> P= target->one();
00066   long s, thevar;
00067   
00068   for(thevar=1; thevar <= target->variables_in_use(); thevar++){
00069     i=  corresp[thevar].first;
00070     j=  corresp[thevar].second;
00071     dim = ZZtolong( source->epsilon[i] );
00072     
00073     //    cout << "i= " << i << " j= " << j << " dim= " << dim << endl;
00074     
00075     for(k=1; k<j; k++){   //Sq^k w_j (i-eme rep)
00076       P.sets_to_zero();
00077       for(s= k; s >= 1 && j+k-s <= dim; s--){
00078         P+= var(i,s)*var(i,j+k-s)*comb(k-j, k-s);//Wu's formula
00079       }
00080       if(j+k <= dim)
00081         P+= var(i, j+k)*comb(k-j, k); //case s==0 slightly different
00082       //now Sq^k w_j (r_i)= P
00083       A->steenrod[thevar][k]= P;
00084       
00085       
00086     }//for k
00087   }//for the var
00088   
00089   // add the complex relations, if a pointer
00090   // has been supplied to the chern ring
00091   if(chern_ring != 0)
00092     add_complex_relations();
00093 
00094 }
00095 
00096 void SW_Maker::add_complex_relations(){
00097   long i,j;
00098   string name, nameconj;
00099   long index;
00100   list< Polynomial<F_2> >::iterator it;
00101   Polynomial<F_2> P;
00102   RealRepresentationRing *realsource;
00103 
00104   realsource= (RealRepresentationRing *) source;
00105 
00106   // translate the chern classes (ie generators
00107   // of *chern_ring) into polynomials in sw classes
00108   for(i=1; i <= chern_ring->variables_in_use(); i++){
00109     name= name_of_rep(chern_ring->nameof(i));
00110     index= index_of_chern_class(chern_ring->nameof(i));
00111     // let's look for 'name' in *source
00112     for(j=1; j<= source->variables_in_use(); j++)
00113       if( source->nameof(j) == name )
00114         break;
00115     
00116     if(j <= source->variables_in_use() ){ // found ?
00117       if(target->very_verbose)
00118         cout << "found variable "
00119              << source->nameof(j)
00120              << " in the real representation ring" 
00121              << endl;
00122       
00123       //examine type
00124       if( source->schur_indices[j] == 1 ) // real ?
00125         chern_sw.set_image(i, var(j,index) * var(j,index) ); // c_idx=w_idx 2
00126       else
00127         chern_sw.set_image(i, var(j, 2*index) ); //c_idx = w_2idx
00128       
00129     }
00130     else{
00131       nameconj= realsource->conjugates[name];
00132       if(target->very_verbose)
00133         cout << name
00134              << " is conjugate to "
00135              << nameconj << endl;
00136       // so let's find it...
00137       for(j=1; j<= source->variables_in_use(); j++)
00138         if( source->nameof(j) == nameconj )
00139           break;
00140       // must be complex
00141       chern_sw.set_image(i, var(j, 2*index) );  
00142     }
00143     /*    if(target->very_verbose)
00144       cout << "will substitute "
00145            << chern_ring->nameof(i)
00146            << " by " << chern_sw.images[i] //error here !
00147            << endl;*/
00148     
00149   }
00150 
00151   // ok ! now we browse through the equations in chern_ring
00152   // and make the substitutions
00153   for(it= chern_ring->relations.generators.begin();
00154       it != chern_ring->relations.generators.end();
00155       it++){
00156     P= *it;
00157 
00158     if(target->very_verbose)
00159       cout << "we look at complex relation " 
00160            << P << " ..." << endl;
00161 
00162     P= chern_sw.of( P );
00163     /*
00164     P.shift_variables( target->variables_in_use()  );
00165     for(i=1; i <= chern_ring->variables_in_use(); i++) 
00166     P.substitute_variable( target->variables_in_use() + i, chern_sw[i] );*/
00167     P.alphabet= target;
00168     if(target->very_verbose)
00169       cout << "and turn it into " << P << endl;
00170     total_relations.push_back(P);
00171 
00172   }
00173 }
00174 
00175 
00176 string SW_Maker::name_of_rep(const string& name_chern){
00177   string::size_type leftpar, rightpar;
00178 
00179   leftpar= name_chern.find("(") + 1;
00180   rightpar= name_chern.find(")");
00181   return name_chern.substr(leftpar, rightpar-leftpar);
00182 }
00183 
00184 long SW_Maker::index_of_chern_class(const string& name_chern){
00185   string::size_type underscore, leftpar;
00186   ZZ i;
00187 
00188   underscore= name_chern.find("_") + 1;
00189   leftpar= name_chern.find("(");
00190   i= ZZ(name_chern.substr(underscore, leftpar-underscore));
00191   return ZZtolong(i);
00192 }
00193 /*
00194   string SW_Maker::index_of_rep(const string& name_chern){
00195   string::size_type underscore;
00196   string name= name_of_rep(name_chern);
00197   ZZ i;
00198   
00199   underscore= name.find("_") + 1;
00200   leftpar= name_chern.find("(");
00201   i= ZZ(name.substr(underscore));
00202   return ZZtolong(i);
00203   }
00204 */
00205 
00206 
00207 
00208 F_2 SW_Maker::comb(long n, long i){
00209   long num, den, k;
00210 
00211   if(i==0)
00212     return 1;
00213 
00214   for(num=1, k=n-i+1; k <= n; k++)
00215     num*= k;
00216 
00217   for(den=1, k=1; k<=i; k++)
00218     den*= k;
00219 
00220   return F_2( num/den );
00221 }
00222 
00223 
00224 
00225 AffineHomomorphism<F_2> SW_Maker::translate_homomorphism(const AffineHomomorphism<QQ>& r,
00226                                                          SW_Maker& sw){
00227   AffineHomomorphism<F_2> ans(target, sw.target);
00228   long i, j, dim, index=0;
00229   Polynomial<QQ> image;
00230   Polynomial<F_2> exp_image, P= sw.target->one();//for the alphabet;
00231   map< PowProd, QQ >::iterator it;
00232 
00233 
00234   for(i=1; i<= source->variables_in_use(); i++){
00235 
00236     image= r.of_generator(i);
00237 
00238     //first, we translate 'image' into its sw classes,
00239     //and store in exp_image.
00240     exp_image= sw.target->one();    
00241     for(it= image.coeffs.begin(); it!=image.coeffs.end(); it++){
00242       sw.exp_classes_after_tensoring(sw.target->one(), 1, it->first, P);
00243       //multiply exp_image by P^it->second
00244       for(j=0; j < ZZtolong(it->second); j++)
00245         exp_image *= P;
00246     }//done!!
00247 
00248     //now we browse the sw classes of rep #i, see which
00249     //are nonzero (cf schur indices!) and set ans( w_j )= j-th homogeneous part
00250     //of exp_image.
00251     dim= ZZtolong(source->epsilon.find(i)->second);//dim= dim of rep i
00252     for(j=1; j<= dim; j++){
00253       P= this->var(i,j);//w_j(r_i)
00254       if( !P.is_zero() ){
00255         index++;
00256         ans.set_image(index, sw.target->hom_part_of(exp_image, j));
00257       }
00258     }
00259   }
00260 
00261   return ans;
00262 }
00263 

Generated on Wed Jun 18 17:22:42 2008 for Pierre Guillot by  doxygen 1.3.9.1