The structure and electronic structure of amorphous WO3 were studied with f
irst-principles density functional calculations. Upon amorphization, a larg
e increase of the band gap is observed. The empty states exhibit a tendency
towards localization. We studied the filling of these states as induced by
addition of an alkali metal (Na) or removal (''deficiency'') of O. Na addi
tion does not affect the structure much, and results in a filling of the lo
wer part of the conduction-band continuum. Oxygen removal can induce large
structural relaxations, which can give rise to the formation of W-W dimers
(bond length <3.0 Angstrom) and corresponding in-gap states. We suggest a r
einterpretation of the nature of the active species in the intervalence cha
rge transfer mechanism that is believed to explain the electrochromic behav
ior of thin-film amorphous tungsten bronzes. [S0163-1829(99)12847-9].