Qx.Draw.SVG.Charts (Qx - Quantum Computing Simulator v0.5.0)

View Source

SVG chart generation for quantum simulation results.

This module handles all SVG-based chart rendering, including:

  • Probability distribution bar charts
  • Measurement count histograms
  • Raw probability histograms

SVG visualizations are standalone and can be embedded in web pages, saved to files, or used in environments where VegaLite is not available.

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 an SVG histogram from raw probability data.

Creates an SVG bar chart of probability distribution from simulation result.

Creates an SVG bar chart of measurement counts from simulation result.

Functions

histogram(data, title, width, height)

Creates an SVG histogram from raw probability data.

Parameters

  • data - List of maps with "state" and "probability" keys
  • title - Chart title
  • width - Chart width in pixels
  • height - Chart height in pixels

Returns

SVG string for probability histogram.

plot(result, title, width, height)

Creates an SVG bar chart of probability distribution from simulation result.

Parameters

  • result - Simulation result map containing probabilities
  • title - Chart title
  • width - Chart width in pixels
  • height - Chart height in pixels

Returns

SVG string that can be saved to file or embedded in HTML.

plot_counts(result, title, width, height)

Creates an SVG bar chart of measurement counts from simulation result.

Parameters

  • result - Simulation result containing measurement counts
  • title - Chart title
  • width - Chart width in pixels
  • height - Chart height in pixels

Returns

SVG string showing count distribution of measurement outcomes.