-
Notifications
You must be signed in to change notification settings - Fork 127
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
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.
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 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.
qiskit_experiments/library/characterization/analysis/resonator_spectroscopy_analysis.py
Show resolved
Hide resolved
qiskit_experiments/library/characterization/resonator_spectroscopy.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/library/characterization/resonator_spectroscopy.py
Outdated
Show resolved
Hide resolved
|
||
return schedule, freq_param | ||
|
||
def circuits(self): |
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.
What is the reason we cannot reuse superclass method?
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.
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)
releasenotes/notes/resonator-spectroscopy-89f790412838ba5b.yaml
Outdated
Show resolved
Hide resolved
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 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.
qiskit_experiments/library/characterization/qubit_spectroscopy.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/library/characterization/qubit_spectroscopy.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/library/characterization/resonator_spectroscopy.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/library/characterization/analysis/resonator_spectroscopy_analysis.py
Show resolved
Hide resolved
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.
Additional comments
qiskit_experiments/library/characterization/resonator_spectroscopy.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/library/characterization/resonator_spectroscopy.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/library/characterization/resonator_spectroscopy.py
Outdated
Show resolved
Hide resolved
…s into resonator_spec
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
qiskit_experiments/curve_analysis/standard_analysis/resonance.py
Outdated
Show resolved
Hide resolved
qiskit_experiments/library/characterization/analysis/resonator_spectroscopy_analysis.py
Outdated
Show resolved
Hide resolved
…_spectroscopy_analysis.py Co-authored-by: Will Shanks <[email protected]>
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
…s into resonator_spec
qiskit_experiments/library/characterization/resonator_spectroscopy.py
Outdated
Show resolved
Hide resolved
…copy.py Co-authored-by: Naoki Kanazawa <[email protected]>
* 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 <[email protected]> Co-authored-by: Will Shanks <[email protected]>
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: