// }}} itpp::Mat<std::complex<double> > RandomCUE(int const dim){ //{{{ itpp::Mat<std::complex<double> > U(dim,dim); itpp::Vec<double> eigenvalues(dim); FlatSpectrumGUE(U, eigenvalues); // return exp( 2*itpp::pi*std::complex<double>(0.,1.)* itpp:randu())*U; return exp(2.*itpp::pi*std::complex<double>(0.,1.) *itpp::randu() )*U; }
// }}} itpp::Mat<std::complex<double> > RandomGUE(int const dim, std::string normalization="sigma_offdiag=1", double const percentage_away=0.1){ //{{{ if (normalization=="sigma_offdiag=1"){ return RandomGUEDeltaOne(dim); } else if (normalization=="unfolded mean_level_spacing=1"){ itpp::Mat<std::complex<double> > U(dim, dim), tmp(dim,dim); itpp::Vec<std::complex<double> > vec1(dim); itpp::Vec<double> eigenvalues(dim); FlatSpectrumGUE(U, eigenvalues); for (int i=0; i<dim; i++){ vec1=itpp::elem_mult(conj(U.get_col(i)), to_cvec(eigenvalues)); for (int j=i; j<dim; j++){ tmp(i,j)=vec1*U.get_col(j); if (i<j){tmp(j,i)=conj(tmp(i,j));} } } return tmp; // std::cout << eigenvalues << std::endl ; // ya dentro de temp tenemos a una matriz que no esta // unfolded. tengo que encontrar los eigenvectores, // luego los eigenvalores, eso diagonalizarlos y chan } else { std::cerr << "Illegal normalization RandomGUE" << percentage_away; exit(1); } // Aca poner un factor de normalizacion opcional }
// }}} void CheckUnfolded() { // {{{ std::clog << "Esta rutina toca que tenga la lindea donde digo ... hist.update(eigenvalues);... " << "en el loop. Ahora la comento porque se enchocha haciendo la optimizacion -O2" << std::endl ; int dim=40, ElementsEnsemble=1000; #ifdef ASK std::clog << "Inserte dim "; cin >> dim; std::cout <<std::endl ; std::clog << "Inserte ElementsEnsemble "; cin >> ElementsEnsemble; std::cout <<std::endl ; #endif std::clog << "dim="<<dim<<" ElementsEnsemble="<<ElementsEnsemble<<std::endl ; itpp::cmat H; itpp::Vec<double> eigenvalues(dim); itpp::Histogram<double> hist(-0.5*dim+0.5, 0.5*dim-.5, dim); for (int i=0; i<ElementsEnsemble; i++) { FlatSpectrumGUE(eigenvalues); // hist.update(eigenvalues); } std::cout << hist.get_bins() - ElementsEnsemble <<std::endl ; std::cout << "los elementos deben ser muy chicos con respecto a " <<ElementsEnsemble<<std::endl ; } // }}}
// }}} void FlatSpectrumGUE(itpp::Vec<double>& eigenvalues){ // {{{ itpp::Mat<std::complex<double> > U; FlatSpectrumGUE(U,eigenvalues); }