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

feat: Simple ConvexChecker for one-off checks. #160

Open
aborgna-q opened this issue Nov 14, 2024 · 0 comments
Open

feat: Simple ConvexChecker for one-off checks. #160

aborgna-q opened this issue Nov 14, 2024 · 0 comments

Comments

@aborgna-q
Copy link
Collaborator

TopoConvexChecker does a full graph traversal on initialization, to optimise online is_convex queries.
This incurs an extra cost that is not amortized when running a single check before discarding the structure.

See for example

/// Whether the subgraph is convex.
pub fn is_convex(&self) -> bool {
let checker = TopoConvexChecker::new(self.graph());
self.is_convex_with_checker(&checker)
}

We should implement a simpler convexity checker for single operations, and use it where appropriate.

Discussion: CQCL/hugr#1656
Note the optimization proposal for only exploring nodes in the same hierarchy region. That could be used both here and in the general TopoConvexChecker.

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

1 participant