-
Notifications
You must be signed in to change notification settings - Fork 214
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
Merge dense MLEs & update documentation #763
base: master
Are you sure you want to change the base?
Conversation
The resulting polynomial is in 1 variable only, no need to index it
let num_vars = log2(next_pow_of_two); | ||
let mut evaluations: Vec<F> = Vec::with_capacity(next_pow_of_two); | ||
|
||
for poly in polys { |
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.
Isn't it better to limit ourselves to merging
This way, evaluating the merged polynomial at
Now, we cannot guarantee such meaning for the merged polynomial.
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.
The behavior is well defined when you pad with zeros, see the test case for unequal polys.
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.
Indeed it is well-defined in code, I see. I mean what is the meaning of the unequal case?
EDIT: Maybe the question is not relevant here. Never mind.
/// let eval_combined = mle.evaluate(&point); | ||
/// | ||
/// assert_eq!(eval_combined, (Fr::one() - point[2]) * eval_1 + point[2] * eval_2); | ||
pub fn merge(polys: impl IntoIterator<Item = impl AsRef<Self>> + Clone) -> Self { |
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.
What is the use case for this function? When would I want to concatenate two polynomials?
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.
For example in the case of committing to polynomials, instead of committing to 2^r different x-variate polynomials, one can commit to their merged polynomial which is (r+x)-variate polynomial (which can be faster depending on the scheme).
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.
This is something we could also use in our ark-spartan repo: https://github.com/arkworks-rs/spartan/blob/762fc57774fe70386532199911dd0955d58109e2/src/sparse_mlpoly.rs#L58
(will ofc require a larger refactor to switch from a custom DensePoly
to one from ark-poly
)
Description
Adapted from https://github.com/a16z/Lasso/blob/570831e6d9347c500e8397227647c4d71190ceaa/jolt-core/src/poly/dense_mlpoly.rs#L401
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
Pending
section inCHANGELOG.md
Files changed
in the GitHub PR explorer