Skip to content

Condition errors on noiseless qubits#446

Merged
perlinm merged 46 commits into
mainfrom
immune-2q-err
Jul 7, 2026
Merged

Condition errors on noiseless qubits#446
perlinm merged 46 commits into
mainfrom
immune-2q-err

Conversation

@perlinm

@perlinm perlinm commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator

(AI-assisted summary:)

Adds per-qubit immunity (immune_qubits + immunize_gates) alongside broadened multi-qubit noise support in NoiseModel.

New capabilities

  • noisy_circuit(..., immune_qubits=..., immunize_gates=True/False) — declare qubits immune to noise; immunize_gates=True (default) drops any noise on gates that touch an immune qubit; immunize_gates=False supports proper PauliChannel conditioning via PauliChannel.conditioned_on(...) (a new public method).
  • PauliChannel — sparse multi-qubit Pauli channel usable directly in NoiseRule(after=...) or auto-wrapped from a Mapping[str, float | Iterable[float]].

API changes

  • NoiseRule.after is now PauliChannel | Mapping | stim.Circuit | None. Rules cannot combine after-noise with readout_error / reset_error.
  • Native PAULI_CHANNEL_1/2 emission when arity ≤ 2; CORRELATED_ERROR chain for higher arities.
  • OP_TYPES / BROADCAST_1Q_NOISE / BROADCAST_2Q_NOISE now derived from stim.gate_data().

Correctness fixes (from review):

  • MXX/MYY/MZZ splitter now correctly per-pair (was per-target)
  • qubit-reuse detection with insert_ticks=False unconditional
  • tags preserved through the immunization pipeline
  • immunity policy centralized in NoiseModel (was scattered across NoiseRule / _immunize_noise).

acasta-yhliu and others added 12 commits March 27, 2026 14:00
TargetedNoiseRule class is appended to the code, and implmented is_targeted_noisy_op
The implementation follows `NoiseRule.noisy_operation` for now
…getedNoiseRule`

An `immunize_qubits` function is appended and called in `_inplace_append_noisy_moment`. Detailed implementation is remain incomplete.
tests are added to noise_model_test.py for TargetedNoiseRule, the behavior of immunize_qubits is still remain incomplete.
…AULI_CHANNEL_2

tests are modified to cover new written code, need further refactor to make the code cleaner
@perlinm perlinm linked an issue Apr 13, 2026 that may be closed by this pull request
1 task
@perlinm
perlinm marked this pull request as draft April 13, 2026 23:43
@perlinm perlinm removed a link to an issue Jul 6, 2026
1 task
@perlinm perlinm changed the title Support target-specific noise models Marginalize errors on immune qubits Jul 6, 2026
@perlinm perlinm changed the title Marginalize errors on immune qubits Marginalize errors on noiseless qubits Jul 6, 2026
@perlinm perlinm changed the title Marginalize errors on noiseless qubits Condition errors on noiseless qubits Jul 6, 2026
@perlinm
perlinm marked this pull request as ready for review July 7, 2026 14:12
@perlinm
perlinm merged commit 0541e37 into main Jul 7, 2026
3 checks passed
@perlinm
perlinm deleted the immune-2q-err branch July 7, 2026 14:33
@perlinm perlinm mentioned this pull request Jul 7, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants