We're celebrating World Quantum Day 2022! Join us

qsim:: StateSpace:: MeasurementResult

#include <statespace.h>

The observed state from a Measurement gate.

Summary

Public attributes

bits
uint64_t
A bitwise representation of the measured states.
bitstring
std::vector< unsigned >
Observed states of the measured qubits.
mask
uint64_t
A bitmask of all qubits measured in this result.
valid
bool
Validation bit.

Public attributes

bits

uint64_t qsim::StateSpace::MeasurementResult::bits

A bitwise representation of the measured states.

In this format, the qubit at index i is represented by the i th bit of bits . If valid is true, mask has already been applied to this field (i.e. bits == bits & mask ).

bitstring

std::vector< unsigned > qsim::StateSpace::MeasurementResult::bitstring

Observed states of the measured qubits.

This vector only includes qubits specified by the associated Measurement gate.

mask

uint64_t qsim::StateSpace::MeasurementResult::mask

A bitmask of all qubits measured in this result.

In this format, if the qubit at index i is measured, the i th bit of mask is a one.

valid

bool qsim::StateSpace::MeasurementResult::valid

Validation bit.

If this is false, the measurement failed and all other fields of the result are invalid.