Our method for the solution of the molecular Schrödinger equation has been further developed and extended to the case of the four-electron system. Ab initio calculations are presented which lead to the electronic wavefunctions and energies of square and rectangular forms of H4. As a preliminary to the four-electron studies, the energies and wavefunctions for a number of states of the ions H43+ and H42+ are calculated. Complete contour maps for the potential energy surfaces of these systems are reported and the H4 surface is discussed in connection with the bimolecular isotope exchange reaction H2+D 2→2HD. Contour maps for the electron density distribution in square and rectangular H4 are presented and discussed.