Skip to content

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

Description

@aborgna-q

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
https://github.com/CQCL/portgraph/blob/ebaed875004a4fcafab5a2502652c078eb293554/src/view/subgraph.rs#L99-L103

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

Discussion: Quantinuum/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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions