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.

PreparationBasis

class PreparationBasis(name)[source]

Abstract base class for a tomography preparation basis.

Subclasses should implement the following abstract methods to define a preparation basis:

  • The circuit() method which returns the logical preparation QuantumCircuit for basis element index on the specified 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.

  • The matrix() method which returns the density matrix prepared by the bases element index on the specified qubits.

  • 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 density matrix state on the specified qubits.

Initialize a basis.

Parameters:

name (str) – the name for the basis.

Attributes

PreparationBasis.name

Return the basis name

Methods

PreparationBasis.circuit(index[, qubits])

Return the basis preparation circuit.

PreparationBasis.index_shape(qubits)

Return the shape for the specified number of indices.

PreparationBasis.matrix(index[, qubits])

Return the density matrix data array for the index and qubits.

PreparationBasis.matrix_shape(qubits)

Return the shape of subsystem dimensions of the state attr:~matrix.