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-
Visualization | Function in Visualization module | Input | Learn More |
---|---|---|---|
Histogram | plot_histogram() | Dictionary or list of dictionaries. | Learn more about Histogram Visualization in Qiskit. |
Bloch Vector | plot_bloch_vector() | List. | Learn more about Bloch Vector Visualization in Qiskit. |
Bloch Multi Vector | plot_bloch_multivector() | Stateveector or Density Matrix or ndarray | Learn more about Bloch Multi Vector Visualization in Qiskit. |
Q Sphere | plot_state_qsphere() | Stateveector or Density Matrix or ndarray | Learn more about Q Sphere Visualization in Qiskit. |
Cityscape | plot_state_city() | Stateveector or Density Matrix or ndarray | Learn more about Cityscape Visualization in Qiskit. |
State Hinton | plot_state_hinton() | Stateveector or Density Matrix or ndarray | Learn more about Hinton Visualization in Qiskit. |
Pauli Vector | plot_state_paulivec() | Stateveector or Density Matrix or ndarray | Learn more about Pauli Vector Visualization in Qiskit. |