| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# |
| 3 |
# Copyright (c) 2018, the cclib development team |
| 4 |
# |
| 5 |
# This file is part of cclib (http://cclib.github.io) and is distributed under |
| 6 |
# the terms of the BSD 3-Clause License. |
| 7 |
|
| 8 |
import unittest |
| 9 |
|
| 10 |
import numpy |
| 11 |
|
| 12 |
from cclib.bridge import cclib2pyquante |
| 13 |
|
| 14 |
|
| 15 |
class PyquanteTest(unittest.TestCase): |
| 16 |
"""Tests for the cclib2pyquante bridge in cclib.""" |
| 17 |
|
| 18 |
def test_makepyquante(self): |
| 19 |
from PyQuante.hartree_fock import hf |
| 20 |
atomnos = numpy.array([1, 8, 1],"i") |
| 21 |
a = numpy.array([[-1, 1, 0], [0, 0, 0], [1, 1, 0]], "f") |
| 22 |
pyqmol = cclib2pyquante.makepyquante(a, atomnos) |
| 23 |
en, orbe, orbs = hf(pyqmol) |
| 24 |
ref = -75.824754 |
| 25 |
assert abs(en - ref) < 1.0e-6 |
| 26 |
|
| 27 |
|
| 28 |
if __name__ == "__main__": |
| 29 |
unittest.main() |