-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calibrations or Experiments not working with Sampler usage with Qiskit DynamicsBackend #1487
Comments
There are a few issues at play here related to getting the measurement level communicated through the stack.
|
By the way, didn't you make your own |
In Qiskit, it is specified that memory should be a list (https://github.com/Qiskit/qiskit/blob/b9d5c9c6aeb4568b6e9fba8943517ebed300886d/qiskit/result/models.py#L38). While most code can work with either lists or numpy arrays, some can not, including BackendSamplerV2 in Qiskit (see qiskit-community/qiskit-experiments#1487). Here the numpy array data is converted to a nested list using `tolist()`.
Thanks for this detailed reply @wshanks. I have also tried to pass directly a pre-defined |
For point 2, I opened qiskit-community/qiskit-dynamics#367. The CI failed but the failures seemed unrelated to the change. It seems like the Dynamics repo needs some maintenance to run with the latest version of qiskit-ibm-runtime. |
Informations
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
The text was updated successfully, but these errors were encountered: