Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override classmethod supports_aux_operators in VQEProgram #223

Merged
merged 10 commits into from
Aug 16, 2021
13 changes: 13 additions & 0 deletions qiskit_optimization/runtime/vqe_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,19 @@ def wrapped_callback(*args):
else:
return None

@classmethod
def supports_aux_operators(cls) -> bool:
"""Whether computing the expectation value of auxiliary operators is supported.

If the minimum eigensolver computes an eigenstate of the main operator then it
can compute the expectation value of the aux_operators for that state. Otherwise
they will be ignored.

Returns:
True if aux_operator expectations can be evaluated, False otherwise
"""
lasys marked this conversation as resolved.
Show resolved Hide resolved
return True

def compute_minimum_eigenvalue(
self, operator: OperatorBase, aux_operators: Optional[List[Optional[OperatorBase]]] = None
) -> MinimumEigensolverResult:
Expand Down