我已经安装了 Python 3.7.2,下载 anaconda 和 Visual Studio 代码。通过安装 qiskit sdk 0.5.3 和 qiskit for Python但是当我从https://github.com/Qiskit/qiskit-terrapip install qiskit
启动我的第一个测试程序时,我收到了几条消息,例如
> "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))
谢谢