import pandas as pd
ngrid = 256
n_exact = 20
e_exact = h2morse.get_energy(np.arange(n_exact))
xmin, xmax = 0.5, 10.0
x = np.linspace(xmin, xmax, ngrid)
v = h2morse.get_potential(x)
es = Eigenstates1D(mass=m, grid=x, potential=v)
es.compute_hamiltonian()
energies, psi = es.get_eigenstates()
pd.set_option('display.precision', 8)
table_mo = pd.DataFrame({
'Numeric': energies[:n_exact],
'Exact': e_exact,
})
table_mo['Error / %'] = np.abs(
(table_mo['Numeric'] - table_mo['Exact']) / table_mo['Exact']
)
table_mo.index.names = ['n']
print(table_mo.head(20))