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

Convert Conditional/TailLoop-shaped CFGs into dataflow #818

Open
Tracked by #1392
acl-cqc opened this issue Jan 24, 2024 · 1 comment
Open
Tracked by #1392

Convert Conditional/TailLoop-shaped CFGs into dataflow #818

acl-cqc opened this issue Jan 24, 2024 · 1 comment
Assignees

Comments

@acl-cqc
Copy link
Contributor

acl-cqc commented Jan 24, 2024

CFGs that are already of appropriately simple shape can be transformed easily with the contents of each basic block placed into the corresponding Case (or the body of the TailLoop), etc.

@acl-cqc acl-cqc self-assigned this Jan 24, 2024
@cqc-alec
Copy link
Collaborator

cqc-alec commented May 1, 2024

See #561 (comment) .

@aborgna-q aborgna-q assigned doug-q and unassigned acl-cqc and doug-q May 15, 2024
github-merge-queue bot pushed a commit to CQCL/tket2 that referenced this issue Jun 17, 2024
Followup to #390.
Fixes #389.
Closes #385.
~~Blocked by CQCL/hugr#1175

Fixes support for non-`Dfg` circuits and circuits with a non-root
parent:

Adds a `Circuit::extract_dfg(&self)` function that extracts the circuit
into a new hugr with a DFG operation at the root.
In some cases, like in a CFG DataflowBlock node, this requires some
changes to the definition to eliminate the output sum type.
Here I only implemented it for the kind of blocks produced by guppy. We
could replace the manual implementation once
CQCL/hugr#818 gets implemented.

With this we can now fix #389 by extracting the circuit before using it
as a replacement in `SimpleReplacement::create_simple_replacement`.

Replaces `DfgBuilder` with `FunctionBuilder` where possible, so we can
use named circuits in the tests.
(This failed before due to the bug in CircuitRewrite).
@acl-cqc acl-cqc self-assigned this Nov 6, 2024
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

3 participants