Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to determine num_non_zero_entries #64

Open
mottla opened this issue Sep 29, 2023 · 1 comment
Open

How to determine num_non_zero_entries #64

mottla opened this issue Sep 29, 2023 · 1 comment

Comments

@mottla
Copy link

mottla commented Sep 29, 2023

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 NIZK prover?

Thanks for this great project!
Cheers

@Xor0v0
Copy link

Xor0v0 commented Jul 3, 2024

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.

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

No branches or pull requests

2 participants