-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: Add StaticSizeCircuit #554
base: feat/badgerv2
Are you sure you want to change the base?
Conversation
8a46ea8
to
dd083ee
Compare
I'm reworking the definition of StaticSizeCirc, I'll let you know when this is ready to review! |
90f270f
to
58b5d31
Compare
58b5d31
to
67d6d90
Compare
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.
Looks good 👍
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.
Could this go inside portmatching/
? Or do we expect it to be used by anything else?
/// A circuit with a fixed number of qubits numbered from 0 to `num_qubits - 1`. | ||
#[derive(Clone, Default)] | ||
pub struct StaticSizeCircuit { | ||
/// All quantum operations on qubits. |
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.
Clarify a bit what's each vector about.
/// All quantum operations on qubits. | |
/// All quantum operations on each qubit. |
fn exists(&self, loc: OpLocation) -> bool { | ||
self.qubit_ops | ||
.get(loc.qubit.0) | ||
.map_or(false, |ops| ops.get(loc.op_idx).is_some()) |
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.
.map_or(false, |ops| ops.get(loc.op_idx).is_some()) | |
.map_or(false, |ops| loc.op_idx < ops.len()) |
I am starting work on an MVP for Badger v2. This will not be merged into main for a while, as
i) the performance of
portmatching
is currently significantly worse than the last versionii) the set of operations and types of circuits that is supported is very limited.
Description of
StaticSizeCircuit
This simple
struct
captures circuits with no classical data (and hence also no parametric angle). This will be the starting point to build patterns and compute updateable hashes.This could in principle be extended in the future to handle more cases, but neither Agustin nor I are convinced that this should ever find its way to
main
... Handling more general cases will require work into fast and updateable hashing.