# probability

**Installation Required:** This functionality requires MATLAB Support Package for Quantum Computing.

## Description

returns the probability of measuring all specified qubits in the $$|1\rangle $$ state for the input quantum state or measurement `p`

= probability(`s`

,`qubits`

)`s`

. The
input `s`

must be a `QuantumState`

or
`QuantumMeasurement`

object.

If

`s`

is a`QuantumState`

object, then`probability`

returns the probability of making the specified measurement based on that quantum state.If

`s`

is a`QuantumMeasurement`

object, then`probability`

returns the estimated probability of the specified measurement based on that measurement result.

## Examples

## Input Arguments

## Version History

**Introduced in R2023a**