Skip to content

Commit

Permalink
remove print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
kt474 committed Nov 28, 2023
1 parent 2a20d47 commit 6420996
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions test/integration/test_qctrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,12 @@ def test_sampler_qctrl_bell(self, service):
results_dict = {
"{0:02b}".format(key): value for key, value in result.quasi_dists[0].items()
} # convert keys to bitstrings
# print(f">>> Quasi-probability distribution from the sampler job: {results_dict}")

ideal_result = {
key: val / shots for key, val in Statevector(bell_circuit).probabilities_dict().items()
}
fidelity = hellinger_fidelity(results_dict, ideal_result)

print("fidelity with ideal results: ", fidelity)
self.assertGreater(fidelity, FIDELITY_THRESHOLD)

@run_integration_test
Expand Down Expand Up @@ -215,7 +213,6 @@ def test_sampler_qctrl_conditional_states(self, service):
for results_dict, ideal_result in zip(results_dict_list, ideal_results_list)
]

print("fidelity with ideal results: ", fidelities)
for fidelity in fidelities:
self.assertGreater(fidelity, FIDELITY_THRESHOLD)

Expand Down Expand Up @@ -249,14 +246,10 @@ def test_estimator_qctrl_bell(self, service):
absolute_difference = [
abs(obs_theory - obs_exp) for obs_theory, obs_exp in zip(ideal_result, result.values)
]
absolute_difference_dict = {
obs.paulis[0].to_label(): diff for obs, diff in zip(observables, absolute_difference)
}
# absolute_difference_dict = {
# obs.paulis[0].to_label(): diff for obs, diff in zip(observables, absolute_difference)
# }

print(
"absolute difference between theory and experiment expectation values: ",
absolute_difference_dict,
)
for diff in absolute_difference:
self.assertLess(diff, DIFFERENCE_THRESHOLD)

Expand Down Expand Up @@ -335,14 +328,10 @@ def test_estimator_qctrl_superposition(self, service):
absolute_difference = [
abs(obs_theory - obs_exp) for obs_theory, obs_exp in zip(ideal_result, result.values)
]
absolute_difference_dict = {
obs.paulis[0].to_label(): diff for obs, diff in zip(observables, absolute_difference)
}
# absolute_difference_dict = {
# obs.paulis[0].to_label(): diff for obs, diff in zip(observables, absolute_difference)
# }

print(
"absolute difference between theory and experiment expectation values: ",
absolute_difference_dict,
)
for diff in absolute_difference:
self.assertLess(diff, DIFFERENCE_THRESHOLD)

Expand Down

0 comments on commit 6420996

Please sign in to comment.