-
Notifications
You must be signed in to change notification settings - Fork 131
Generalize spectroscopy #82
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
Conversation
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.
I agree this is efficient in terms of implementation but I don't think this is right direction.
I think 0-1 spectroscopy and 1-2 spectroscopy should be defined as dedicated class, in terms of the concept of qiskit experiment, i.e. every experiment is dedicated to specific type of experiment. This is why we have experiment_type in metadata. This implementation deprecates the experiment_type field.
If we want to keep this logic, we should make this a private super class and define 0-1 spect and 1-2 spect as its subclass.
Another issue is, for example, qutrit cal can be done with qubit discriminator with 0-1 inversion pulse attached to measurement. See Fig 3.1 of this article. I prefer this method because default measurement pulse is not tuned to qutrit and separation of 1 and 2 blobs are not quite good. Sometime we see unwanted mixing of these states.
https://qudev.phys.ethz.ch/static/content/science/Documents/semester/Andreas_Landig_semesterthesis_131020.pdf
| self, | ||
| qubit: int, | ||
| frequencies: Union[List[float], np.array], | ||
| unit: Optional[str] = "Hz", |
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.
Not part of this PR, but I notice some hand-wired unit conversion code in the spectroscopy classes. If we continue to allow non-SI units this seems likely to be part of almost every experiment class -- should we pick a unit conversion library? (Otherwise it seems likely we'll end up with each class accepting slightly different sets)
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.
How bout like so de9daf0 ?
|
@nkanazawa1989 How about 3d8b6da ? My main concern with this is that we may end up having many different types of spectroscopy experiments lying around. |
* Improved MockIQBackend.
nkanazawa1989
left a comment
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.
Thanks Daniel, this looks almost good to me. I can approve this PR with couple of minor changes.
Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
* * Added the option to give a preparation circuit to spectroscopy to eneable, e.g. spec on 1<->2. * * Added preparation circuit name to metadata. * * Added e-f spectroscopy experiment. * * Added e-f spectroscopy to the init. * * Unit conversion. * * Fix unit conversion. * * Added the backend to _schedule in spectroscopy. * Improved MockIQBackend. * * Removed unused docstring. * Update qiskit_experiments/characterization/qubit_spectroscopy.py Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * * Refactored tests. * * Updated test to the refactored MockBackend * * removed pulse.drive_channel as it fails on some backends. * * Added class variable to fix the name of the spec gate. Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
Summary
This small extension allows the spectroscopy experiment to take a preparation circuit before running the spectroscopy pulse.
Details and comments
The preparation circuit allows us to e.g. prepare the first excited state and do spectroscopy on the 1<->2 transition. If the user gives a preparation circuit then the circuits to run will use this circuit followed the spec circuit with measurement.
For example
will create circuits like