Closed DanPuzzuoli closed 1 year ago
I've now implemented all of the above changes. Here is the summary:
subsystem_labels
has been removed from the DynamicsBackend
options. Now, we will always view the labels of subsystems in DynamicsBackend
as being of the form [0, ..., num_qubits - 1]
. DynamicsBakend.from_backend
- the argument subsystem_list
was stored in subsystem_labels
to keep track of which subsystems were kept. With this being removed now, the returned DynamicsBackend
instead "keeps" the removed subsystems (the returned backend still looks like it has all qubits), but treats them as trivial by listing their dimension as 1
in the subsystem_dims
argument.Luckily this change doesn't impact any of the numerical functionality. In addition to the above:
subsystem_labels
have been changed. E.g. now, rather than checking if an index is in subsystem_labels
it will check if it's < len(subsystem_dims)
.I've also added an upgrade
release note explaining this change.
Summary
Closes #235
Details and comments (out of date, see next comment)
This is currently a draft to prototype a potential solution to #235, in which the
subsystem_labels
option is removed, and all qubits removed via thesubsystem_list
argument offrom_backend
are actually "kept" as trivial 1-dimensional systems.So far:
subsystem_labels
.subsystem_dims
infrom_backend
has been changed to include all pre-existing subsystems, but setting the dimension of the "removed" subsystems to1
(instead of not including them at all).Initial testing in a jupyter notebook seems to indicate that this behaves as expected:
from_backend
with a non-trivialsubsystem_list
, and the backend is built without issue.To do:
subsystem_labels
option was used to raise errors of non-existent subsystems were measured. As this no longer exists, it would be nice to still warn users if their schedule measures a trivial subsystem.Question:
subsystem_labels
option. I'm not sure how this could be deprecated, because it will literally serve no purpose and have no effect anymore.