-
Notifications
You must be signed in to change notification settings - Fork 131
Update figure names to include qubit indices #1163
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
Update figure names to include qubit indices #1163
Conversation
In my opinion it's fine to completely omit Fig, Exp, and index. So |
I'd like that too, but I think it wouldn't work if there's an experiment that outputs multiple figures, right? The index would still be needed then to distinguish them. |
### Summary This PR adds a ``device_components`` field to the experiment metadata that is a list of qubits used in the experiment by default. Experiments that use custom components need to override this metadata field (just `ResonatorSpectroscopy` so far). It also exposes device components in the documentation and updates the custom experiment tutorial. #1163 depends on this PR to add the metadata so that non-qubit components can be correctly identified for figure names.
The name has been updated to omit |
the experiment, with format ``StandardRB_Q0_Q1_Q2_Q3_Q5_b4f1d8ad.svg``. For composite | ||
experiments where ``flatten_results`` is set to ``True``, the head of the figure name is now the | ||
class name of the experiment instead of ``ParallelExperiment`` or ``BatchExperiment``, such that | ||
the figure name is the same when ``flatten_results`` is ``False``. The behavior when a figure |
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.
In the code I don't see a change for composite experiments
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.
This is because of the new naming scheme as well as this addition:
https://github.com/Qiskit-Extensions/qiskit-experiments/blob/1fa7ed3ce07acc80dd0bde80d0918b464b76522b/qiskit_experiments/framework/experiment_data.py#L1164-L1166
Before, figures of composite experiments overwrote child experiment figure names with ParallelExperiment
or BatchExperiment
, but now we use the actual child experiment class to generate the figure name and don't overwrite in a composite experiment.
### Summary This PR updates figure names so that the physical qubit indices (up to 5) are included and changes the experiment type prefix to always be the experiment class (composite experiments with `flatten_results` on had the composite experiment class name before). The experiment type and device components have also been added to the figure metadata class. The behavior when `overwrite=False` is now to add a numerical suffix to the figure instead of throwing an error. ### Details and comments For a non-composite experiment on qubit 0, its previous figure name `StandardRB_Fig-0_Exp-83ca04ad.svg` would now be `StandardRB_Q0_83ca04ad.svg`. For a child RB experiment on qubits 0-7 inside a `ParallelExperiment` with `flatten_results=True`, its previous figure name `BatchExperiment_Fig-1_Exp-2b7f0a55.svg` would now be `StandardRB_Q0_Q1_Q2_Q3_Q4_2b7f0a55.svg`. For a resonator spectroscopy experiment on R0, the two output figures previously named `ResonatorSpectroscopy_Fig-0_Exp-6da333da.svg` and `ResonatorSpectroscopy_Fig-1_Exp-6da333da.svg` are now `ResonatorSpectroscopy_R0_6da333da.svg` and `ResonatorSpectroscopy_R0_6da333da-1.svg`.
Summary
This PR updates figure names so that the physical qubit indices (up to 5) are included and changes the experiment type prefix to always be the experiment class (composite experiments with
flatten_results
on had the composite experiment class name before). The experiment type and device components have also been added to the figure metadata class. The behavior whenoverwrite=False
is now to add a numerical suffix to the figure instead of throwing an error.Details and comments
For a non-composite experiment on qubit 0, its previous figure name
StandardRB_Fig-0_Exp-83ca04ad.svg
would now beStandardRB_Q0_83ca04ad.svg
.For a child RB experiment on qubits 0-7 inside a
ParallelExperiment
withflatten_results=True
, its previous figure nameBatchExperiment_Fig-1_Exp-2b7f0a55.svg
would now beStandardRB_Q0_Q1_Q2_Q3_Q4_2b7f0a55.svg
.For a resonator spectroscopy experiment on R0, the two output figures previously named
ResonatorSpectroscopy_Fig-0_Exp-6da333da.svg
andResonatorSpectroscopy_Fig-1_Exp-6da333da.svg
are nowResonatorSpectroscopy_R0_6da333da.svg
andResonatorSpectroscopy_R0_6da333da-1.svg
.