Skip to content

Add my_static_costs override for accurate QubitCounts for qrom bloqs #1414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 24, 2024

Conversation

tanujkhattar
Copy link
Collaborator

Adds support for correctly counting number of qubits for cases when the exact data is not available, and hence it's not possible to create the circuit decomposition.

@mpharrigan
Copy link
Collaborator

for testing sympy equality, they recommend subtracting the two expressions and asserting that it simplifies to zero. using == tests for strict equality of the expression itself (i.e. its format or in-memory rep)

@@ -183,11 +183,11 @@ def test_dirtyoutofplacemontgomerymodmul_symbolic_cost(uncompute):

# Litinski 2023 https://arxiv.org/abs/2306.08585
# Figure/Table 8. Lists modular multiplication as 2.25n^2+9n toffoli.
# The following formula is 2.25n^2+8.25n-1 written with rationals because sympy comparison fails with floats.
# The following formula is 2.25n^2+7.25n-1 written with rationals because sympy comparison fails with floats.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NoureldinYosri Can you please verify that this change is expected? I've simply updated the test assuming the constant factor reduction in qroam uncomputation is translating into reduced constant factors here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the constant factor from qroam gets multiplied by $n/4$ here so it reduces the coefficient of $n$

@tanujkhattar tanujkhattar enabled auto-merge (squash) September 24, 2024 00:30
@tanujkhattar tanujkhattar merged commit 21ef526 into quantumlib:main Sep 24, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants