Skip to content

Conversation

coruscating
Copy link
Collaborator

@coruscating coruscating commented May 3, 2023

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.

@coruscating coruscating added this to the Release 0.6 milestone May 3, 2023
@yaelbh
Copy link
Collaborator

yaelbh commented May 4, 2023

In my opinion it's fine to completely omit Fig, Exp, and index. So StandardRB_Fig-0_Q3_Q1_Exp-0260886a.svg becomes StandardRB-Q3_Q1-0260886a.svg.

@coruscating
Copy link
Collaborator Author

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.

coruscating added a commit that referenced this pull request May 25, 2023
### 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.
@coruscating
Copy link
Collaborator Author

The name has been updated to omit Fig and Exp as suggested, with a numerical suffix added when there is a name conflict. The examples in the PR description have been updated.

@CLAassistant
Copy link

CLAassistant commented Jul 18, 2023

CLA assistant check
All committers have signed the CLA.

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
Copy link
Collaborator

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

Copy link
Collaborator Author

@coruscating coruscating Jul 26, 2023

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.

@coruscating coruscating added this pull request to the merge queue Jul 27, 2023
Merged via the queue into qiskit-community:main with commit dd62000 Jul 27, 2023
@coruscating coruscating deleted the update-figure-names branch July 27, 2023 14:28
nkanazawa1989 pushed a commit to nkanazawa1989/qiskit-experiments that referenced this pull request Jan 10, 2024
### 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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants