#!/usr/bin/env python

import numpy as np

from horton import *  # pylint: disable=wildcard-import,unused-wildcard-import


# Set up Neon atom, define basis set
# ----------------------------------
coordinates = np.array([[0.0, 0.0, 0.0]])
numbers = np.array([10])
obasis = get_gobasis(coordinates, numbers, 'cc-pvdz')

# Construct Hamiltonian
# ---------------------
one_mo = obasis.compute_kinetic()
obasis.compute_nuclear_attraction(coordinates, numbers.astype(float), one_mo)
two_mo = obasis.compute_electron_repulsion()
core_energy = compute_nucnuc(coordinates, numbers.astype(float))

# Write to a HDF5 file
# --------------------
data = IOData()
data.one_mo = one_mo
data.two_mo = two_mo
data.core_energy = core_energy
data.nelec = 10
data.ms2 = 0
data.to_file('hamiltonian_ao_fcidump.h5')


# CODE BELOW IS FOR horton-regression-test.py ONLY. IT IS NOT PART OF THE EXAMPLE.
rt_results = {
    'one_mo': data.one_mo.ravel()[::10],
    'two_mo': data.two_mo.ravel()[::1000],
    'core_energy': data.core_energy,
}
# BEGIN AUTOGENERATED CODE. DO NOT CHANGE MANUALLY.
rt_previous = {
    'core_energy': 0.0,
    'one_mo': np.array([
        -96.143299148359503, 0.0, 0.0, -11.134992899248306, 0.0, 0.0, -18.917972852223652,
        0.0, 0.0, -6.9898816487336894, 0.0, 0.0, -6.9898816487336894, 0.0, 0.0,
        -12.6292465706633, 0.0, 0.0, -12.629246570663298, 0.0
    ]),
    'two_mo': np.array([
        5.9688416466791034, 0.0, 0.0, 0.22652795134616616, 0.08668542315127381, 0.0,
        0.11914642982846606, 0.0, 0.0, 0.1723657034224888, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
        0.0, 0.0, 0.008602665981441826, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]),
}
