corbett / QuantumComputing

This is an implementation of IBM's Quantum Experience in simulation; a 5-qubit quantum computer with a limited set of gates. Please cite me if you end up using this academically.
GNU General Public License v3.0
590 stars 140 forks source link

Seperate state test fails #5

Closed LSaldyt closed 7 years ago

LSaldyt commented 7 years ago

Error message on my machine (Ubuntu 16, Python 2.7.12):

======================================================================
ERROR: test_separate_state (__main__.TestMultiQuantumRegisterStates)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "QuantumComputer.py", line 1614, in test_separate_state
    self.assertTrue(np.allclose(value_state,target_state))
  File "/home/lucas/.local/lib/python2.7/site-packages/numpy/core/numeric.py", line 2478, in allclose
    res = all(isclose(a, b, rtol=rtol, atol=atol, equal_nan=equal_nan))
  File "/home/lucas/.local/lib/python2.7/site-packages/numpy/core/numeric.py", line 2560, in isclose
    return within_tol(x, y, atol, rtol)
  File "/home/lucas/.local/lib/python2.7/site-packages/numpy/core/numeric.py", line 2543, in within_tol
    result = less_equal(abs(x-y), atol + rtol * abs(y))
TypeError: __array_prepare__ must return an ndarray or subclass thereof which is otherwise identical to its input

----------------------------------------------------------------------
Ran 45 tests in 6.081s

FAILED (errors=1)

pip list:

lucas@qed:~/Projects/QuantumComputing$ pip list
adium-theme-ubuntu (0.3.4)
Cython (0.23.4)
numpy (1.12.0)
pip (8.1.1)
Reindent (0.1.1)
setuptools (20.7.0)
unity-lens-photos (1.0)
wheel (0.29.0)

Full output of the command python2 QuantumComputer.py: output.txt

LSaldyt commented 7 years ago

Fixed in #6