How to use matplotlib to draw the following image, hoping that the 3D histogram is at the coordinate intersection?
I can only do it as follows
Quantum Computing Stack Exchange is a question and answer site for engineers, scientists, programmers, and computing professionals interested in quantum computing. It only takes a minute to sign up.
Sign up to join this communityHow to use matplotlib to draw the following image, hoping that the 3D histogram is at the coordinate intersection?
I can only do it as follows
You can check out how to use plot_state_city
in the documentation for the visualization function. The example you are showing seems to change the default colors to color=['blue', 'yellow']
and the title:
from qiskit import QuantumCircuit
from qiskit.quantum_info import DensityMatrix
from qiskit.visualization import plot_state_city
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
state = DensityMatrix.from_instruction(qc)
plot_state_city(state, color=['blue', 'yellow'], title="New State City")