mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-08 16:53:07 +00:00
Merge pull request #712 from mir-protocol/comment_batch_opening
Document batch opening function
This commit is contained in:
commit
554f62fd72
@ -180,7 +180,15 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>
|
|||||||
// Final low-degree polynomial that goes into FRI.
|
// Final low-degree polynomial that goes into FRI.
|
||||||
let mut final_poly = PolynomialCoeffs::empty();
|
let mut final_poly = PolynomialCoeffs::empty();
|
||||||
|
|
||||||
|
// Each batch `i` consists of an opening point `z_i` and polynomials `{f_ij}_j` to be opened at that point.
|
||||||
|
// For each batch, we compute the composition polynomial `F_i = sum alpha^j f_ij`,
|
||||||
|
// where `alpha` is a random challenge in the extension field.
|
||||||
|
// The final polynomial is then computed as `final_poly = sum_i alpha^(k_i) (F_i(X) - F_i(z_i))/(X-z_i)`
|
||||||
|
// where the `k_i`s are chosen such that each power of `alpha` appears only once in the final sum.
|
||||||
|
// There are usually two batches for the openings at `zeta` and `g * zeta`.
|
||||||
|
// The oracles used in Plonky2 are given in `FRI_ORACLES` in `plonky2/src/plonk/plonk_common.rs`.
|
||||||
for FriBatchInfo { point, polynomials } in &instance.batches {
|
for FriBatchInfo { point, polynomials } in &instance.batches {
|
||||||
|
// Collect the coefficients of all the polynomials in `polynomials`.
|
||||||
let polys_coeff = polynomials.iter().map(|fri_poly| {
|
let polys_coeff = polynomials.iter().map(|fri_poly| {
|
||||||
&oracles[fri_poly.oracle_index].polynomials[fri_poly.polynomial_index]
|
&oracles[fri_poly.oracle_index].polynomials[fri_poly.polynomial_index]
|
||||||
});
|
});
|
||||||
|
|||||||
@ -42,7 +42,7 @@ pub struct FriBatchInfoTarget<const D: usize> {
|
|||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct FriPolynomialInfo {
|
pub struct FriPolynomialInfo {
|
||||||
/// Index into `FriInstanceInfoTarget`'s `oracles` list.
|
/// Index into `FriInstanceInfo`'s `oracles` list.
|
||||||
pub oracle_index: usize,
|
pub oracle_index: usize,
|
||||||
/// Index of the polynomial within the oracle.
|
/// Index of the polynomial within the oracle.
|
||||||
pub polynomial_index: usize,
|
pub polynomial_index: usize,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user