ket.draw()
必须给予|00>
作为结果,但我得到:
Statevector([1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
dims=(2, 2))
我可以改变什么来得到想要的结果?
这是我的代码:
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(2)
# This calculates what the state vector of our qubits would be
# after passing through the circuit 'qc'
ket = Statevector(qc)
# The code below writes down the state vector.
# Since it's the last line in the cell, the cell will display it as output
ket.draw()
1条答案
按热度按时间whlutmcx1#
您可以将关键字参数
output='latex'
传递给.draw
方法。