Skip to content

Ajc/updates to docs for migration#818

Open
abbycross wants to merge 10 commits into
Qiskit:mainfrom
abbycross:ajc/updates-to-docs-for-migration
Open

Ajc/updates to docs for migration#818
abbycross wants to merge 10 commits into
Qiskit:mainfrom
abbycross:ajc/updates-to-docs-for-migration

Conversation

@abbycross

Copy link
Copy Markdown

Preparing addon docs for migration to IBM Quantum Platform

In this package, the number of samples taken from the distribution is generally controlled by a ``num_samples`` argument, and each sample has an associated weight that is used during expectation value reconstruction. Each weight with absolute value above a threshold of 1 / ``num_samples`` will be evaluated exactly. The remaining low-probability elements — those in the tail of the distribution — will then be sampled, resulting in at most ``num_samples`` unique weights. Setting ``num_samples`` to infinity indicates that all weights should be generated rigorously, rather than by sampling from the distribution.

Much of the circuit cutting literature describes a process where we sample from the distribution, take a single shot, then sample from the distribution again and repeat; however, this is not feasible in practice, so we instead perform all sampling upfront. For now, because of limitations in version 1 of the Qiskit primitives, we take a fixed number of shots for each considered subexperiment and send the subexperiments to the backend(s) in batches. During reconstruction, each subexperiment contributes to the final result with proportion equal to its weight. One must ensure the number of shots taken is sufficient for the heaviest weighted subexperiment. In the future, we plan to support passing an individual ``shots`` count with each subexperiment to Qiskit Runtime, so that each subexperiment will be run with a number of shots proportional to that subexperiment's weight in the final result (see issue `#532 <https://github.com/Qiskit/qiskit-addon-cutting/issues/532>`__). This per-experiment shots count is a new feature enabled by version 2 of the Qiskit primitives.
Much of the circuit cutting literature describes a process where we sample from the distribution and take a single shot, then sample from the distribution again and repeat; however, this is not feasible in practice, so we instead perform all sampling upfront. For now, because of limitations in version 1 of the Qiskit primitives, we take a fixed number of shots for each considered subexperiment and send the subexperiments to the backend(s) in batches. During reconstruction, each subexperiment contributes to the final result with proportion equal to its weight. We must ensure the number of shots taken is sufficient for the heaviest weighted subexperiment. In the future, we plan to support passing an individual ``shots`` count with each subexperiment to Qiskit Runtime, so that each subexperiment will be run with a number of shots proportional to that subexperiment's weight in the final result (see issue `#532 <https://github.com/Qiskit/qiskit-addon-cutting/issues/532>`__). This per-experiment shots count is a new feature enabled by version 2 of the Qiskit primitives.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Does this require any updating in:re primitives, or is this all still true?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The primitives now support this, but this addon still isn't able to leverage that feature -- that's what the issue is about. So I think the wording should be updated to reflect that the primitives v2 have the necessary feature, and there is an open issue to allow the addon to leverage this. I suggest removing the phrase "In the future, we plan to support" because it is not clear that anyone has plans at this point to fix this issue.

By the way, I expect that the &mdash;s will not render properly in Sphinx/restructedtext. Would you be open to using either three contiguous hyphens (---) or a unicode mdash?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think unicode will work but I'm not sure how translation will deal with the three hyphens (which is why I have been using &mdash; in the first place). Will we still be running sphinx once the docs have migrated?

@garrison garrison Jun 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@eharvey328 can clarify -- but my understanding is that the documentation pipeline will run Sphinx and use its output as input to a later stage of the build. Assuming this is correct, then --- will be converted to the mdash unicode character when Sphinx runs.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ah I see! That would indeed make things easier. @eharvey328 would -- also get converted to emdash in unicode?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe that Sphinx will convert -- to an ndash instead.

@abbycross abbycross marked this pull request as ready for review June 12, 2026 15:09
Comment thread INSTALL.rst Outdated
@abbycross

Copy link
Copy Markdown
Author

Ready for review @garrison @jenglick

Comment thread docs/explanation/index.rst Outdated
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, they are single-qubit identity gates that have been cut into two pieces. In this package, 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`.

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).
There are `three settings <https://www.ibm.com/quantum/blog/circuit-knitting-with-classical-communication>`__ to consider for circuit cutting. The first is where only local operations (LO) &mdash; as in, local *quantum* operations &mdash; 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).

@garrison garrison Jun 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

will render by Sphinx as an mdash instead of literally as the text &mdash;

Suggested change
There are `three settings <https://www.ibm.com/quantum/blog/circuit-knitting-with-classical-communication>`__ to consider for circuit cutting. The first is where only local operations (LO) &mdash; as in, local *quantum* operations &mdash; 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://www.ibm.com/quantum/blog/circuit-knitting-with-classical-communication>`__ to consider for circuit cutting. The first is where only local operations (LO) --- as in, 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).

Comment thread docs/explanation/index.rst Outdated
Sample weights in the Qiskit addon for circuit cutting
------------------------------------------------------
In this package, the number of samples taken from the distribution is generally controlled by a ``num_samples`` argument, and each sample has an associated weight which is used during expectation value reconstruction. Each weight with absolute value above a threshold of 1 / ``num_samples`` will be evaluated exactly. The remaining low-probability elements -- those in the tail of the distribution -- will then be sampled, resulting in at most ``num_samples`` unique weights. Setting ``num_samples`` to infinity indicates that all weights should be generated rigorously, rather than by sampling from the distribution.
In this package, the number of samples taken from the distribution is generally controlled by a ``num_samples`` argument, and each sample has an associated weight that is used during expectation value reconstruction. Each weight with absolute value above a threshold of 1 / ``num_samples`` will be evaluated exactly. The remaining low-probability elements &mdash; those in the tail of the distribution &mdash; will then be sampled, resulting in at most ``num_samples`` unique weights. Setting ``num_samples`` to infinity indicates that all weights should be generated rigorously, rather than by sampling from the distribution.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
In this package, the number of samples taken from the distribution is generally controlled by a ``num_samples`` argument, and each sample has an associated weight that is used during expectation value reconstruction. Each weight with absolute value above a threshold of 1 / ``num_samples`` will be evaluated exactly. The remaining low-probability elements &mdash; those in the tail of the distribution &mdash; will then be sampled, resulting in at most ``num_samples`` unique weights. Setting ``num_samples`` to infinity indicates that all weights should be generated rigorously, rather than by sampling from the distribution.
In this package, the number of samples taken from the distribution is generally controlled by a ``num_samples`` argument, and each sample has an associated weight that is used during expectation value reconstruction. Each weight with absolute value above a threshold of 1 / ``num_samples`` will be evaluated exactly. The remaining low-probability elements --- those in the tail of the distribution --- will then be sampled, resulting in at most ``num_samples`` unique weights. Setting ``num_samples`` to infinity indicates that all weights should be generated rigorously, rather than by sampling from the distribution.

Comment thread INSTALL.rst Outdated
Comment thread docs/explanation/index.rst
Co-authored-by: Jim Garrison <jim@garrison.cc>
@garrison garrison added documentation Improvements or additions to documentation stable backport potential Suitable to be backported to most recent stable branch by Mergify labels Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation stable backport potential Suitable to be backported to most recent stable branch by Mergify

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants