A numerical multiconfiguration self-consistent-field method for diatomic molecules