Skip to content

Add plot_histogram function #451

Description

@alessandro-santini

Motivation

QoolQit currently has no built-in way to visualize sampling outcomes. Users have to write their own matplotlib code each time.

Proposal

Explore adding a plot_histogram(data, ...) utility that:

Input

  • Accepts a single dict[str, int | float] (bitstring → count/probability), or a list of dicts / list of results, for comparing multiple runs

Standard customization

  • Supports basic customization: figsize, color, title, legend, ax
  • Supports sorting bars (ascending/descending, by value, or by distance to a target bitstring)
  • Optionally truncates low-probability outcomes into a single "rest" bar

Open questions

  • What's the natural input — raw dicts, or should it accept sampling output objects directly?
  • Any existing plotting/style conventions to follow?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions