You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The matrix-class of numpy is currently being deprecated. I therefore get the following warning when running the below example using numpy>=1.15.0:
/path/projectq/ops/_gates.py:57: PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
return 1. / cmath.sqrt(2.) * np.matrix([[1, 1], [1, -1]])
Example:
import projectQ as pQ
import unittest
class Test(unittest.TestCase):
def test(self):
eng = pQ.MainEngine()
q = eng.allocate_qubit()[0]
pQ.ops.H | q
pQ.ops.Measure | q
eng.flush()
print(int(q))
The text was updated successfully, but these errors were encountered:
The idea was waiting until Python2.7 is depricated so that everyone switches to Python3.5+ which allows to use @ for matrix multiplications (for which we currently can use * by using numpy.matrix)...
But I don't mind from changing already before, e.g., in the context of #282
The matrix-class of
numpy
is currently being deprecated. I therefore get the following warning when running the below example usingnumpy>=1.15.0
:Example:
The text was updated successfully, but these errors were encountered: