quantum_queries/test/bounds.py

13 lines
635 B
Python

import adversary
from math import sqrt
prover = adversary.Prover("= (ham x) k", "= (ham y) (+ k 1)", "<= ham (^ x y) p")
bounds = prover.find_bounds(16, 5, 3);
lower_bound = sqrt(bounds.min_x_relations * bounds.min_y_relations / bounds.max_joint_relations)
print("m =", bounds.min_x_relations)
print(f"From x={bounds.single_bounding_x:b}")
print("m' =", bounds.min_y_relations)
print(f"From y={bounds.single_bounding_y:b}")
print("ℓ·ℓ' =", bounds.max_joint_relations)
print(f"From x={bounds.joint_bounding_x:b} and y={bounds.joint_bounding_y:b} and window={bounds.bounding_window:b}")
print(f"Query lower bounds = {lower_bound}")