Skip to content

Commit

Permalink
Merge pull request #19 from tovrstra/buildkiteQA
Browse files Browse the repository at this point in the history
Fix random test problem
  • Loading branch information
Matthew Chan committed Sep 12, 2016
2 parents 2b8a893 + 4e14d71 commit 0273aa7
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions horton/matrix/test/test_dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from nose.tools import assert_raises

from horton import * # pylint: disable=wildcard-import,unused-wildcard-import
from horton.test.common import numpy_seed


#
Expand Down Expand Up @@ -642,16 +643,17 @@ def test_expansion_error_eigen():


def test_expansion_from_fock():
lf = DenseLinalgFactory(5)
a = np.random.normal(0, 1, (5, 5))
fock = lf.create_two_index()
fock._array[:] = a+a.T
a = np.random.normal(0, 1, (5, 5))
olp = lf.create_two_index()
olp._array[:] = np.dot(a, a.T)
exp = lf.create_expansion()
exp.from_fock(fock, olp)
assert exp.error_eigen(fock, olp) < 1e-5
with numpy_seed(1):
lf = DenseLinalgFactory(5)
a = np.random.normal(0, 1, (5, 5))
fock = lf.create_two_index()
fock._array[:] = a+a.T
a = np.random.normal(0, 1, (5, 5))
olp = lf.create_two_index()
olp._array[:] = np.dot(a, a.T)
exp = lf.create_expansion()
exp.from_fock(fock, olp)
assert exp.error_eigen(fock, olp) < 1e-5


def test_expansion_from_fock_and_dm():
Expand Down

0 comments on commit 0273aa7

Please sign in to comment.