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

Fix inner product cost in list_decoding #2

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,16 +772,16 @@ def list_decoding(
k = k if k else int(MagicConstants.k_div_n * (n - 1))
theta = theta1 if theta1 else mp.pi / 3
pr = load_probabilities(d, n - 1, k)
ip_cost = MagicConstants.word_size ** 2 * d
dimension_d_ip_cost = MagicConstants.word_size ** 2 * d

def cost(pr, T1):
eta = 1 - ngr_pf(pr.d, pr.n, pr.k, beta=T1) / ngr(pr.d, beta=T1)
T2 = T1
N = 2 / ((1 - eta) * C(d, mp.pi / 3))
W0 = W(d, T1, T2, mp.pi / 3)
filters = 1.0 / W0
insert_cost = filters * C(d, T2) * ip_cost * log2(d) # Alg 4, Line 5
query_cost = filters * C(d, T1) * ip_cost * log2(d) # Alg 4, Line 8
insert_cost = filters * C(d, T2) * dimension_d_ip_cost # Alg 4, Line 5
query_cost = filters * C(d, T1) * dimension_d_ip_cost # Alg 4, Line 8
bucket_size = (filters * C(d, T1)) * (N * C(d, T2))

if metric in ClassicalMetrics:
Expand Down
242 changes: 121 additions & 121 deletions data/cost-estimate-list_decoding-classical.csv

Large diffs are not rendered by default.

242 changes: 121 additions & 121 deletions data/cost-estimate-list_decoding-dw.csv

Large diffs are not rendered by default.

242 changes: 121 additions & 121 deletions data/cost-estimate-list_decoding-g.csv

Large diffs are not rendered by default.

242 changes: 121 additions & 121 deletions data/cost-estimate-list_decoding-ge19.csv

Large diffs are not rendered by default.

242 changes: 121 additions & 121 deletions data/cost-estimate-list_decoding-naive_classical.csv

Large diffs are not rendered by default.

242 changes: 121 additions & 121 deletions data/cost-estimate-list_decoding-naive_quantum.csv

Large diffs are not rendered by default.

242 changes: 121 additions & 121 deletions data/cost-estimate-list_decoding-t_count.csv

Large diffs are not rendered by default.