Skip to content
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

Apply variable-spaced optimization to QROM circuits #6257

Merged
merged 6 commits into from
Aug 24, 2023

Conversation

tanujkhattar
Copy link
Collaborator

@tanujkhattar tanujkhattar commented Aug 23, 2023

Updates the unary iteration framework to allow "early termination" and uses this trick to apply the variable-spacing optimization to QROM circuits described in https://arxiv.org/pdf/2007.07391.pdf

As a drive-by fix, the PR also fixes a flaky bug in GreedyQubitManager where the free'd qubits were added to the pool of managed qubits in a non-deterministic order due to finding unique elements via set(qubits). Replaced with an order-preserving way of finding unique elements.

@tanujkhattar tanujkhattar requested review from vtomole, cduck and a team as code owners August 23, 2023 22:04
@CirqBot CirqBot added the size: M 50< lines changed <250 label Aug 23, 2023
@tanujkhattar tanujkhattar added the area/cirq-ft Issues related to the Cirq-FT sub-package label Aug 23, 2023
Copy link
Contributor

@fdmalone fdmalone left a comment

Choose a reason for hiding this comment

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

LGTM % adding an additional test case.

@tanujkhattar
Copy link
Collaborator Author

@fdmalone Added more tests and also updated the _value_equality_values_ method because the T-complexity will now depend upon the data to be loaded and not just on the shape of the registers.

Copy link
Contributor

@fdmalone fdmalone left a comment

Choose a reason for hiding this comment

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

LGTM

@tanujkhattar tanujkhattar enabled auto-merge (squash) August 24, 2023 00:02
@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (6e38a27) 97.60% compared to head (384bc61) 97.60%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6257      +/-   ##
==========================================
- Coverage   97.60%   97.60%   -0.01%     
==========================================
  Files        1116     1116              
  Lines       95772    95815      +43     
==========================================
+ Hits        93481    93519      +38     
- Misses       2291     2296       +5     
Files Changed Coverage Δ
cirq-core/cirq/protocols/json_serialization.py 97.68% <ø> (ø)
cirq-ionq/cirq_ionq/ionq_devices_test.py 100.00% <ø> (ø)
cirq-core/cirq/vis/heatmap_test.py 98.00% <100.00%> (-0.02%) ⬇️
cirq-ft/cirq_ft/algos/qrom.py 100.00% <100.00%> (ø)
cirq-ft/cirq_ft/algos/qrom_test.py 100.00% <100.00%> (ø)
cirq-ft/cirq_ft/algos/unary_iteration_gate.py 96.26% <100.00%> (+0.14%) ⬆️
cirq-ft/cirq_ft/infra/qubit_manager.py 100.00% <100.00%> (ø)
cirq-ft/cirq_ft/infra/qubit_manager_test.py 100.00% <100.00%> (ø)
cirq-ionq/cirq_ionq/ionq_client.py 100.00% <100.00%> (ø)
cirq-ionq/cirq_ionq/ionq_client_test.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tanujkhattar tanujkhattar merged commit 5bbdc22 into quantumlib:master Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cirq-ft Issues related to the Cirq-FT sub-package size: M 50< lines changed <250
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants