-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: protogalaxy combiner quotient (#3245)
This PR implements the computation of combiner quotient ($K$ polynomial in the paper) together with the necessary updates in various parts of the codebase: * In the Barycentric and Univariate classes , we can now provide evaluations with custom `domain_start` and `domain_end` rather than assuming the list of evaluations is for points starting from 0 onwards * In the common functionality shared between Sumcheck and Protogalaxy, I ensure the version of pow polynomial from PG paper can be used. Co-authored-by: codygunton <codygunton@gmail.com>
- Loading branch information
1 parent
ede7a47
commit db0f3ab
Showing
20 changed files
with
388 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
barretenberg/cpp/src/barretenberg/honk/proof_system/barycentric.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import numpy as np | ||
|
||
|
||
def get_A_at_z(z, xs): | ||
result = 1 | ||
for x in xs: | ||
result *= (z - x) | ||
return result | ||
|
||
def get_A_deriv(i, xs): | ||
result = 1 | ||
xi = xs[i] | ||
for j in range(len(xs)): | ||
if j != i: | ||
result *= (xi - xs[j]) | ||
return result | ||
|
||
|
||
|
||
points = [2,3] | ||
evals = [2, 3] | ||
|
||
z = 5 | ||
|
||
result = get_A_at_z(z, points) | ||
s = 0 | ||
for i in range(len(evals)): | ||
s += evals[i] / ((z - points[i])* get_A_deriv(i, points)) | ||
result *= s | ||
print(result) | ||
|
||
points = [32, 33, 34, 35, 36] | ||
evals = [1,11,111,1111,11111] | ||
|
||
z = 2 | ||
|
||
result = get_A_at_z(z, points) | ||
s = 0 | ||
for i in range(len(evals)): | ||
s += evals[i] / ((z - points[i])* get_A_deriv(i, points)) | ||
result *= s | ||
print(result) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.