Electronic Spectrum And Ordered States Of Quasicrystals And Pyrites