Skip to content

promote_bb_to_bt: decide how the source model's idle gate is promoted #818

Description

@rileyjmurray

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

  1. 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.
  2. 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)?
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions