We report fully relativistic band structure and total energy studies o
f UPt3 in the different magnetic states. We find that the ground state
of UPt3 is nonmagnetic, even though stable ferromagnetic and antiferr
omagnetic solutions are also found. We find that the total energy calc
ulations predict the direction of the ordered moment correctly and for
the first time the ''metamagnetic transition'' is found from a first
principles total energy calculation for heavy fermion compounds.