Skip to content

Commit

Permalink
Add forgotten the test items in def test_qaoa_evaluate_circuit_shot
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshioka1128 committed Sep 4, 2024
1 parent c731d23 commit 7721bd6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/openqaoa-core/tests/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -1415,6 +1415,10 @@ def test_qaoa_evaluate_circuit_shot(self):
# compile and evaluate the circuit, and check that the result is correct
q.compile(problem)
result = q.evaluate_circuit([1, 2, 1, 2, 1, 2])
self.assertIsInstance(
(result["measurement_results"], dict),
"When using a shot-based simulator, evaluate_circuit should return a dict of counts"
)
self.assertTrue(
abs(result["cost"]) >= 0,
"When using a shot-based simulator, evaluate_circuit should return a cost"
Expand Down Expand Up @@ -2273,6 +2277,10 @@ def test_fqaoa_evaluate_circuit_shot(self):
# compile and evaluate the circuit, and check that the result is correct
fqaoa.compile(problem, budget)
result = fqaoa.evaluate_circuit([1, 2, 1, 2, 1, 2])
self.assertIsInstance(
(result["measurement_results"], dict),
"When using a shot-based simulator, evaluate_circuit should return a dict of counts"
)
self.assertTrue(
abs(result["cost"]) >= 0,
"When using a shot-based simulator, evaluate_circuit should return a cost"
Expand Down

0 comments on commit 7721bd6

Please sign in to comment.