Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request updates the n_tiles calculation in CompactDataBlock to add 2 to the number of algorithm qubits before performing the calculation. It also adds corresponding unit tests in data_block_test.py to verify this behavior. There are no review comments, so I have no feedback to provide.
d7664a8 to
d2bda0d
Compare
The format check was still failing on your re-run because the code wasn't correctly formatted yet at that point, I'd fixed it locally since then. Just pushed the corrected version, black and ruff both confirm no formatting changes are needed on |
Closes #1943.
Main's current
n_tiles()computesceil(1.5 * n_algo_qubits + 2). This differs from the cited paper (Litinski, arXiv:1808.02892, page 7, Fig. 9: "A compact block stores n data qubits in 1.5n+3 tiles") due to operator precedenceceil(1.5*n + 2)is not the same asceil(1.5*(n+2))for most n (e.g. n=2 gives 5 here, vs. the paper-correct 6).This adds parentheses to match the paper:
ceil(1.5 * (n_algo_qubits + 2)), algebraically1.5n+3, matching the fix proposed and agreed on in the issue discussion.Before: n_algo_qubits=2 -> 5 tiles
After: n_algo_qubits=2 -> 6 tiles (matches the paper)
Added a parametrized test in
data_block_test.py(test_compact_block) covering n=2, 4, 100 against the paper-correct tile count.