Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.
Important

IBM Quantum Platform is moving and this version will be sunset on July 1. To get started on the new platform, read the migration guide.

iplot_state_paulivec

iplot_state_paulivec(rho, figsize=None, slider=False, show_legend=False)

GitHub

Create a paulivec representation.

Graphical representation of the input array.

Parameters

  • rho (array) – State vector or density matrix.
  • figsize (tuple) – Figure size in pixels.
  • slider (bool) – activate slider
  • show_legend (bool) – show legend of graph content

Example

from qiskit import QuantumCircuit, BasicAer, execute
from qiskit.visualization import iplot_state_paulivec
%matplotlib inline
 
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])
 
backend = BasicAer.get_backend('statevector_simulator')
job = execute(qc, backend).result()
iplot_state_paulivec(job.get_statevector(qc))
Was this page helpful?
Report a bug or request content on GitHub.