Skip to content

Commit

Permalink
Disambiguate the examples in poly/README
Browse files Browse the repository at this point in the history
  • Loading branch information
mmagician committed Oct 23, 2023
1 parent e4690c4 commit f8e0378
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions poly/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ let g: DenseMultilinearExtension<Fq> = DenseMultilinearExtension::from_evaluatio
);
// when evaluated at any point within the Boolean hypercube, f and g should be equal
let point_within_hypercube = &vec![Fq::from(0), Fq::from(1), Fq::from(1)];
assert_eq!(f.evaluate(&point_within_hypercube), g.evaluate(&point_within_hypercube).unwrap());
assert_eq!(
f.evaluate(&point_within_hypercube),
MultilinearExtension::evaluate(&g, &point_within_hypercube).unwrap()
);

// We can also define a MLE g'(x_0, x_1, x_2) by providing the list of non-zero evaluations:
let g_prime: SparseMultilinearExtension<Fq> = SparseMultilinearExtension::from_evaluations(
Expand All @@ -135,7 +138,9 @@ let g_prime: SparseMultilinearExtension<Fq> = SparseMultilinearExtension::from_e
);
// at any random point (X0, X1, X2), g == g' with negligible probability, unless they are the same function
let random_point = &vec![Fq::from(123), Fq::from(456), Fq::from(789)];
assert_eq!(g_prime.evaluate(&random_point).unwrap(), g.evaluate(&random_point).unwrap());
assert_eq!(
MultilinearExtension::evaluate(&g_prime, &random_point).unwrap(), MultilinearExtension::evaluate(&g, &random_point).unwrap()
);

```

Expand Down

0 comments on commit f8e0378

Please sign in to comment.