Share via


StateDump Class

A state dump returned from the Q# interpreter.

Inheritance
builtins.object
StateDump

Constructor

StateDump(data: StateDumpData)

Parameters

Name Description
data
Required

Methods

check_eq

Checks if the state dump is equal to the given state. This is not mathematical equality, as the check ignores global phase.

check_eq

Checks if the state dump is equal to the given state. This is not mathematical equality, as the check ignores global phase.

check_eq(state: Dict[int, complex] | List[complex], tolerance: float = 1e-10) -> bool

Parameters

Name Description
state
Required

The state to check against, provided either as a dictionary of state indices to complex amplitudes, or as a list of real amplitudes.

tolerance

The tolerance for the check. Defaults to 1e-10.

default value: 1e-10

Attributes

qubit_count

qubit_count: int