You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---------------------------------------------------------------------------
QiskitOptimizationError Traceback (most recent call last)
<ipython-input-11-bad44e8258c2> in <module>()
----> 1 algorithm = MinimumEigenOptimizer(runtime_qaoa)
2 result = algorithm.solve(qubit_op)
/usr/local/lib/python3.7/dist-packages/qiskit_optimization/algorithms/minimum_eigen_optimizer.py in __init__(self, min_eigen_solver, penalty, converters)
141 if not min_eigen_solver.supports_aux_operators():
142 raise QiskitOptimizationError(
--> 143 "Given MinimumEigensolver does not return the eigenstate "
144 + "and is not supported by the MinimumEigenOptimizer."
145 )
QiskitOptimizationError: 'Given MinimumEigensolver does not return the eigenstate and is not supported by the MinimumEigenOptimizer.'
Steps to reproduce the problem
import networkx as nx
import numpy as np
from qiskit_optimization.runtime import QAOAProgram
from qiskit_optimization.converters import QuadraticProgramToQubo
from qiskit_optimization.applications.max_cut import Maxcut
# Generate a graph of 5 nodes
n = 5
graph = nx.Graph()
graph.add_nodes_from(np.arange(0, n, 1))
elist= [(0, 1, 3), (0, 2, 1), (1, 2, 1), (3, 2, 6), (3, 4, 1), (4, 2, 2)]
graph.add_weighted_edges_from(elist)
max_cut = Maxcut(graph)
qubit_op = max_cut.to_quadratic_program()
optimizer = {'name': 'SPSA', 'maxiter': 50}
backend = provider.get_backend('ibmq_qasm_simulator')
runtime_qaoa = QAOAProgram(
callback=None,
optimizer=optimizer,
initial_point=None,
provider=provider,
backend=backend,
shots=8192,
measurement_error_mitigation=True)
algorithm = MinimumEigenOptimizer(runtime_qaoa)
result = algorithm.solve(qubit_op)
What is the expected behavior?
Program should run without error.
Suggested solutions
Override classmethod supports_aux_operators in VQEProgram and return True.
I am already in the process of providing a PR.
The text was updated successfully, but these errors were encountered:
Information
What is the current behavior?
Program ends with error:
Steps to reproduce the problem
What is the expected behavior?
Program should run without error.
Suggested solutions
Override classmethod
supports_aux_operators
inVQEProgram
and returnTrue
.I am already in the process of providing a PR.
The text was updated successfully, but these errors were encountered: