Note
This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.
MeasurementBasis¶
- class MeasurementBasis(name)[source]¶
Abstract base class for a tomography measurement basis.
Subclasses should implement the following abstract methods to define a preparation basis:
The
circuit()
method which returns the logical measurementQuantumCircuit
for basis element index on the specified physical qubits. This circuit should be a logical circuit on the specified number of qubits and will be remapped to the corresponding physical qubits during transpilation. It should include classical bits and the measure instructions for the basis measurement storing the outcome value in these bits.The
matrix()
method which returns the POVM element corresponding to the basis element index and measurement outcome on the specified qubits. This should return either aStatevector
for a PVM element, orDensityMatrix
for a general POVM element.The
index_shape()
method which returns the shape of allowed basis indices for the specified qubits, and their values.The
matrix_shape()
method which returns the shape of subsystem dimensions of the POVM element matrices on the specified qubits.The
outcome_shape()
method which returns the shape of allowed outcome values for a measurement of specified qubits.
Initialize a basis.
- Parameters:
name (
str
) – the name for the basis.
Attributes
Return the basis name
Methods
MeasurementBasis.circuit
(index[, qubits])Return the basis preparation circuit.
MeasurementBasis.index_shape
(qubits)Return the shape for the specified number of indices.
MeasurementBasis.matrix
(index, outcome[, qubits])Return the POVM element for the basis index and outcome.
MeasurementBasis.matrix_shape
(qubits)Return the shape of subsystem dimensions of a POVM attr:~matrix.
MeasurementBasis.outcome_shape
(qubits)Return the shape of allowed measurement outcomes on specified qubits.