Closed rupeshknn closed 10 months ago
I just realized, the problem isn't just with meas_level=MeasLevel.KERNELED
. Even doing result = sim_backend.run(qc)
doesn't work as similar logic is evoked in Qiskit quantum-info. The 127 qubit open-access backends have made it infeasible to use DynamicsBackend.from_backend
in the way it currently works.
Thanks @rupeshknn
That's a funny issue... seems kind of like a fundamental problem that's going to need a deeper solution. I guess normally we won't work with so many dimensions, and the only reason we're encountering it here is because these dimensions have length 1 (i.e. are "trivial").
Hey Dan, for this PR, the bug isn't from DynamicsBackend.from_backend
. It has to do with how IQ data is computed. I've already added a test that ensures trivial sub-systems are not measured for IQ data-related means options. This works irrespective of whether the trivial subsystems were provided by the user or via from_backend
.
So, I don't see the need for another test. if you disagree, could you point out what exactly would this test be checking for?
Hey Dan, for this PR, the bug isn't from
DynamicsBackend.from_backend
. It has to do with how IQ data is computed. I've already added a test that ensures trivial sub-systems are not measured for IQ data-related means options. This works irrespective of whether the trivial subsystems were provided by the user or viafrom_backend
.So, I don't see the need for another test. if you disagree, could you point out what exactly would this test be checking for?
Ah I see - yes you're right. Apologies, I rushed through looking at this in a scramble to reply to a bunch of things after getting back from holidays.
Summary
Backends instantiated using
DynamicsBackend.from_backend
do not work withmeas_level
arg inDynamicsBackend.run
Details and comments
which is raised by qiskit_dynamics/backend/backend_utils.py:239 -->
probabilities_tensor = probabilities.reshape(list(reversed(subsystem_dims)))
This PR solves this error by removing all 1d (trivial) systems from the subsystem dims within the
_get_iq_data
function.More generally, however,
DynamicsBackend.from_backend
must assign aTarget
object with the correct number of qubits to the backend and have thesubsystem_dims
of only the required length.