-
Notifications
You must be signed in to change notification settings - Fork 54
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
Many Variations of QROAM #368
Labels
Comments
Some code from qualtran.cirq_interop import CirqGateAsBloq
from cirq_ft.algos.select_swap_qrom import SelectSwapQROM
num_bits = 15
data_size = 230
num_blocks = 2
sel_swap = SelectSwapQROM(
(10,)*data_size,
target_bitsizes=(15,),
block_size=2**num_blocks,
)
qroam = CirqGateAsBloq(
sel_swap
)
print(qroam.t_complexity())
cost_1 = int(np.ceil(data_size/2**num_blocks))
cost_2 = num_bits * (2**num_blocks - 1)
print(f"THC cost (no dirty ancilla) = {4*(cost_1 + cost_2)}")
print(f"THC cost (dirty ancilla) = {4*(2* cost_1 + 4*cost_2)}")
cost_1 = int(np.ceil(data_size/2**num_blocks))
cost_2 = num_bits * (2**num_blocks)
print(f"Select Swap QROM (no dirty ancilla) = {4*(cost_1 + 2 * cost_2)}")
cost_2 = num_bits * (2**num_blocks)
print(f"Select Swap QROM (dirty ancilla) = {4*(2 * cost_1 + 8 * cost_2)}")
|
I'm a little concerned that our Tcounts are quite different than what I might expect (option 4) but I imagine there's some leeway with the parameters. cc @tanujkhattar |
Merged
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was a little confused about the expected QROM costs when implementing something for THC.
There are at least four possible expected (Toffoli) costs:
d = data size, k = block size, M = number of bits of output.
[1] https://quantum-journal.org/papers/q-2019-12-02-208/pdf/ (page 9)
[2] https://arxiv.org/pdf/1812.00954.pdf Table II, rows 3 and 4, 4th column
The text was updated successfully, but these errors were encountered: