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

Singeltonize Measure, Reset, and Barrier #10953

Closed
mtreinish opened this issue Oct 3, 2023 · 5 comments
Closed

Singeltonize Measure, Reset, and Barrier #10953

mtreinish opened this issue Oct 3, 2023 · 5 comments
Labels
Milestone

Comments

@mtreinish
Copy link
Member

What should we add?

In #10314 (comment) it was pointed out after #10314 merged that we can make some of the circuit instructions singletons pretty easily just as we did for parameterless gates. The Measure, Reset instruction are super straightforward to convert to singletons because they are single qubit/clbit constructs and do not take any parameters. Barrier also conceptually can be a "singleton" with a globally shared instance for barriers but as its variable width we'd need to store a distinct instance for each value of number of qubits that Barrier is instantiated with, which will require some custom handling as none of the singleton fixtures support this yet.

@Matrixmang0
Copy link
Contributor

Hii @mtreinish!

If this issue still unassigned, can I take up this issue

@mtreinish
Copy link
Member Author

@Matrixmang0 sure if you have the bandwidth for this feel free to give it a try. I'd recommend trying to use Measure or Reset to start (as the Barrier will be a little trickier)

@Matrixmang0
Copy link
Contributor

I'll certainly do my best. As I'm still getting acquainted with the repository, I'm uncertain about my bandwidth to tackle this issue. However, with your guidance, support from this incredible community, I'm hopeful that I can navigate through and resolve the issue :)

@mtreinish mtreinish modified the milestones: 1.0.0, 1.1.0 Jan 23, 2024
@mtreinish mtreinish changed the title Singeltonize Measure, Reset, and Barrier Singeltonize ~Measure, Reset,~ and Barrier Jan 23, 2024
@mtreinish mtreinish changed the title Singeltonize ~Measure, Reset,~ and Barrier Singeltonize Measure, Reset, and Barrier Jan 23, 2024
@jakelishman jakelishman modified the milestones: 1.1.0, 1.2.0 Apr 18, 2024
@jakelishman
Copy link
Member

Update on this: #11170 made Measure and Reset singletons, so that part of the issue is solved. Barrier is rather more non-trivial (and arguably will provide little benefit) because it would need greater modifications to the singleton machinery, which is tricky. We already have a prototype of this internally, made for other reasons, but it may not be worth the cost of adding it - the potential savings from barriers are not expected to be large.

@mtreinish
Copy link
Member Author

Given the last comment here I'm going to close this as complete because I think Barrier isn't worth singletonizing as there typically are only a few barriers in a circuit and dealing with the variable width is more effort than the benefits it would provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants