Skip to content

target.get_calibration fails for entries with a fixed parameter #11657

@ajavadia

Description

@ajavadia

Environment

  • Qiskit Terra version: main
  • Python version: 3.8
  • Operating system: mac

What is happening?

This is another issue about how the string identfiers (keys) in Target are conflated with the actual operation.

I think target.get_calibration's signature is problematic. It takes a string, qubits, and parameters. However if the Operation associated with this entry is a parameterized operation which has been entered with a fixed parameter, the binding of the supplied parameter fails. So this function should return the calibration for an Operation, and not have to rely on the string identifiers.

I hit this in the PulseGates pass which is run automatically in the preset passmanagers. This pass tries to look up the cal for all instructions in the Target.

How can we reproduce the issue?

cal = Schedule()  # empty schedule for demonstration purposes
rzx_props = {
(0, 1): InstructionProperties(duration=1.04e-6, error=.01, calibration=cal),
}

target.add_instruction(RZXGate(np.pi / 4), rzx_props, name='rzx')
target.get_calibration('rzx', (0, 1), np.pi/6)  # this raises with any angle value, even if it matches the original angle

What should happen?

should return the cal for RZX(np.pi/6) which has been stored in the Target. More likely, the signature of target.get_calibration() should change.

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