Skip to content

Calibrations or Experiments not working with Sampler usage with Qiskit DynamicsBackend #1487

@arthurostrauss

Description

@arthurostrauss

Informations

  • Qiskit Experiments version: 0.8.0
  • Python version: 3.10
  • Operating system: Mac OS Sequoia

What is the current behavior?

Trying to set up calibration experiments or characterization experiments yield an error in the creation of the analysis result, making the whole workflow broken when used with Qiskit Dynamics.

The following is displayed when printing analysis_results():

Options {'execution': {'meas_type': 'kerneled'}} have no effect in local testing mode.

[]
Job data not added for errored job [Job ID: 9ac2115c-19ec-4b76-9b56-e7bd5876a9b6]
Error message: n/a

Steps to reproduce the problem

`
from qiskit.quantum_info import Operator
from qiskit_dynamics import DynamicsBackend, Solver
import numpy as np
from qiskit_experiments.library.calibration import RoughXSXAmplitudeCal
from qiskit_experiments.calibration_management import Calibrations, FixedFrequencyTransmon

Define the backend for the dynamics simulation

nu_z = 10.
nu_x = 1.
nu_d = 9.98 # Almost on resonance with the Hamiltonian's energy levels difference, nu_z

X = Operator.from_label('X')
Y = Operator.from_label('Y')
Z = Operator.from_label('Z')
s_p = 0.5 * (X + 1j * Y)

solver = Solver(
static_hamiltonian=.5 * 2 * np.pi * nu_z * Z,
hamiltonian_operators=[2 * np.pi * nu_x * X],
hamiltonian_channels=["d0"],
channel_carrier_freqs={"d0": nu_x},
dt=0.01,
)

dynamics_backend = DynamicsBackend(solver=solver, subsystem_dims=[2])

Calibrate a X gate

cals = Calibrations(libraries=[FixedFrequencyTransmon(["x", "sx"])])
exp = RoughXSXAmplitudeCal([0], cals, amplitudes=np.linspace(-0.2, 0.2, 21))
exp_data = exp.run(backend=dynamics_backend).block_for_results()

print(exp_data.analysis_results())`

What is the expected behavior?

The analysis result should at the very least not be empty and no error should be generated.

Suggested solutions

Check back how Experiments handles the PUB results from the primitive call and see if something does not break. For now when using backend_run=True, everything works normally.

Also, a change in Qiskit Runtime could be relevant for dealing with options efficiently, as it seems that an execution option for the experiment is dropped down by the call tp the local service

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