为什么我写了这个属性却报错
写了一个模块文件hellohello.py
import numpy as np
def xgate(qinput):
xmat = np.matrix([[0, 1],
[1, 0]])
return np.matmul(xgate,qinput)
在Jupyter Notebook上
import numpy as np
state1 = np.array([0.2,0.8])
state1 = state1[:,None]
import hellohello
hellohello.xgate(state1)
报错
是jupyter notebook默认路径的问题,改完环境变量就解决了