openfermion.measurements.group_into_tensor_product_basis_sets
Split an operator (instance of QubitOperator) into sub-operator
QubitOperators, where each sub-operator has terms that are diagonal in the same tensor product basis.
openfermion.measurements.group_into_tensor_product_basis_sets(
operator, seed=None
)
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.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[]]