This issue filed verbatim from a robot. Will update this comment and remove this note once I review it properly.
Context
pygsti.leakage.models.promote_bb_to_bt (added in #707) promotes a 2-qubit model to a qubit ⊗ qutrit model. Its handling of the idle is currently asymmetric, and a TODO in the code marks this as unfinished:
- At construction time it unconditionally inserts a trivial identity operation under
default_idle_gatename (tm_6level.operations[default_idle_gatename] = np.eye(36)).
- The gate-promotion loop then iterates over
non_idle_ops only, i.e. it skips whatever operation the source model stored under the idle label Label(()).
For an ideal source model the skipped idle is the identity, so nothing is lost today. But the treatment should be deliberate rather than incidental.
Questions to settle
- If the source model's idle is not the identity (e.g. a noisy target, or an idle with intentional dynamics), should
promote_bb_to_bt lift it like any other gate (via its unitary from the processor spec), warn, or refuse? Note that after #707 a non-static source model already triggers a DubiousTargetWarning, which partially covers the noisy case.
- Should the inserted 6-level idle respect
default_idle_gatename renaming the same way leaky_qubit_model_from_pspec does (where a '{idle}' gate in the pspec is renamed in place)?
- Should the idle appear on the leakage level as the identity (demure extension, matching the other gates) even when a future version supports nontrivial idles? Presumably yes, for consistency with
_lift_unitary_bb_to_bt.
Proposal
Lift the source idle's ideal unitary through the same _lift_unitary_bb_to_bt path as every other gate whenever the processor spec exposes one, and fall back to the identity only when the source has no idle at all. Remove the unconditional np.eye(36) insertion in favor of that uniform path, and delete the TODO.
Acceptance criteria
- The promoted model's idle equals the lifted source idle when one exists, and the identity otherwise; test both.
- Behavior documented in the
default_idle_gatename parameter description.
This issue filed verbatim from a robot. Will update this comment and remove this note once I review it properly.
Context
pygsti.leakage.models.promote_bb_to_bt(added in #707) promotes a 2-qubit model to a qubit ⊗ qutrit model. Its handling of the idle is currently asymmetric, and a TODO in the code marks this as unfinished:default_idle_gatename(tm_6level.operations[default_idle_gatename] = np.eye(36)).non_idle_opsonly, i.e. it skips whatever operation the source model stored under the idle labelLabel(()).For an ideal source model the skipped idle is the identity, so nothing is lost today. But the treatment should be deliberate rather than incidental.
Questions to settle
promote_bb_to_btlift it like any other gate (via its unitary from the processor spec), warn, or refuse? Note that after #707 a non-static source model already triggers aDubiousTargetWarning, which partially covers the noisy case.default_idle_gatenamerenaming the same wayleaky_qubit_model_from_pspecdoes (where a'{idle}'gate in the pspec is renamed in place)?_lift_unitary_bb_to_bt.Proposal
Lift the source idle's ideal unitary through the same
_lift_unitary_bb_to_btpath as every other gate whenever the processor spec exposes one, and fall back to the identity only when the source has no idle at all. Remove the unconditionalnp.eye(36)insertion in favor of that uniform path, and delete the TODO.Acceptance criteria
default_idle_gatenameparameter description.