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

Confluently persistent Hugr data structure #2053

Open
lmondada opened this issue Apr 2, 2025 · 1 comment
Open

Confluently persistent Hugr data structure #2053

lmondada opened this issue Apr 2, 2025 · 1 comment
Assignees

Comments

@lmondada
Copy link
Contributor

lmondada commented Apr 2, 2025

Create a PersistentHugr struct that allows for non-destructive modifications of Hugrs. In other words CQCL/tket2#773 should be moved/generalised to Hugr.

This is blocked by

@lmondada lmondada self-assigned this Apr 2, 2025
@lmondada
Copy link
Contributor Author

lmondada commented Apr 2, 2025

Suggested naming scheme (pending #588)

  • PatchGraph: a whole bunch of Patches that are the result of applying rewrites, possibly conflicting. It's main purpose is to keep Rcs to the Patches that we are interested in during optimisation.
  • PatchHistory: a subgraph of PatchGraph that only contains non-conflicting rewrites that can be applied to obtain a Hugr.
  • PersistentHugr: the main object users will actually interact with. Implements HugrView, but is immutable and fully persistent. Is in fact a wrapper around PatchHistory.
  • Patch: a mostly module-internal struct that are the nodes of the PatchGraph and PatchHistory. It stores the location of an edit within its parent Patches, along with the new subgraph that replaces them. In the first version, the Patch will be a SimpleReplacement.

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