-
Notifications
You must be signed in to change notification settings - Fork 61
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
fix sub_dims
bug in _get_iq_data
#297
Conversation
I just realized, the problem isn't just with |
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"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. The only other thing I'd request is if you can add a test case to test.dynamics.backend.test_dynamics_backend.TestDynamicsBackend_from_backend
that would have caught this. I guess there aren't any test cases that actually compute outcomes. You could add one that integrates over a very short time interval (to avoid costly simulation) and computes the results. Thoughts?
Hey Dan, for this PR, the bug isn't from 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.