qiskit-ibm-runtime icon indicating copy to clipboard operation
qiskit-ibm-runtime copied to clipboard

`IBMBackend.target_history()` doesn't include the historical calibrations

Open TsafrirA opened this issue 4 months ago • 0 comments

Describe the bug When you retrieve a historical Target using IBMBackend.target_history(), the calibrations defined in the target are the same as the current ones.

Steps to reproduce

from qiskit_ibm_runtime import QiskitRuntimeService
from datetime import timezone, datetime

service = QiskitRuntimeService()
backend = service.get_backend("ibm_cusco")

times = [datetime(day=1, month=4,year=2024, tzinfo=timezone.utc), datetime(day=10, month=4,year=2024, tzinfo=timezone.utc)]
for time in times:
    target = backend.target_history(datetime=time)
    amp = target.get_calibration("x", (0, )).instructions[0][1].pulse.amp
    print(amp)
    
target = backend.target
amp = target.get_calibration("x", (0, )).instructions[0][1].pulse.amp
print(amp)

All three amplitudes are the same, indicating that the historical calibrations are not retrieved.

Expected behavior The function definition suggests that the Target will be the same as the historical one, and the calibrations will be the ones used at that time.

Suggested solutions Either return the correct calibrations, or clarify that they are not retrieved. (Return empty calibrations to avoid confusions?)

Additional Information I am guessing that in the transition to Target a while back, this function was built on top of a similar option existing for the legacy properties() which didn't include the calibrations at the time.

  • qiskit-ibm-runtime version: 0.22
  • Python version: 3.9
  • Operating system: windows

TsafrirA avatar Apr 14 '24 05:04 TsafrirA