You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR creates all versions of half a comparison operation in $n$ toffoli complexity. The uncomputation of these bloqs has zero cost.
The half comparason operation is needed in the modular inversion bloq.
I also modify the OutOfPlaceAdder to allow it to not compute the extra And when it's not needed
---
This PR also shows how we can implement all versions of comparison by implementing just one. for example creating a half greater than bloq that use logarithmic depth is enough to implement all the others.
" - `bitsize`: Number of bits used to represent each input integer. The allocated output register is of size `bitsize+1` so it has enough space to hold the sum of `a+b`. \n",
189
+
" - `bitsize`: Number of bits used to represent each input integer. The allocated output register is of size `bitsize+1` so it has enough space to hold the sum of `a+b`.\n",
190
+
" - `is_adjoint`: Whether this is compute or uncompute version.\n",
191
+
" - `include_most_significant_bit`: Whether to add an extra most significant (i.e. carry) bit. \n",
190
192
"\n",
191
193
"#### Registers\n",
192
194
" - `a`: A bitsize-sized input register (register a above).\n",
193
195
" - `b`: A bitsize-sized input register (register b above).\n",
194
-
" - `c`: A bitize+1-sized LEFT/RIGHT register depending on whether the gate adjoint or not. \n",
196
+
" - `c`: The LEFT/RIGHT register depending on whether the gate adjoint or not. This register size is either bitsize or bitsize+1 depending on the value of `include_most_significant_bit`. \n",
195
197
"\n",
196
198
"#### References\n",
197
199
" - [Halving the cost of quantum addition](https://arxiv.org/abs/1709.06648). \n"
0 commit comments