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 sampling overhead table and expand/update cutting explanation #342

Merged
merged 21 commits into from
Apr 17, 2024

Conversation

garrison
Copy link
Member

@garrison garrison commented Jul 28, 2023

This adds a sampling overhead table. I should triple check it. I may push other improvements to the cutting explanation to this branch, too.

EDIT: I've added many other improvements, too.

Fixes #293.
Fixes #373.

@garrison garrison added documentation Improvements or additions to documentation tests Related to tests cutting QPD-based circuit cutting code labels Jul 28, 2023
@github-actions
Copy link

github-actions bot commented Jul 28, 2023

Pull Request Test Coverage Report for Build 6052437701

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 91.945%

Totals Coverage Status
Change from base Build 6051869755: 0.0%
Covered Lines: 2968
Relevant Lines: 3228

💛 - Coveralls

@garrison garrison self-assigned this Aug 18, 2023
@garrison garrison added this to the 0.3.1 milestone Aug 18, 2023
@garrison garrison modified the milestones: 0.3.1, 0.4.1 Sep 13, 2023
@garrison garrison modified the milestones: 0.4.1, 0.5.1 Oct 31, 2023
@garrison garrison modified the milestones: 0.5.1, 0.6.1 Mar 6, 2024
@garrison garrison changed the title Add sampling overhead table Add sampling overhead table and expand and update cutting explanation Apr 4, 2024
@garrison garrison changed the title Add sampling overhead table and expand and update cutting explanation Add sampling overhead table and expand/update cutting explanation Apr 4, 2024
@garrison garrison added the stable backport potential Suitable to be backported to most recent stable branch by Mergify label Apr 4, 2024
@garrison garrison marked this pull request as ready for review April 6, 2024 01:22
@garrison
Copy link
Member Author

garrison commented Apr 6, 2024

I will likely keep tweaking this, and I still plan to further expand the explanation document a bit (either before or after this PR is merged -- doesn't matter to me), but this is already a substantial contribution and is in a good place, essentially ready for review.

The most convenient way to review it probably is to either build it locally or to download the artifact from the Docs CI run. (Click on the docs run, then click "Summary", then click "html_docs.")

@garrison garrison modified the milestones: 0.6.1, 0.7.0 Apr 9, 2024
@garrison
Copy link
Member Author

garrison commented Apr 9, 2024

@caleb-johnson and @ibrahim-shehzad: Requesting your review. Any comments are truly welcome, but just remember this doesn't need to be perfect before we merge; we can always iterate on it later.

Co-authored-by: Ibrahim Shehzad <75153717+ibrahim-shehzad@users.noreply.github.com>
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.

This is excellent work. Im going to make another pass tomorrow, but I left a few small comments

docs/circuit_cutting/explanation/index.rst Outdated Show resolved Hide resolved

There are three settings to consider for circuit cutting. The first is where only local operations (LO) [i.e., local *quantum* operations] are available. The other settings introduce classical communication between the circuit executions, which is known in the quantum information literature as LOCC, for `local operations and classical communication <https://en.wikipedia.org/wiki/LOCC>`__. The LOCC can be either near-time, one-directional communication between the circuit executions (the second setting), or real-time, bi-directional communication (the third setting).
There are `three settings <https://research.ibm.com/blog/circuit-knitting-with-classical-communication>`__ to consider for circuit cutting. The first is where only local operations (LO) [i.e., local *quantum* operations] are available. The other settings introduce classical communication between the circuit executions, which is known in the quantum information literature as LOCC, for `local operations and classical communication <https://en.wikipedia.org/wiki/LOCC>`__. The LOCC can be either near-time, one-directional communication between the circuit executions (the second setting), or real-time, bi-directional communication (the third setting).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we mention here we only support Case 1?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see we mention it below

docs/circuit_cutting/explanation/index.rst Show resolved Hide resolved
docs/circuit_cutting/explanation/index.rst Outdated Show resolved Hide resolved

Circuit cutting as a quasiprobability decomposition (QPD)
---------------------------------------------------------
Quasiprobability decomposition is a technique which can be used to simulate quantum circuit executions that go beyond the actual capabilities of current quantum hardware while using that same hardware. It forms the basis of many error mitigation techniques, which allow simulating a noise-free quantum computer using a noisy one. Circuit cutting techniques, which allow simulating a quantum circuit using fewer qubits than would otherwise be necessary, can also be phrased in terms of a quasiprobability decomposition. No matter the goal, the cost of the quasiprobability decomposition is an exponential overhead in the number of circuit executions which must be performed. In certain cases, this tradeoff is worth it, because it can allow the estimation of quantities that would otherwise be impossible on today's hardware.

To perform circuit cutting, one must partition (“cut”) the graph representing a quantum circuit into smaller pieces, which are then executed on available hardware. The results of the original circuit must then be reconstructed during post-processing, resulting in the desired quantity (e.g., the expectation value of a joint observable).
There are two types of cuts: gate cuts and wire cuts. Gate cuts, also known as "space-like" cuts, exist when the cut goes through a gate operating on two (or more) qubits. Wire cuts, also known as "time-like" cuts, are direct cuts through a qubit wire, essentially a single-qubit identity gate that has been cut into two pieces. In CKT, a wire cut is represented by introducing a new qubit into the circuit and moving remaining operations after the cut identity gate to the new qubit; see :ref:`wire cutting as move`, below.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Super minor point: I realize that using space-like cuts for gate cuts and time-like cuts for wire cuts is common in the cutting literature but I find this terminology very confusing. This is because if we think of time as flowing horizontally, from left to right in a quantum circuit, a space-like cut should be a ''vertical'' cut (since space-like cuts give you ''constant time slices'') which would be more analogous to a wire cut. Do we need to use the ''space-like/time-like cut'' terminology? Alternatively, I could consider getting rid of my relativity baggage :).

