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
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
00040
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
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 }
00058 }
00059
00060
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
00074
00075 for(k=1; k<j; k++){
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);
00079 }
00080 if(j+k <= dim)
00081 P+= var(i, j+k)*comb(k-j, k);
00082
00083 A->steenrod[thevar][k]= P;
00084
00085
00086 }
00087 }
00088
00089
00090
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
00107
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
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() ){
00117 if(target->very_verbose)
00118 cout << "found variable "
00119 << source->nameof(j)
00120 << " in the real representation ring"
00121 << endl;
00122
00123
00124 if( source->schur_indices[j] == 1 )
00125 chern_sw.set_image(i, var(j,index) * var(j,index) );
00126 else
00127 chern_sw.set_image(i, var(j, 2*index) );
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
00137 for(j=1; j<= source->variables_in_use(); j++)
00138 if( source->nameof(j) == nameconj )
00139 break;
00140
00141 chern_sw.set_image(i, var(j, 2*index) );
00142 }
00143
00144
00145
00146
00147
00148
00149 }
00150
00151
00152
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
00165
00166
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
00195
00196
00197
00198
00199
00200
00201
00202
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();
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
00239
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
00244 for(j=0; j < ZZtolong(it->second); j++)
00245 exp_image *= P;
00246 }
00247
00248
00249
00250
00251 dim= ZZtolong(source->epsilon.find(i)->second);
00252 for(j=1; j<= dim; j++){
00253 P= this->var(i,j);
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