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

Implement Kikuchi graph oracles and block-encoding #1555

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

anurudhp
Copy link
Contributor

@anurudhp anurudhp commented Feb 14, 2025

part of #1348

Implements the Kikuchi graph adjacency matrix and adjacency list oracles, along with ones to load and index the constraints. And uses the oracles to build a sparse matrix block-encoding of the Kikuchi matrix.

@anurudhp
Copy link
Contributor Author

@tanujkhattar ptal!

Copy link
Collaborator

@tanujkhattar tanujkhattar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % nits

Note on sparsity: This bloq expects the user to provide the sparsity, as it is in general
difficult to compute the precise sparsity of the Kikuchi matrix efficiently. As long as the
provided number is at least the true sparsity, the algorithm will work as expected.
In case the provides sparsity is smaller, it is equivalent to making the remaining entries zero in the final block encoding.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In case the provides sparsity is smaller, it is equivalent to making the remaining entries zero in the final block encoding.
In case the provided sparsity is smaller, it is equivalent to making the remaining entries zero in the final block encoding.


The Kikuchi matrix is indexed by $S \in {[n] \choose k}$.
For a given row $S$ and column $T$, the entry $\mathcal{K}_{k}_{S, T}$
is potentially non-zero if $S \Delta T = U_j$ for some $j$, which is
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify whether $\Delta$ here refers to the symmetric difference operator ?

For a given row $S$ and column $T$, the entry $\mathcal{K}_{k}_{S, T}$
is potentially non-zero if $S \Delta T = U_j$ for some $j$, which is
equivalent to $T = S \Delta U_j$.
Here, $U_j$ is the $j$-th unique scope in the instance $\mathcal{I}$.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also not clear what you mean by "unique scope in the instance". Adding more details would be helpful!



@frozen
class KikuchiNonZeroIndex(Bloq):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that the context to understand what's happening in this Bloq becomes clearer if the user also reads some of the other bloq docstrings (eg: ones for kxor_instance and other kikuchi matrix bloqs). It'd be helpeful (here and elsewhere) if we (a) either include a brief overview of the problem setup and define the necessary terms OR (b) add a sentence the refers the reader to docstrings of other bloqs to understand the background so the explanation in the docstring is easier to follow. I've highlighted two examples below of things that are not immediately clear without additional context.

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

Successfully merging this pull request may close these issues.

3 participants