qiskit-community / qiskit-experiments

Qiskit Experiments
https://qiskit-community.github.io/qiskit-experiments/
Apache License 2.0
163 stars 126 forks source link

Use correct target device components #171

Open jyu00 opened 3 years ago

jyu00 commented 3 years ago

Informations

What is the current behavior?

In DbAnalysisResultV1 there is a required field called device_components, which defines the target components of the analysis (e.g. qubits or resonators). Currently all analysis classes just specify qubits even when they should be resonators.

Steps to reproduce the problem

What is the expected behavior?

Suggested solutions

Per @nkanazawa1989 :

some experiment, such as resonator spectroscopy #90, will need to put Resonator instead of Qubit. 
We need to generalize definition the target element, i.e. from qubits to device component. 
Otherwise frequency value measured by the resonator spectroscopy experiment will be shown as 
qubit frequency in result db. 
eggerdj commented 2 years ago

Looks like BaseAnalysis bakes qubits into the device components by default. https://github.com/Qiskit/qiskit-experiments/blob/a0beb41ec0757429031e0e6e7a7855dcc72877cd/qiskit_experiments/framework/base_analysis.py#L147-L153

How about outsourcing the lines above to a method _device_components that subclasses can override?

dekelmeirom commented 2 years ago

I think there are not many types of device components besides qubits and resonators, therefore generalizing these few lines to also enable resonators should be enough (like done in #387 ). By enabling only pre-determined types we can also make the searches in the DB easier. If I am wrong, and there might be more types that we don't think of right now, I think that creating a method that other subclasses can override will indeed be a better solution.