-
Notifications
You must be signed in to change notification settings - Fork 5
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
pcs-change #130
pcs-change #130
Conversation
/// Distance of the linear code when avaible from linear code specification | ||
fn distance(&self) -> Result<f64, String>; | ||
/// Proximity gap of the linear code when avaible from linear code specification | ||
fn proximity_gap(&self) -> Result<f64, String>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use Result<f64, String>
, any error we need to handle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions are in CodeSpec trait, so I think some codes' distance and proximity_gap may be not available when only given the code specification.
I can remove it for simplicity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need these functions in the trait for now, could remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need these function to know distance and proximity gap of the code in BrakedownParams::new(num_vars: usize, code_spec: impl LinearCodeSpec<F, Code = C>)
only from code spec instead of code itself.
So we can compute
let estimated_queries = |distance: f64, gap: f64| { ceil(-(BRAKEDOWN_SECURITY_BIT as f64) / (1.0 - distance * gap).log2()) };
before instantiating a code from code_spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, then let's change the api to output a f64
type without handling the errors.
if num_cols > (1 << num_vars) { | ||
num_cols = 1 << num_vars; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if num_cols > (1 << num_vars) { | |
num_cols = 1 << num_vars; | |
} | |
num_cols = std::cmp::min(num_cols, 1 << num_vars>>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor changes
No description provided.