MultiQubitDual¶
- class MultiQubitDual(list_operators: list[Operator])[source]¶
Bases:
MultiQubitFrame
,BaseDual
Class that collects all information that any Dual over multiple qubits should specify.
This is a representation of a dual frame. Its elements are specified as a list of
Operator
.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.
Inherited 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.
- num_outcomes¶
The number of outcomes of the Dual.
- num_subsystems¶
The number of subsystems which the frame operators act on.
For qubits, this is always
dimension
.
- 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:
QiskitError – when the frame operators could not be converted to Pauli form (e.g. when they are not N-qubit operators).
Methods
- classmethod build_dual_from_frame(frame: BaseFrame, alphas: tuple[float, ...] | None = None) MultiQubitDual [source]¶
Construct a dual frame to another (primal) frame.
- Parameters:
- Returns:
A dual frame to the supplied
frame
.- Return type:
Inherited Methods
- analysis(hermitian_op: SparsePauliOp | Operator, frame_op_idx: int | set[int] | None = None) float | dict[int, float] | ndarray ¶
Return the frame coefficients of
hermitian_op
.This method implements the analysis operator
of the frame :where
are called the frame coefficients of the Hermitian operator .- 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 operatorhermitian_op
. If a specific coefficient was queried, afloat
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:
- classmethod from_vectors(frame_vectors: ndarray) Self ¶
Initialize a frame from non-normalized bloch vectors.
The non-normalized Bloch vectors are given by
. The resulting frame operators are where is the trace of the ’th frame operator.
- get_omegas(observable: SparsePauliOp | Operator, outcome_idx: LabelT | set[LabelT] | None = None) float | dict[LabelT, float] | ndarray ¶
Return the decomposition weights of the provided observable.
Computes the
inwhere
is theobservable
and are the effects of the POVM of whichself
is the dual. The closed form for computing iswhere
make of this dual frame (i.e.self
).Note
In the frame theory formalism, the mapping
is referred to as the analysis operator, which is implemented by theanalysis()
method.- Parameters:
observable (SparsePauliOp | Operator) – the observable for which to compute the decomposition weights.
outcome_idx (LabelT | set[LabelT] | None) – label or set of labels indicating which decomposition weights are queried. If
None
, all weights are queried.
- Returns:
Decomposition weight(s) associated to the effect(s) specified by
outcome_idx
. If a specific outcome was queried, afloat
is returned. If a specific set of outcomes was queried, a dictionary mapping outcome labels to weights is returned. If all outcomes were queried, an array with all weights is returned.- Return type: