我已经安装了Python 3.7.2,下载了anaconda和Visual Studio代码。通过pip install qiskit
安装qiskit sdk 0.5.3和Python的qiskit,但是当我从https://github.com/Qiskit/qiskit-terra启动我的第一个测试程序时,我收到了一些消息,例如
> "message": "Instance of 'QuantumCircuit' has no 'h' member",
> "message": "Instance of 'QuantumCircuit' has no 'cx' member",
> "message": "Instance of 'QuantumCircuit' has no 'measure' member",
我做错了什么?
这是我的代码:
from qiskit import *
q = QuantumRegister(2)
c = ClassicalRegister(2)
qc = QuantumCircuit(q, c)
qc.h(q[0])
qc.cx(q[0], q[1])
qc.measure(q, c)
backend_sim = BasicAer.get_backend('qasm_simulator')
result = execute(qc, backend_sim).result()
print(result.get_counts(qc))
谢谢