虽然我导入了plot_histogram,但没有像预期的那样获得输出。这是我的代码:
a = QuantumCircuit(1)
a.z(0)
a.x(0)
a.h(0)
a.sdg(0)
a.t(0)
backend = Aer.get_backend('qasm_simulator')
result = execute(a, backend).result()
counts = result.get_counts()
plot_histogram(counts)
print(c)```发布于 2022-05-29 05:55:27
你错过了测量。
a.z(0)
a.x(0)
a.h(0)
a.sdg(0)
a.t(0)
a.measure_all(). #<--
... 这将测量量子位,并设置一个经典的寄存器与结果。
https://stackoverflow.com/questions/72417370
复制相似问题