-
Notifications
You must be signed in to change notification settings - Fork 74
[open-systems] Testing Measurement-Based Uncomputation notebook #1698
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
base: main
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo a few nits.
"source": [ | ||
"# Verifying Measurement-Based Uncomputation\n", | ||
"\n", | ||
"Quantum information cannot be destroyed, but during a computation we may produce intermediate values that we wish to discard. We can \"uncompute\" these values by running the computation in reverse. The ordinary uncomputation strategy requires paying the cost of the computation twice, but [*Halving the cost of quantum addition.* Gidney 2017](https://arxiv.org/abs/1709.06648) shows how measurement in the X basis can effectively discard a bit without expensive uncomputation. The consequence is that the remaining states of the system will pick up phases depending on the random measurement result. [*Verifying Measurement Based Uncomputation.* Gidney 2019](https://algassert.com/post/1903) provides more detail about these phases. It also describes a proceedure for using a phased-classical simulator to \"fuzz test\" measurement-based uncomputation circuits.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think there should be a comma after "during a computation"
"\n", | ||
"and_dag = And(uncompute=True)\n", | ||
"for q1, q2 in itertools.product(range(2), repeat=2):\n", | ||
" trg = int(q1==1 and q2 == 1)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is 'trg'? I would probably use a better name.
It took me a while to realize this means "target". I would use that name here and below.
Avoid abbreviations: https://google.github.io/styleguide/pyguide.html#316-naming
" trg = int(q1==1 and q2 == 1)\n", | ||
" print(f'{q1=}, {q2=}, {trg=}', end=' ')\n", | ||
" (q1o, q2o), = and_dag.call_classically(ctrl=[q1,q2], target=trg)\n", | ||
" assert q1o == q1\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid abbreviations: https://google.github.io/styleguide/pyguide.html#316-naming
I would use q1_output.
Quantum information cannot be destroyed, but during a computation we may produce intermediate values that we wish to discard. We can "uncompute" these values by running the computation in reverse. The ordinary uncomputation strategy requires paying the cost of the computation twice, but Halving the cost of quantum addition. Gidney 2017 shows how measurement in the X basis can effectively discard a bit without expensive uncomputation. The consequence is that the remaining states of the system will pick up phases depending on the random measurement result. Verifying Measurement Based Uncomputation. Gidney 2019 provides more detail about these phases. It also describes a proceedure for using a phased-classical simulator to "fuzz test" measurement-based uncomputation circuits.
Here, we show how Qualtran can be used to verify measurement based uncomputation circuits following Gidney's proposal.