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

Extract "Maximal pytket subgraphs" #636

Open
Tracked by #634
doug-q opened this issue Oct 2, 2024 · 0 comments
Open
Tracked by #634

Extract "Maximal pytket subgraphs" #636

doug-q opened this issue Oct 2, 2024 · 0 comments

Comments

@doug-q
Copy link
Contributor

doug-q commented Oct 2, 2024

It is important that we can successfully run tket1 on arbitrary Hugrs, so that we can at least rebase.

For graphs with control flow, this means running tket1 on each of many non-intersecting regions.

An admissible region is

  • A set of input wires
  • A convex sibling subgraph of a dataflow parent such that all incoming wires to the subgraph are in the set of input wires
  • all ops in the subgraph are admissible ops

Certainly all quantum ops are admissible ops, one might also choose to include float and/or rotation and/or logic ops.

An isolated quantum op is itself an admissible region, so we can find a minimal(in number, i.e. merge any two mergable regions) set of admissible regions covering every quantum op.

Now rewrite each admissible region into a DFG with no non-local edges. By the definition of admissible ops, only qubits, bools, floats, rotations can be input to the DFG.

Run tket1 on the DFG, mapping non-quantum inputs to symbols.

Note that rewriting into a DFG is not strictly required, we can run on an admissible region in-place. I suggest that rewriting into a DFG will be simpler and more tractable to understand going forward.

See #633

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