Resonator spectroscopy#583
Conversation
The resonator spectroscopy experiment requires special data processing since the IQ points rotate around in the IQ plane as the frequency of the measurement pulse is shifted.
nkanazawa1989
left a comment
There was a problem hiding this comment.
Thanks Daniel. This is great start. I added couple of change requests for documentation and simplification. I feel this experiment motivate us to separate processor from analysis so that it can be flexibly configured.
|
|
||
| return schedule, freq_param | ||
|
|
||
| def circuits(self): |
There was a problem hiding this comment.
What is the reason we cannot reuse superclass method?
There was a problem hiding this comment.
Because in resonator spectroscopy we are attaching the pulse schedule to the measurement instruction which does not have a parameter. Therefore, we can not do:
circuit.add_calibration("measure", self.physical_qubits, sched_)
assigned_circ = circuit.assign_parameters({freq_param: freq_shift}, inplace=False)for example, the following simple test case will raise:
import qiskit.pulse as pulse
from qiskit.circuit import Parameter
from qiskit import QuantumCircuit
param = Parameter("amp")
with pulse.build(backend=None) as sched:
pulse.play(pulse.Drag(160, param, 2,0, 40), pulse.DriveChannel(2))
circ = QuantumCircuit(1, 1)
circ.measure(0, 0)
circ.add_calibration("measure", (2, ), sched)
circ.assign_parameters({param: 0.2345566}, inplace=False)
wshanks
left a comment
There was a problem hiding this comment.
This looks good to me, but I think all of Naoki's points are good.
I do wonder how the measurement is working here -- is the backend demodulating based on the shifted frequency of the drive or is it always demodulating at the nominal measure frequency.
* Docs and refs.
…copy.py Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
wshanks
left a comment
There was a problem hiding this comment.
I put a few minor comments in. I think this is very close to done. Besides those comments, there is my previous comment about acquisition duration and delay. Also, perhaps someone from #387 will weigh in.
Besides that, I think this is ready, though I was also hoping to see backend support added for this experiment before it was merged so I could try it out. My understanding is that the backend team has been trying to push out this support all week but has not been able to get the update through the QA pipeline without errors.
|
|
||
| circuit.metadata = { | ||
| "experiment_type": self._type, | ||
| "qubits": self.physical_qubits, |
There was a problem hiding this comment.
What is the circuit metadata used for? Does it matter that for the resonator spectroscopy the qubit is not really part of the experiment?
There was a problem hiding this comment.
The qubits entry does not matter. Tests run fine without it. The only crucial part of the metadata is the xval since this is what is used in the curve analysis. I think we can tacitly interpret this as being the qubit for which we are doing readout spec. Alternatively we could override the _add_metadata function in ResonatorSpectroscopy to change this field but this sounds like a bit too much.
…_spectroscopy_analysis.py Co-authored-by: Will Shanks <wshaos@posteo.net>
nkanazawa1989
left a comment
There was a problem hiding this comment.
Looks good to me with minor documentation changes. Please address my final comments and feel free to merge with @wshanks 's approval.
| from .analysis.resonator_spectroscopy_analysis import ResonatorSpectroscopyAnalysis | ||
|
|
||
|
|
||
| class ResonatorSpectroscopy(Spectroscopy): |
There was a problem hiding this comment.
You can use #section: examples to write some code. As you mentioned, we cannot set default value to run option since this is provider dependent. Even if we don't assume non-IBM provider for experiments, simulator may crash with invalid options (probably meas level and meas return are okey since they are defined in OpenPulse spec).
Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
…copy.py Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
* This PR introduces the resonator spectroscopy experiment which scans the frequency of a pulse applied to the readout resonator. It also switches the default resonance analysis to a Lorentzian fit instead of a Gaussian fit. Smaller changes allow developers to set resonators as target devices. Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Will Shanks <wshaos@posteo.net>
Summary
This PR will replace #90 which is rather old now. The experiment can be run as follows.
Details and comments
This experiment requires special data processing to correct for the fact that the IQ points rotate around in the IQ plane.
TODOs: