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

CircBox option to prevent compiler modifications inside the box #1082

Open
ss2165 opened this issue Oct 17, 2023 · 5 comments
Open

CircBox option to prevent compiler modifications inside the box #1082

ss2165 opened this issue Oct 17, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@ss2165
Copy link
Member

ss2165 commented Oct 17, 2023

Often users want to write precise target-aware circuits and want the compiler to not modify them, it would be useful to offer this functionality in a composable way.

Inspired by braket's "verbatim box" I propose adding an option to circbox which signals to passes to skip the internals.

@ss2165 ss2165 added the enhancement New feature or request label Oct 17, 2023
@cqc-alec
Copy link
Collaborator

This seems a nice thing to be able to do. But it would need special-casing in the predicates system; e.g. a rebase pass would no longer guarantee that the circuit was in a specific gate set afterwards.

@trvto
Copy link
Contributor

trvto commented Oct 18, 2023

This seems a nice thing to be able to do. But it would need special-casing in the predicates system; e.g. a rebase pass would no longer guarantee that the circuit was in a specific gate set afterwards.

To avoid that problem, would it be enough to just have the rebase pass check that the "untouchable" box only contains allowed gates. If it doesn't, fail compilation?

@cqc-alec
Copy link
Collaborator

To avoid that problem, would it be enough to just have the rebase pass check that the "untouchable" box only contains allowed gates. If it doesn't, fail compilation?

Yes that would work.

@cqc-alec
Copy link
Collaborator

Actually, isn't the description here the wrong way round? Because right now, compilation passes don't go inside boxes: if you want to run a pass on the contents of a CircBox you have to do DecomposeBoxes() first. What is missing is a way to allow the internals of a CircBox to be modified by a compilation pass -- while retaining it as a box.

Copy link

github-actions bot commented Jun 8, 2024

This issue has been automatically marked as stale.

@github-actions github-actions bot added the stale label Jun 8, 2024
@github-actions github-actions bot removed the stale label Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants