An ab initio local spin density study of YBa2Cu3O6, YBa2Cu3O6.5, and YBa2Cu
3O7 is presented. The method includes self-interaction corrections for the
Cu d states, which enables a description of various valency configurations
of both planar and chain Cu atoms. For YBa2Cu3O6 the antiferromagnetic and
insulating state is described with planar (chain) Cu occurring in a divalen
t (trivalent) state. The evolution in the CuO2 plane from insulating to met
allic behavior upon oxygenation is accomplished by the delocalization of th
e majority Cu d(x2-y2)-O2 p(x)-O3 p(y) band.