Optimize CycleFold circuit MSM approach #143
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In CycleFold we want to compute
$P_{folded} = P_0 + r \cdot P_1 + r^2 \cdot P_2 + r^3 \cdot P_3 + ... + r^{n-2} \cdot P_{n-2} + r^{n-1} \cdot P_{n-1}$ , since the scalars follow the pattern r^i Youssef El Housni ( @yelhousni ) proposed to update the approach of the CycleFold circuit to reduce the number of constraints needed, by computing
$P_{folded} = (((P_{n-1} \cdot r + P_{n-2}) \cdot r + P_{n-3})... ) \cdot r + P_0$ .
By itself, this update reduces the number of constraints as the number of points being folded in the CycleFold circuit grows. But it also has impact at the HyperNova circuit, where it removes the need of using the bit representations of the powers of the random value, substancially reducing the amount of constraints used by the HyperNova AugmentedFCircuit.
The number of constraints difference in the CycleFold circuit and in the HyperNova's AugmentedFCircuit:
*num points: number of points being folded by the CycleFold circuit.
*folded instances: folded instances per step, half of them being LCCCS and the other half CCCS.