MultiQubitFrame

class MultiQubitFrame(list_operators: list[Operator])[source]

Bases: BaseFrame[int]

Class that collects all information that any frame of multiple qubits should specify.

This is a representation of an operator-valued vector space frame. The effects are specified as a list of Operator.

Note

This is a base class which collects functionality common to various subclasses. As an end-user you would not use this class directly. Check out povm_toolbox.quantum_info for more general information.

Initialize from explicit operators.

Parameters:

list_operators (list[Operator]) – list that contains the explicit frame operators. The length of the list is the number of operators of the frame.

Raises:

ValueError – if the frame operators do not have a correct shape. They should all be hermitian and of the same dimension.

Attributes

dimension

The dimension of the Hilbert space on which the effects act.

informationally_complete

If the frame spans the entire Hilbert space.

num_operators

The number of effects of the frame.

operators

Return the list of frame operators.

pauli_operators

Convert the internal frame operators to Pauli form.

Warning

The conversion to Pauli form can be computationally intensive.

Returns:

The frame operators in Pauli form. Each frame operator is returned as a dictionary mapping Pauli labels to coefficients.

Raises:

ValueError – when the frame operators could not be converted to Pauli form (e.g. when they are not N-qubit operators).

Inherited Attributes

num_subsystems

The number of subsystems which the frame operators act on.

For qubits, this is always \(\log_2(\)dimension\()\).

Methods

analysis(hermitian_op: SparsePauliOp | Operator, frame_op_idx: int | set[int] | None = None) float | dict[int, float] | ndarray[source]

Return the frame coefficients of hermitian_op.

This method implements the analysis operator \(A\) of the frame \(\{F_k\}_k\):

\[A: \mathcal{O} \mapsto \{ \mathrm{Tr}\left[F_k \mathcal{O} \right] \}_k,\]

where \(c_k = \mathrm{Tr}\left[F_k \mathcal{O} \right]\) are called the frame coefficients of the Hermitian operator \(\mathcal{O}\).

Parameters:
  • hermitian_op (SparsePauliOp | Operator) – a hermitian operator whose frame coefficients to compute.

  • frame_op_idx (int | set[int] | None) – label or set of labels indicating which coefficients are queried. If None, all coefficients are queried.

Returns:

Frame coefficients, specified by frame_op_idx, of the Hermitian operator hermitian_op. If a specific coefficient was queried, a float is returned. If a specific set of coefficients was queried, a dictionary mapping labels to coefficients is returned. If all coefficients were queried, an array with all coefficients is returned.

Raises:
  • TypeError – when the provided single or sequence of labels frame_op_idx does not have a valid type.

  • ValueError – when the dimension of the provided hermitian_op does not match the dimension of the frame operators.

Return type:

float | dict[int, float] | ndarray

classmethod from_vectors(frame_vectors: ndarray) Self[source]

Initialize a frame from non-normalized bloch vectors.

The non-normalized Bloch vectors are given by \(|\tilde{\psi}_k \rangle = \sqrt{\gamma_k} |\psi_k \rangle\). The resulting frame operators are \(F_k = \gamma_k |\psi_k \rangle \langle \psi_k |\) where \(\gamma_k\) is the trace of the \(k\)’th frame operator.

Parameters:

frame_vectors (ndarray) – list of vectors \(|\tilde{\psi_k} \rangle\). The length of the list corresponds to the number of operators of the frame. Each vector is of shape \((\mathrm{dim},)\) where \(\mathrm{dim}\) is the dimension of the Hilbert space on which the frame acts.

Returns:

The frame corresponding to the vectors.

Return type:

Self