Noise module: build a CycleChannel from a per-instruction rule, and expose MeasurementChannel back-action
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with pyquil.noise._channels, especially CycleChannel.__post_init__, CycleChannel.expanded_instructions, ChannelBase.to_pauli_vector(), and MeasurementChannel; compare the existing expansion helper in pyquil.simulation._resolver. Decide how the two proposed APIs should expose instruction context and measurement back-action conventions, then add focused tests for cycle expansion and outcome-summed measurement behavior, including leakage for higher-dimensional instruments.
Written by the indexing model from the issue text.
Description
Two small API requests for the experimental Quax-based noise module (pyquil.noise._channels), related to the tracking issue #1863. Both come from downstream code that converts a NoiseModel into other representations (for example a Pauli/stabilizer simulator) and currently has to reach into private helpers or re-derive things the channel classes already know.
1. Build a CycleChannel from a rule for one instruction
CycleChannel.__post_init__ requires one channel for every instruction in the cycle's DefCircuit body. To supply them, a caller first has to expand the DEFCIRCUIT invocation into concrete instructions, and the only way to do that today is the private pyquil.simulation._resolver.expand_defcircuit_body:
body = list(expand_defcircuit_body(invocation, defcircuit, circuit_definitions={}))
channels = tuple(channel_for(inst, body) for inst in body)
cycle_channel = CycleChannel(inst=invocation, defcircuit=defcircuit, channels=channels)
This pattern is repeated wherever a model is described by a rule ("every CZ gets this channel, an idle lasts as long as the slowest operation in its cycle") instead of an explicit list.
Proposal: a constructor that does the expansion, e.g.
CycleChannel.from_rule(
inst, # the Gate that invokes the cycle
defcircuit,
channel_for, # Callable[[instruction, Sequence[instruction]], CycleConstituent]
)
where channel_for receives the concrete instruction and all concrete instructions of its cycle (so that idle durations and similar context-dependent quantities can be derived). Alternatively, making the expansion itself public (it already backs CycleChannel.expanded_instructions) would be enough.
2. Back-action of a MeasurementChannel as a Pauli vector (and leakage)
ChannelBase.to_pauli_vector() gives the Pauli-twirled error of a gate channel. MeasurementChannel has no equivalent, so consumers that need the post-measurement disturbance (the QND error) as a Pauli channel compute it themselves from process.total_channel(), and can easily choose slightly different conventions (for example conditioning on the reported outcome or not).
Proposal: a method on MeasurementChannel that returns the back-action in a documented convention, e.g.
MeasurementChannel.to_pauli_vector() -> Array # [I, X, Y, Z] applied after the measurement
read from the outcome-summed channel: the bit-flip probability averaged over the computational basis states, conditioned on staying in the computational subspace. For instruments on more than two levels, the same populations also give the measurement-induced leakage and seepage probabilities, which would be useful to expose alongside it (possibly as separate methods).
Happy to open a PR for either if the shape of the API sounds right.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 366
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rigetti/pyquil
-
`compiler_isa_to_target_quantum_processor` calls the deprecated `CompilerISA.dict()`, warning on every compilePossibly taken @Goldloli claimed this 13 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Docs: add troubleshooting help about how quilc's --protoquil flag affects shot countPossibly taken @Notedpsyche claimed this 55 days ago. Opendocumentation :memo:
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
bug :bug:
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
-
bug :bug: documentation :memo: v3
Difficulty 1/5 Under an hour Newbie friendliness 70/100
-
Documentation Fix: the QVM URL environment variable should be QVM_URL, not QCS_URLMay be free again A pull request for this issue was closed without being merged. Openbug :bug:
Difficulty 1/5 Under an hour Newbie friendliness 65/100
Similar issues
-
auto-reported bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
stix-atlas.json: the same relationship id is used for several different mitigates relationshipsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
backend bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
nolte/kamerplanter#3193 ·
Maintainers usually reply within 1 day
-
soup prune-prompt exits 1 after writing its output on a file over 100,000 rows, and reports a capped row count otherwisePossibly taken @abdulwaarith0 claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
MakazhanAlpamys/Soup#3690 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day