Skip to content

Conversation

@eggerdj
Copy link
Contributor

@eggerdj eggerdj commented Jun 4, 2021

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

prep = QuantumCircuit(1)
prep.x(0)

spec12 = QubitSpectroscopy(qubit, np.linspace(...), unit="Hz", pre_circuit=prep)

will create circuits like

           ┌───┐┌───────────────────┐ ░ ┌─┐
      q_0: ┤ X ├┤ Spec(4759400508.) ├─░─┤M├
           └───┘└───────────────────┘ ░ └╥┘
measure: 1/══════════════════════════════╩═
                                         0 

Copy link
Collaborator

@nkanazawa1989 nkanazawa1989 left a 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",

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)

Copy link
Contributor Author

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 ?

@eggerdj
Copy link
Contributor Author

eggerdj commented Jun 7, 2021

@nkanazawa1989 How about 3d8b6da ? My main concern with this is that we may end up having many different types of spectroscopy experiments lying around.

@eggerdj eggerdj mentioned this pull request Jun 8, 2021
4 tasks
Copy link
Collaborator

@nkanazawa1989 nkanazawa1989 left a 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.

@eggerdj eggerdj merged commit 5e590af into qiskit-community:main Jun 24, 2021
@eggerdj eggerdj deleted the spec_12 branch June 24, 2021 08:58
@coruscating coruscating added this to the Release 0.1 milestone Jun 24, 2021
paco-ri pushed a commit to paco-ri/qiskit-experiments that referenced this pull request Jul 11, 2022
* * 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>
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.

4 participants