-
Notifications
You must be signed in to change notification settings - Fork 33
Lagrange basis aurora speedup2 #30
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
base: lagrange_basis_aurora_speedup2
Are you sure you want to change the base?
Changes from 1 commit
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 |
---|---|---|
|
@@ -39,7 +39,8 @@ void multi_lincheck_virtual_oracle<FieldT>::set_challenge(const FieldT &alpha, c | |
/* Set alpha polynomial, and its 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_); | ||
leave_block("multi_lincheck compute random polynomial evaluations"); | ||
|
||
/* Set p_alpha_ABC_evals */ | ||
|
@@ -92,9 +93,24 @@ std::shared_ptr<std::vector<FieldT>> multi_lincheck_virtual_oracle<FieldT>::eval | |
/* p_{alpha}^1 in [BCRSVW18], but now using the lagrange polynomial from | ||
* [TODO: cite Succinct Aurora] instead of powers of alpha. */ | ||
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. Can you change that citation to be [BCGGRS19]? 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. 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 commentThe reason will be displayed to describe this comment to others. Learn more.
Oh my bad, yeah will be fixed in upcoming commit. |
||
/* Compute p_alpha_prime. */ | ||
std::vector<FieldT> p_alpha_prime_over_codeword_domain = | ||
std::vector<FieldT> p_alpha_prime_over_codeword_domain; | ||
std::vector<FieldT> vd_vp_evaluations; | ||
std::vector<FieldT> cd_vp_evaluations; | ||
if (this->variable_domain_.num_elements() > this->constraint_domain_.num_elements()){ | ||
ValarDragon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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_); | ||
|
||
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(); | ||
ValarDragon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
}else{ | ||
p_alpha_prime_over_codeword_domain = | ||
this->p_alpha_.evaluations_over_field_subset(this->codeword_domain_); | ||
} | ||
|
||
/* p_{alpha}^2 in [BCRSVW18] */ | ||
const std::vector<FieldT> p_alpha_ABC_over_codeword_domain = | ||
FFT_over_field_subset<FieldT>(this->p_alpha_ABC_.coefficients(), this->codeword_domain_); | ||
|
@@ -133,13 +149,26 @@ FieldT multi_lincheck_virtual_oracle<FieldT>::evaluation_at_point( | |
const std::vector<FieldT> &constituent_oracle_evaluations) const | ||
{ | ||
UNUSED(evaluation_position); | ||
FieldT p_alpha_prime_X; | ||
if (constituent_oracle_evaluations.size() != this->matrices_.size() + 1) | ||
{ | ||
throw std::invalid_argument("multi_lincheck uses more constituent oracles than what was provided."); | ||
} | ||
|
||
FieldT p_alpha_prime_X = this->p_alpha_.evaluation_at_point(evaluation_point);; | ||
// Depending on the cardinalities of the constraint / variable domain | ||
// multiplies the constraint domain vanishing polynomial Z_C = (Z_C(a) - Z_C(X)) / (a - X) with Z_V / Z_C, where | ||
// Z_V is the variable domain vanishing polynomial. Since polynomials typically don't have inverses, | ||
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. Can you make this comment the same as the one in |
||
// We instead consider the inverse via pointwise multiplication. | ||
|
||
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(); | ||
else | ||
FieldT p_alpha_prime_X = this->p_alpha_.evaluation_at_point(evaluation_point); | ||
|
||
FieldT p_alpha_ABC_X = this->p_alpha_ABC_.evaluation_at_point(evaluation_point); | ||
|
||
if (this->use_lagrange_) | ||
{ | ||
const std::vector<FieldT> lagrange_coefficients = | ||
|
@@ -159,4 +188,4 @@ FieldT multi_lincheck_virtual_oracle<FieldT>::evaluation_at_point( | |
return (f_combined_Mz_x * p_alpha_prime_X - fz_X * p_alpha_ABC_X); | ||
} | ||
|
||
} // libiop | ||
} // libiop |
Uh oh!
There was an error while loading. Please reload this page.