Co-authored-by: Ibrahim Shehzad <75153717+ibrahim-shehzad@users.noreply.github.com>
Co-authored-by: Ibrahim Shehzad <75153717+ibrahim-shehzad@users.noreply.github.com>
Copy link
Collaborator

@ibrahim-shehzad ibrahim-shehzad left a comment

Choose a reason for hiding this comment

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

I think we may just be able to ignore the contention I raised in this comment (since the literature uses this terminology). Overall, this looks good to me, thanks for putting this together.

@garrison garrison merged commit 299c849 into main Apr 17, 2024
11 checks passed
@garrison garrison deleted the overhead-table branch April 17, 2024 20:08
mergify bot pushed a commit that referenced this pull request Apr 17, 2024
* Add sampling overhead table

* typos

* Fix heading level

* Rearrange table

* Fix some Sphinx cross references

* Fix Sphinx LaTeX expressions

* Add link to IBM blog post on LOCC cutting

* Tweaks to intro

* Lots of progress

* Update docs/circuit_cutting/explanation/index.rst

Co-authored-by: Ibrahim Shehzad <75153717+ibrahim-shehzad@users.noreply.github.com>

* Rephrase LOCC vs dynamic circuits

following discussion at
#342 (comment)

* Removed `PauliList` limitation, lifted by #523

Follow up to
#342 (comment)

* Rephrase circuit cutting intro

#342 (comment)

* Remove circuit cutting graph

It's actually very similar to the one at the top of the explanation

#342 (comment)

* Update docs/circuit_cutting/explanation/index.rst

Co-authored-by: Ibrahim Shehzad <75153717+ibrahim-shehzad@users.noreply.github.com>

* Update docs/circuit_cutting/explanation/index.rst

Co-authored-by: Ibrahim Shehzad <75153717+ibrahim-shehzad@users.noreply.github.com>

---------

Co-authored-by: Ibrahim Shehzad <75153717+ibrahim-shehzad@users.noreply.github.com>
(cherry picked from commit 299c849)

# Conflicts:
#	test/cutting/qpd/test_qpd.py
garrison added a commit that referenced this pull request Apr 17, 2024
…ckport #342) (#553)

* Add sampling overhead table and expand/update cutting explanation (#342)

* Add sampling overhead table

* typos

* Fix heading level

* Rearrange table

* Fix some Sphinx cross references

* Fix Sphinx LaTeX expressions

* Add link to IBM blog post on LOCC cutting

* Tweaks to intro

* Lots of progress

* Update docs/circuit_cutting/explanation/index.rst

Co-authored-by: Ibrahim Shehzad <75153717+ibrahim-shehzad@users.noreply.github.com>

* Rephrase LOCC vs dynamic circuits

following discussion at
#342 (comment)

* Removed `PauliList` limitation, lifted by #523

Follow up to
#342 (comment)

* Rephrase circuit cutting intro

#342 (comment)

* Remove circuit cutting graph

It's actually very similar to the one at the top of the explanation

#342 (comment)

* Update docs/circuit_cutting/explanation/index.rst

Co-authored-by: Ibrahim Shehzad <75153717+ibrahim-shehzad@users.noreply.github.com>

* Update docs/circuit_cutting/explanation/index.rst

Co-authored-by: Ibrahim Shehzad <75153717+ibrahim-shehzad@users.noreply.github.com>

---------

Co-authored-by: Ibrahim Shehzad <75153717+ibrahim-shehzad@users.noreply.github.com>
(cherry picked from commit 299c849)

# Conflicts:
#	test/cutting/qpd/test_qpd.py

* Fix conflict

---------

Co-authored-by: Jim Garrison <garrison@ibm.com>
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 stable backport potential Suitable to be backported to most recent stable branch by Mergify tests Related to tests
Projects
None yet
3 participants