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

Add bitsize field to Cirq-FT Registers #6286

Merged
merged 2 commits into from
Sep 20, 2023

Conversation

tanujkhattar
Copy link
Collaborator

@tanujkhattar tanujkhattar commented Sep 12, 2023

Adds back the bitsize field to Cirq-FT registers. This brings the Cirq-FT registers another step closer to Qualtran registers and makes the interop easier.

This PR follows a brute force approach where the special meaning of bitsize is lost. In general, a qubit register with bitsize=K should behave like a 2 ** K dimension Qudit, instead of a K-qubit register. However, Cirq currently does not provide any way to express decomposition of gates acting on qudits in terms of other "simpler" gates that act on individual qubits. In Qualtran, this is expressed using Split and Join operations, but Cirq does not have an analogous concept.

In future, we can consider extending the Cirq infrastructure to support gates acting on Qudits with decompositions that manipulate the 2 dimensional subspaces corresponding to individual qubits that can be used to make up the qudit register. But it's out of scope for this PR.

@tanujkhattar tanujkhattar added the area/cirq-ft Issues related to the Cirq-FT sub-package label Sep 12, 2023
@tanujkhattar tanujkhattar requested review from vtomole, cduck and a team as code owners September 12, 2023 09:12
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@CirqBot CirqBot added the size: M 50< lines changed <250 label Sep 12, 2023
@tanujkhattar tanujkhattar added the BREAKING CHANGE For pull requests that are important to mention in release notes. label Sep 12, 2023
@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (d805d82) 97.88% compared to head (f9246a3) 97.88%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6286   +/-   ##
=======================================
  Coverage   97.88%   97.88%           
=======================================
  Files        1104     1104           
  Lines       95854    95863    +9     
=======================================
+ Hits        93831    93840    +9     
  Misses       2023     2023           
Files Changed Coverage Δ
cirq-core/cirq/ops/common_channels.py 99.74% <ø> (ø)
cirq-ft/cirq_ft/algos/swap_network.py 100.00% <100.00%> (ø)
cirq-ft/cirq_ft/infra/gate_with_registers.py 96.21% <100.00%> (+0.24%) ⬆️
cirq-ft/cirq_ft/infra/gate_with_registers_test.py 100.00% <100.00%> (ø)

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

@tanujkhattar tanujkhattar merged commit 8e4e7d1 into quantumlib:master Sep 20, 2023
35 checks passed
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 BREAKING CHANGE For pull requests that are important to mention in release notes. size: M 50< lines changed <250
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants