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

Add single-qubit wire cutting how-to and expand_observables function #368

Merged
merged 8 commits into from
Aug 18, 2023

Conversation

garrison
Copy link
Member

I put the how-to and the new expand_observables function together in the same PR because the how-to requires the function. I think it's a decent name, but I'd be open to something better. (We can always choose a new name later, too.) This is the PR promised in #367.

@garrison garrison added documentation Improvements or additions to documentation cutting QPD-based circuit cutting code labels Aug 16, 2023
@garrison garrison requested a review from caleb-johnson August 16, 2023 22:02
@garrison garrison added this to the 0.3.0 milestone Aug 16, 2023
@garrison
Copy link
Member Author

I actually quite like the name expand_observables now that it is used alongside cut_wires (#370).

Copy link
Collaborator

@caleb-johnson caleb-johnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to take a look at notebooks, but a few small comments here. Looking great

idx = final_circuit.find_bit(qubit)[0]
except CircuitError as ex:
raise ValueError(
f"The {i}-th qubit of the `original_circuit` cannot be found "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the original and final circuits need to be comprised of the same Qubit instances, is that right?

If that's the case, we could add a sentence here telling users explicitly to build their two circuit using the same qubit instances. Or maybe this sentence is clear enough? What do you think?

Copy link
Member Author

@garrison garrison Aug 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change in a5ebfb8 is subtle, but I think it helps to clarify this. Since this function is meant to be used with cut_wires and cut_wires already maintains this condition, I don't think we need to belabor it IMO.

@caleb-johnson
Copy link
Collaborator

Notes on the how-to:

  • Link to arXiv, rather than just text
  • If we're going to finish out the workflow, we should move it to tutorials. Otherwise, I think you can cut it off after cell 7

@caleb-johnson
Copy link
Collaborator

caleb-johnson commented Aug 17, 2023

Notes on the how-to:

  • Link to arXiv, rather than just text
  • If we're going to finish out the workflow, we should move it to tutorials. Otherwise, I think you can cut it off after cell 7

I know there is value in showing the rest of the workflow is the same. I'll think more about how to make this more "how-to-y" and less "tutorial-y"

@garrison
Copy link
Member Author

I know there is value in showing the rest of the workflow is the same. I'll think more about how to make this more "how-to-y" and less "tutorial-y"

Yeah, the compromise I made was just to put all the "regular" steps in a single section at the end.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 5895817405

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.06%) to 91.226%

Totals Coverage Status
Change from base Build 5885129429: 0.06%
Covered Lines: 2724
Relevant Lines: 2986

💛 - Coveralls

@garrison
Copy link
Member Author

  • Link to arXiv, rather than just text

thanks, not sure how I missed this (copy and paste fail)

@garrison
Copy link
Member Author

I think I've addressed everything that is immediately actionable here. I'm going to merge it, and we can continue the discussion on anything I missed at #370, since it will mean taking a second pass over the how-to. If there are minor tweaks to expand_observables, too, we can add them there as well.

@garrison garrison merged commit 6ad32be into main Aug 18, 2023
@garrison garrison deleted the cutwire-howto branch August 18, 2023 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cutting QPD-based circuit cutting code documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants