Skip to content

Pulse's channel index validation fails #10475

@TsafrirA

Description

@TsafrirA

Environment

  • Qiskit Terra version: 0.25.0 (main)
  • Python version: 3.9
  • Operating system: Windows

What is happening?

Channel index validation doesn't produce a PulseError when the channel is either non-integer or negative. Only when both are true.

How can we reproduce the issue?

The following should produce a PulseError, but it doesn't:

from qiskit import pulse

pulse.DriveChannel(0.5)
pulse.DriveChannel(-1)

Because of this line, only when the index is both not an integer and negative, an error is raised. This does raise a PulseError:

pulse.DriveChannel(-1.5)

What should happen?

A PulseError should be raised if either of the conditions are met.

Any suggestions?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions