diff --git a/src/examples/quantum_counting.py b/src/examples/quantum_counting.py index f9008ec..99bbe71 100644 --- a/src/examples/quantum_counting.py +++ b/src/examples/quantum_counting.py @@ -46,14 +46,16 @@ def main(): pause() # Simulation - m = math.ceil(n/2) + m = math.ceil(n/2) + 1 eps = 1/6 # pylint: disable=invalid-name (circuit, _, M) = qasp.problems.estimation.exec_count(algorithm, oracle, m, eps) print(f'Used circuit:\n{tab(str(circuit.draw()))}\n') pause() print( - f'Estimated number of solutions: {M.lower:.2f} <= M <= {M.upper:.2f}.') + f'Estimated number of solutions: {M.lower:.2f} <{"" if M.left else "="} M', + f'<{"" if M.right else "="} {M.upper:.2f}.' + ) print() diff --git a/src/examples/quantum_counting_advanced.py b/src/examples/quantum_counting_advanced.py index 6338165..92e06b7 100644 --- a/src/examples/quantum_counting_advanced.py +++ b/src/examples/quantum_counting_advanced.py @@ -52,7 +52,9 @@ def main(): print(f'Used circuit:\n{tab(str(circuit.draw()))}\n') pause() print( - f'Estimated number of solutions: {M.lower:.2f} <= M <= {M.upper:.2f}.') + f'Estimated number of solutions: {M.lower:.2f} <{"" if M.left else "="} M', + f'<{"" if M.right else "="} {M.upper:.2f}.' + ) print() diff --git a/src/examples/quantum_faceted_navigation.py b/src/examples/quantum_faceted_navigation.py index 7edaec5..3ae5efc 100644 --- a/src/examples/quantum_faceted_navigation.py +++ b/src/examples/quantum_faceted_navigation.py @@ -81,7 +81,9 @@ def main(): print(f'Used circuit:\n{tab(str(circuit.draw()))}\n') pause() print( - f'Estimated number of solutions: {M.lower:.2f} <= M <= {M.upper:.2f}.') + f'Estimated number of solutions: {M.lower:.2f} <{"" if M.left else "="} M', + f'<{"" if M.right else "="} {M.upper:.2f}.' + ) print()