-
Notifications
You must be signed in to change notification settings - Fork 27
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
Lagrange basis aurora speedup2 #30
base: lagrange_basis_aurora_speedup2
Are you sure you want to change the base?
Changes from 2 commits
e23b714
4f4e7af
bc48bf5
bc57df1
e0b9cfc
41d5b19
642be38
97f4350
bdf24af
73e9786
94fe672
246cdea
db03d90
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,11 +36,11 @@ void multi_lincheck_virtual_oracle<FieldT>::set_challenge(const FieldT &alpha, c | |
|
||
enter_block("multi_lincheck compute random polynomial evaluations"); | ||
|
||
/* Set alpha polynomial, and its evaluations */ | ||
/* Set alpha polynomial, variable and constraint domain polynomials, and their evaluations */ | ||
this->p_alpha_ = lagrange_polynomial<FieldT>(alpha, this->constraint_domain_); | ||
this->p_alpha_evals_ = this->p_alpha_.evaluations_over_field_subset(this->constraint_domain_); | ||
this->vd_vp_ = vanishing_polynomial<FieldT>(this->variable_domain_); | ||
this->cd_vp_ = vanishing_polynomial<FieldT>(this->constraint_domain_); | ||
this->variable_domain_vanishing_polynomial_ = vanishing_polynomial<FieldT>(this->variable_domain_); | ||
this->constraint_domain_vanishing_polynomial_ = vanishing_polynomial<FieldT>(this->constraint_domain_); | ||
leave_block("multi_lincheck compute random polynomial evaluations"); | ||
|
||
/* Set p_alpha_ABC_evals */ | ||
|
@@ -94,24 +94,28 @@ std::shared_ptr<std::vector<FieldT>> multi_lincheck_virtual_oracle<FieldT>::eval | |
* [TODO: cite Succinct Aurora] instead of powers of alpha. */ | ||
/* Compute p_alpha_prime. */ | ||
std::vector<FieldT> p_alpha_prime_over_codeword_domain; | ||
std::vector<FieldT> vd_vp_evaluations; | ||
std::vector<FieldT> cd_vp_evaluations; | ||
|
||
|
||
/* If |variable_domain| > |constraint_domain|, we multiply the Lagrange sampled | ||
polynomial by Z_{variable_domain}*Z_{constraint_domain}^-1 */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
if (this->variable_domain_.num_elements() > this->constraint_domain_.num_elements()){ | ||
if (this->variable_domain_.num_elements() < this->constraint_domain_.num_elements()){ | ||
p_alpha_prime_over_codeword_domain = | ||
this->p_alpha_.evaluations_over_field_subset(this->codeword_domain_); | ||
}else{ | ||
/* inverses of the evaluations of constraint domain polynomial */ | ||
std::vector<FieldT> constraint_domain_vanishing_polynomial_inverses; | ||
std::vector<FieldT> variable_domain_vanishing_polynomial_evaluations; | ||
p_alpha_prime_over_codeword_domain = this->p_alpha_.evaluations_over_field_subset(this->codeword_domain_); | ||
|
||
vd_vp_evaluations = this->vd_vp_.evaluations_over_field_subset(this->codeword_domain_); | ||
cd_vp_evaluations = this->cd_vp_.evaluations_over_field_subset(this->codeword_domain_); | ||
variable_domain_vanishing_polynomial_evaluations = this->variable_domain_vanishing_polynomial_ | ||
.evaluations_over_field_subset(this->codeword_domain_); | ||
constraint_domain_vanishing_polynomial_inverses = batch_inverse(this->constraint_domain_vanishing_polynomial_ | ||
.evaluations_over_field_subset(this->codeword_domain_)); | ||
|
||
for (int i = 0; i < vd_vp_evaluations.size(); i++) | ||
p_alpha_prime_over_codeword_domain[i] *= vd_vp_evaluations[i] * cd_vp_evaluations[i].inverse(); | ||
for (int i = 0; i < variable_domain_vanishing_polynomial_evaluations.size(); i++) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor note, can you put the following line of code in a |
||
p_alpha_prime_over_codeword_domain[i] *= variable_domain_vanishing_polynomial_evaluations[i] | ||
* constraint_domain_vanishing_polynomial_inverses[i]; | ||
|
||
}else{ | ||
p_alpha_prime_over_codeword_domain = | ||
this->p_alpha_.evaluations_over_field_subset(this->codeword_domain_); | ||
} | ||
|
||
/* p_{alpha}^2 in [BCRSVW18] */ | ||
|
@@ -165,8 +169,8 @@ FieldT multi_lincheck_virtual_oracle<FieldT>::evaluation_at_point( | |
|
||
if (this->variable_domain_.num_elements() > this->constraint_domain_.num_elements()) | ||
FieldT p_alpha_prime_X = this->p_alpha_.evaluation_at_point(evaluation_point) * | ||
this->vd_vp_.evaluation_at_point(evaluation_point) * | ||
this->cd_vp_.evaluation_at_point(evaluation_point).inverse(); | ||
this->variable_domain_vanishing_polynomial_.evaluation_at_point(evaluation_point) * | ||
this->constraint_domain_vanishing_polynomial_.evaluation_at_point(evaluation_point).inverse(); | ||
else | ||
FieldT p_alpha_prime_X = this->p_alpha_.evaluation_at_point(evaluation_point); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change that citation to be [BCGGRS19]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err, no the original citation was right. I meant can you change the TODO haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my bad, yeah will be fixed in upcoming commit.