Split an operator (instance of QubitOperator) into sub-operator
openfermion.measurements.group_into_tensor_product_basis_sets(
operator, seed=None
)
QubitOperators, where each sub-operator has terms that are diagonal
in the same tensor product basis.
Each sub-operator
can be measured using the same qubit post-rotations
in expectation estimation. Grouping into these tensor product basis
sets has been found to improve the efficiency of expectation estimation
significantly for some Hamiltonians in the context of
VQE (see section V(A) in the supplementary material of
https://arxiv.org/pdf/1704.05018v2.pdf). The more general problem
of grouping operators into commutitative groups is discussed in
section IV (B2) of https://arxiv.org/pdf/1509.04279v1.pdf The
original input operator is the union of all output sub-operators,
and all sub-operators are disjoint (do not share any terms).
Args |
operator (QubitOperator): the operator that will be split into
sub-operators (tensor product basis sets).
seed (int): default None. Random seed used to initialize the
numpy.RandomState pseudo-random number generator.
|
Returns |
sub_operators (dict): a dictionary where each key defines a
tensor product basis, and each corresponding value is a
QubitOperator with terms that are all diagonal in
that basis.
key (tuple of tuples): Each key is a term, which defines
a tensor product basis. A term is a product of individual
factors; each factor is represented by a tuple of the form
(index , action ), and these tuples are collected into a
larger tuple which represents the term as the product of
its factors. action is from the set {'X', 'Y', 'Z'} and
index is a non-negative integer corresponding to the
index of a qubit.
value (QubitOperator): A QubitOperator with terms that are
diagonal in the basis defined by the key it is stored in.
|
Raises |
TypeError
|
Operator of invalid type.
|