Qiskit: Visulalizations

Qiskit has provides various functions for visualization. These function provide visualization for a wide variety of use cases such as visualizing the counts and states, device visualization, circuit visualization, etc. These functions are collectively grouped under the visualization module of Qiskit. In this chapter of the Qiskit Tutorial, you will learn about the visualization module of qiskit. The subsequent chapter will cover the various visualizations that are provided by qiskit.

All the functions for creating visualizations are grouped together under the qiskit.visualization module. Before creating a particular visualization, it is necessary to import the function corresponding to the visualization module.

Counts and State

The following visualizations are provided by the visualization module for visualizing the counts and states-

  • Histogram
  • Bloch Vector
  • Bloch Multi Vector
  • Q Sphere
  • State City
  • State Hinton
  • State Pauli Vector

Histogram, Bloch Vector, Bloch Multi Vector, and Q Sphere will be covered in depth in the subsequent chapters. The table below discusses in brief the various functions provided by Qiskit for visualizing the counts and states-

VisualizationFunction in Visualization moduleInputLearn More
Histogramplot_histogram()Dictionary or list of dictionaries.Learn more about Histogram Visualization in Qiskit.
Bloch Vectorplot_bloch_vector()List.Learn more about Bloch Vector Visualization in Qiskit.
Bloch Multi Vectorplot_bloch_multivector()Stateveector or Density Matrix or ndarrayLearn more about Bloch Multi Vector Visualization in Qiskit.
Q Sphereplot_state_qsphere()Stateveector or Density Matrix or ndarrayLearn more about Q Sphere Visualization in Qiskit.
Cityscapeplot_state_city()Stateveector or Density Matrix or ndarrayLearn more about Cityscape Visualization in Qiskit.
State Hintonplot_state_hinton()Stateveector or Density Matrix or ndarrayLearn more about Hinton Visualization in Qiskit.
Pauli Vectorplot_state_paulivec()Stateveector or Density Matrix or ndarrayLearn more about Pauli Vector Visualization in Qiskit.