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

Make it less verbose to construct multi-controlled Bloqs. #716

Open
tanujkhattar opened this issue Feb 27, 2024 · 1 comment
Open

Make it less verbose to construct multi-controlled Bloqs. #716

tanujkhattar opened this issue Feb 27, 2024 · 1 comment
Assignees
Milestone

Comments

@tanujkhattar
Copy link
Collaborator

bloq.controlled() gives a controlled version of a Bloq with a single control wire added. Another very common use-case is to construct a controlled version of a Bloq with n controls. Right now, the way to achieve that is bloq.controlled(CtrlSpec(cvs=[1]*num_controls)).

This feature request is to make the latter use case less verbose for users. For example, maybe bloq.controlled(num_controls) or, at the very least, something like bloq.controlled(CtrlSpec(num_controls=num_controls))

cc @mpharrigan

@tanujkhattar tanujkhattar changed the title Make it easier to construct multi-controlled Bloqs. Make it less verbose to construct multi-controlled Bloqs. Feb 27, 2024
@mpharrigan
Copy link
Collaborator

Yes, I think having a variant of CtrlSpec that supports just a number of controls would be a good extension. Whether we should provide syntactic sugar via the Bloq.controlled() method is up for debate. I'd say start with no sugar, and evaluate whether to add it in later.

@mpharrigan mpharrigan added this to the After v1.0 milestone Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants