histogram
Installation Required: This functionality requires MATLAB Support Package for Quantum Computing.
Description
histogram( plots a histogram of each
possible state and its probability from the specified quantum state or measurement. The
input s)s must be a QuantumState or
QuantumMeasurement object.
If
sis aQuantumStateobject, thenhistogramplots each possible state and the probability of measuring that state.If
sis aQuantumMeasurementobject, thenhistogramplots each measured state and the estimated probability of that state.
histogram(___,
specifies options using one or more name-value arguments in addition to any of the input
argument combinations in previous syntaxes. For example, you can choose the basis in which
each qubit is represented or a probability threshold to include states in the
histogram.Name=Value)
also returns a
h = histogram(___)Histogram object. Use this object to inspect and adjust the properties
of the histogram. For a list of properties, see Histogram Properties.
Examples
Input Arguments
Name-Value Arguments
Tips
To return the possible states and their probabilities, you can use
querystates. Thequerystatesfunction (with two output arguments) has the same syntaxes ashistogram.
Version History
Introduced in R2023a






