Spartan
Spartan copied to clipboard
How to determine num_non_zero_entries
I do not understand num_non_zero_entries.
For a R1CS instance defined via matrices A,B,C, num_non_zero_entries refers to which matrix?
It appears to be essential for the runtime of SNARK proof.
- how can I determine it for a given R1CS instance (generated with NOVA for example)
- what happens if it is set to a value that is larger than the actual number of non-zeros
- what happens if it is set to a value that is smaller than the actual number of non-zeros
- can it be abstracted away s.t. we do not have to think about this argument any longer?
- why is it not relevant for the
NIZKprover?
Thanks for this great project! Cheers
R1CS instance is a 7-tuple: $(\mathbb{F}, A, B, C, \bf{io}, m, n)$, where $A, B, C$ are $m\times m$ matrices. num_non_zero_entries is actually the n in the R1CS instance, which dipct the sparsity and density of polynomials encoded by these matrices. When you get $A, B, C$ matrices, you can count the non-zero entries of the three matrices and define num_non_zero_entries with the max.