class HartreeFock:

    def __init__(self, nuclei_array, basis_set_array, electrons, symmetry, processes):
        self.scf_method = None
        self.nuclei_array = nuclei_array
        self.basis_set_array = basis_set_array
        self.electrons = electrons
        self.symmetry = symmetry
        self.orbital_overlap = OrbitalOverlapMatrix(basis_set_array).create()
        self.kinetic_energy = KineticEnergyMatrix(basis_set_array).create()
        self.nuclear_attraction = NuclearAttractionMatrix(basis_set_array, nuclei_array).create()
        self.core_hamiltonian = self.kinetic_energy + self.nuclear_attraction
        self.linear_algebra = LinearAlgebra(self.orbital_overlap)
        print('\n*************************************************************************************************')
        print('\nMATRICES\n')
        print('\nORBITAL OVERLAP MATRIX\n{}'.format(self.orbital_overlap))
        print('\nKINETIC ENERGY MATRIX\n{}'.format(self.kinetic_energy))
        print('\nNUCLEAR POTENTIAL ENERGY MATRIX\n{}'.format(self.nuclear_attraction))
        print('\nCORE HAMILTONIAN MATRIX\n{}'.format(self.core_hamiltonian))
        print('\nBEGIN TWO ELECTRON REPULSION CALCULATION')
        start_repulsion = time.clock()
        self.repulsion = TwoElectronRepulsionMatrixOS(self.basis_set_array, self.symmetry, processes).create()
        print('TIME TAKEN: ' + str(time.clock() - start_repulsion) + 's\n')
        print('\n*************************************************************************************************')

    def initial_guess(self):
        initial_orbital_energies, initial_orbital_coefficients = self.linear_algebra.diagonalize(self.core_hamiltonian)
        return initial_orbital_coefficients
 def test_diagonalize_returns_orbital_energy_eigenvalues_and_orbital_coefficients(self):
     LinearAlgebra.create_transformation_matrix = Mock(return_value=np.matrix([[-0.9541, 0.5871], [0.9541, 0.5871]]))
     mock_orbital_overlap = MagicMock()
     linear_algebra = LinearAlgebra(mock_orbital_overlap)
     core_hamiltonian = np.matrix([[-2.6527, -1.3472], [-1.3472, -1.7318]])
     orbital_energies, orbital_coefficients = linear_algebra.diagonalize(core_hamiltonian)
     testing.assert_array_almost_equal(orbital_coefficients, np.matrix([[0.9291, 0.6259], [0.1398, -1.1115]]), decimal=3)
     testing.assert_array_almost_equal(orbital_energies, np.array([-2.6742, -1.3043]), decimal=4)