Skip to content

Add data structures for multilinear extensions - #140

Merged
Pratyush merged 54 commits into
arkworks-rs:masterfrom
tsunrise:multilinear
Jan 11, 2021
Merged

Add data structures for multilinear extensions#140
Pratyush merged 54 commits into
arkworks-rs:masterfrom
tsunrise:multilinear

Conversation

@tsunrise

@tsunrise tsunrise commented Dec 16, 2020

Copy link
Copy Markdown
Contributor

Description

  • Add multilinear extension (evaluation form of multilinear polynomial where the domain is boolean hypercube) data structures in ark-poly crate.
    • create module evaluations, and rename Evaluations as evaluations::univariate::UVEvaluations
    • add trait MultilinearExtension, and two implemetors DenseMultilinearExtension and SparseMultilinearExtension
    • Add dependency hashbrown
  • Add related benchmarks in ark-poly-benches
    • Add benchmarks for sparse and dense multilinear extensions

closes: #XXXX


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.

  • Targeted PR against correct branch (main)
  • Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@tsunrise tsunrise changed the title add multilinear trait add data structures for multilinear polynomials Dec 16, 2020
@tsunrise tsunrise changed the title add data structures for multilinear polynomials Add data structures for multilinear polynomials Dec 17, 2020
@tsunrise

tsunrise commented Dec 17, 2020

Copy link
Copy Markdown
Contributor Author

Not sure why, but there's some compilation problem related to serialization after I merged #144 today. e.g.:

error[E0276]: impl has stricter requirements than trait
  --> poly\src\domain\radix2.rs:26:64
   |
26 | #[derive(Copy, Clone, Hash, Eq, PartialEq, CanonicalSerialize, CanonicalDeserialize)]
   |                                                                ^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `R: ark_std::io::Read`

and

error[E0277]: the trait bound `W: ark_serialize::Write` is not satisfied
  --> poly\src\domain\general.rs:49:63
   |
49 |             GeneralEvaluationDomain::Radix2(d) => d.serialize(&mut writer),
   |                                                               ^^^^^^^^^^^ the trait `ark_serialize::Write` is not implemented for `W`

(I have not changed anything in domain folder)
Is there any workaround? @weikengchen

@weikengchen

Copy link
Copy Markdown
Member

Let me have a try

@weikengchen

Copy link
Copy Markdown
Member

It seems that the cause is as follows:

  • This PR uses ark_std's rand branch.
  • The ark-serialize uses the master branch of ark_std.

Is there a reason to use the rand branch? Otherwise, this PR may have a dependency on merging of the rand branch.

@tsunrise

tsunrise commented Dec 17, 2020

Copy link
Copy Markdown
Contributor Author

Thanks! I am using ark-std::{UniformRand, test_rng} (which was only available on rand branch yesterday) because ark_ff::test_rng was marked deprecated. I will use ark_std master branch instead.

@tsunrise

Copy link
Copy Markdown
Contributor Author

Hi Ryan, I have added trait MVPolynomialCoefficientForm<F: Field> and MultilinearPolynomialEvaluationForm<F: Field>, and SparsePolynomial implements MVPolynomialCoefficientForm<F: Field>. Does that make sense? @ryanleh

@ryanleh
ryanleh self-requested a review December 21, 2020 03:58
Comment thread poly/src/evaluations/multivariate/multilinear/dense.rs Outdated
Comment thread poly/src/evaluations/multivariate/multilinear/dense.rs Outdated
Comment thread poly/src/evaluations/multivariate/multilinear/dense.rs Outdated
Comment thread poly/src/evaluations/multivariate/multilinear/dense.rs Outdated
Comment thread poly/src/evaluations/multivariate/multilinear/dense.rs Outdated
Comment thread poly/src/evaluations/multivariate/multilinear/dense.rs Outdated
Comment thread poly/src/evaluations/multivariate/multilinear/mod.rs Outdated
Comment thread poly/src/evaluations/multivariate/multilinear/mod.rs Outdated
Comment thread poly/src/evaluations/multivariate/multilinear/sparse.rs
Comment thread CHANGELOG.md Outdated
@tsunrise
tsunrise requested a review from Pratyush January 7, 2021 23:47
Comment thread README.md Outdated
Comment thread poly/src/evaluations/multivariate/multilinear/dense.rs Outdated
Comment thread poly/src/evaluations/multivariate/multilinear/dense.rs Outdated
Comment thread poly/src/evaluations/multivariate/multilinear/mod.rs Outdated
Comment thread poly/src/evaluations/multivariate/multilinear/mod.rs Outdated

@Pratyush Pratyush left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo the documentation changes!

@Pratyush
Pratyush merged commit 4cc5b8a into arkworks-rs:master Jan 11, 2021
@tsunrise
tsunrise deleted the multilinear branch January 12, 2021 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants