Qx.Draw.VegaLite (Qx - Quantum Computing Simulator v0.5.0)
View SourceVegaLite visualization functions for quantum simulation results.
This module handles all VegaLite-based chart generation, including:
- Probability distribution plots
- Measurement count histograms
- Raw probability histograms
- Bloch sphere 2D projections
VegaLite visualizations are particularly useful in LiveBook environments where they provide interactive, publication-quality charts.
Internal Module
This module is part of the Qx.Draw refactoring and should be accessed
through the public Qx.Draw API rather than directly.
Summary
Functions
Creates a VegaLite visualization of a qubit state on the Bloch sphere.
Creates a VegaLite histogram from raw probability data.
Creates a VegaLite plot of probability distribution from simulation result.
Creates a VegaLite plot of measurement counts from simulation result.
Functions
Creates a VegaLite visualization of a qubit state on the Bloch sphere.
Since VegaLite doesn't support native 3D rendering, this creates a 2D projection of the state vector onto the XZ plane.
Parameters
coords- Tuple of {x, y, z, theta, phi} Bloch sphere coordinatestitle- Plot titlesize- Size of the plot (width and height) in pixels
Returns
VegaLite specification showing the 2D projection of the Bloch sphere state.
Bloch Sphere Representation
- |0⟩ state appears at the top (z = +1)
- |1⟩ state appears at the bottom (z = -1)
- |+⟩ state appears at the right (x = +1)
- |-⟩ state appears at the left (x = -1)
Creates a VegaLite histogram from raw probability data.
Parameters
data- List of maps with "state" and "probability" keystitle- Plot titlewidth- Plot width in pixelsheight- Plot height in pixels
Returns
VegaLite specification for probability histogram.
Creates a VegaLite plot of probability distribution from simulation result.
Parameters
result- Simulation result map containing probabilitiestitle- Plot titlewidth- Plot width in pixelsheight- Plot height in pixels
Returns
VegaLite specification that can be rendered in LiveBook or converted to other formats.
Creates a VegaLite plot of measurement counts from simulation result.
Parameters
result- Simulation result containing measurement countstitle- Plot titlewidth- Plot width in pixelsheight- Plot height in pixels
Returns
VegaLite specification showing count distribution of measurement outcomes.