Skip to content

Commit

Permalink
Fix bloq counts
Browse files Browse the repository at this point in the history
  • Loading branch information
fpapa250 committed Nov 5, 2024
1 parent c906ea6 commit 9e00baf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qualtran/bloqs/factoring/ecc/ec_add_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,12 @@ def test_ec_add_symbolic_cost():

# Litinski 2023 https://arxiv.org/abs/2306.08585
# Based on the counts from Figures 3, 5, and 8 the toffoli count for ECAdd is 126.5n^2 + 189n.
# The following formula is 126.5n^2 + 199.5n - 35. We account for the discrepancy in the
# The following formula is 126.5n^2 + 195.5n - 31. We account for the discrepancy in the
# coefficient of n by a reduction in the toffoli cost of Montgomery ModMult, an increase in the
# toffoli cost for Kaliski Mod Inverse, n extra toffolis in ModNeg, 2n extra toffolis to do n
# 3-controlled toffolis in step 2. The expression is written with rationals because sympy
# comparison fails with floats.
assert total_toff == sympy.Rational(253, 2) * n**2 + sympy.Rational(399, 2) * n - 35
assert total_toff == sympy.Rational(253, 2) * n**2 + sympy.Rational(391, 2) * n - 31


def test_ec_add(bloq_autotester):
Expand Down

0 comments on commit 9e00baf

Please sign in to comment.