Skip to content
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

Use state 0 frequency for signal experiments #1071

Draft
wants to merge 1 commit into
base: 0.2
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/qibocal/calibration/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class Resonator(Model):
"""Dressed resonator frequency [Hz]."""
depletion_time: Optional[int] = None
"""Depletion time [ns]."""
bare_frequency_amplitude: Optional[float] = None
"""Readout amplitude at high frequency."""

@property
def dispersive_shift(self):
Expand Down
6 changes: 5 additions & 1 deletion src/qibocal/protocols/coherence/spin_echo_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from qibocal.result import magnitude, phase

from ... import update
from ..utils import table_dict, table_html
from ..utils import readout_frequency, table_dict, table_html
from .t1_signal import T1SignalData
from .utils import (
CoherenceType,
Expand Down Expand Up @@ -89,6 +89,10 @@ def _acquisition(
results = platform.execute(
[sequence],
[[sweeper]],
updates=[
{platform.qubits[q].probe: {"frequency": readout_frequency(q, platform)}}
for q in targets
],
nshots=params.nshots,
relaxation_time=params.relaxation_time,
acquisition_type=AcquisitionType.INTEGRATION,
Expand Down
6 changes: 5 additions & 1 deletion src/qibocal/protocols/coherence/t1_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from qibocal.result import magnitude, phase

from ... import update
from ..utils import table_dict, table_html
from ..utils import readout_frequency, table_dict, table_html
from . import utils


Expand Down Expand Up @@ -111,6 +111,10 @@ def _acquisition(
results = platform.execute(
[sequence],
[[sweeper]],
updates=[
{platform.qubits[q].probe: {"frequency": readout_frequency(q, platform)}}
for q in targets
],
nshots=params.nshots,
relaxation_time=params.relaxation_time,
acquisition_type=AcquisitionType.INTEGRATION,
Expand Down
6 changes: 5 additions & 1 deletion src/qibocal/protocols/coherence/t2_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from ...result import magnitude, phase
from ..ramsey.utils import ramsey_sequence
from ..utils import table_dict, table_html
from ..utils import readout_frequency, table_dict, table_html
from . import t1_signal, t2, utils


Expand Down Expand Up @@ -80,6 +80,10 @@ def _acquisition(
results = platform.execute(
[sequence],
[[sweeper]],
updates=[
{platform.qubits[q].probe: {"frequency": readout_frequency(q, platform)}}
for q in targets
],
nshots=params.nshots,
relaxation_time=params.relaxation_time,
acquisition_type=AcquisitionType.INTEGRATION,
Expand Down
7 changes: 3 additions & 4 deletions src/qibocal/protocols/dispersive_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
HZ_TO_GHZ,
lorentzian,
lorentzian_fit,
readout_frequency,
table_dict,
table_html,
)
Expand Down Expand Up @@ -104,8 +105,7 @@ def _acquisition(
sweepers = [
Sweeper(
parameter=Parameter.frequency,
values=platform.config(platform.qubits[q].probe).frequency
+ delta_frequency_range,
values=readout_frequency(q, platform) + delta_frequency_range,
channels=[platform.qubits[q].probe],
)
for q in targets
Expand All @@ -121,7 +121,6 @@ def _acquisition(
)

for qubit in targets:
ro_frequency = platform.config(platform.qubits[qubit].probe).frequency
for state, sequence in enumerate([sequence_0, sequence_1]):
ro_pulse = list(sequence.channel(platform.qubits[qubit].acquisition))[-1]
result = results[ro_pulse.id]
Expand All @@ -130,7 +129,7 @@ def _acquisition(
DispersiveShiftType,
(qubit, state),
dict(
freq=ro_frequency + delta_frequency_range,
freq=readout_frequency(qubit, platform) + delta_frequency_range,
signal=magnitude(result),
phase=phase(result),
i=i,
Expand Down
8 changes: 4 additions & 4 deletions src/qibocal/protocols/dispersive_shift_qutrit.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
HZ_TO_GHZ,
lorentzian,
lorentzian_fit,
readout_frequency,
table_dict,
table_html,
)
Expand Down Expand Up @@ -107,8 +108,7 @@ def _acquisition(
sweepers = [
Sweeper(
parameter=Parameter.frequency,
values=platform.config(platform.qubits[q].probe).frequency
+ delta_frequency_range,
values=readout_frequency(q, platform, state=1) + delta_frequency_range,
channels=[platform.qubits[q].probe],
)
for q in targets
Expand All @@ -124,15 +124,15 @@ def _acquisition(
)

for qubit in targets:
ro_frequency = platform.config(platform.qubits[qubit].probe).frequency
for state, sequence in enumerate([sequence_0, sequence_1, sequence_2]):
ro_pulse = list(sequence.channel(platform.qubits[qubit].acquisition))[-1]
result = results[ro_pulse.id]
data.register_qubit(
ResSpecType,
(qubit, state),
dict(
freq=ro_frequency + delta_frequency_range,
freq=readout_frequency(qubit, platform, state=1)
+ delta_frequency_range,
signal=magnitude(result),
phase=phase(result),
),
Expand Down
14 changes: 13 additions & 1 deletion src/qibocal/protocols/flux_dependence/qubit_crosstalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@

from ...result import magnitude, phase
from ...update import replace
from ..utils import GHZ_TO_HZ, HZ_TO_GHZ, extract_feature, table_dict, table_html
from ..utils import (
GHZ_TO_HZ,
HZ_TO_GHZ,
extract_feature,
readout_frequency,
table_dict,
table_html,
)
from . import utils
from .qubit_flux_dependence import (
QubitFluxData,
Expand Down Expand Up @@ -191,6 +198,11 @@ def _acquisition(
channel = platform.qubits[qubit].flux
updates.append({channel: {"offset": params.bias_point[qubit]}})

updates += [
{platform.qubits[q].probe: {"frequency": readout_frequency(q, platform)}}
for q in targets
]

for flux_qubit, offset_sweeper in zip(params.flux_qubits, offset_sweepers):
results = platform.execute(
[sequence], [[offset_sweeper], freq_sweepers], **options, updates=updates
Expand Down
13 changes: 12 additions & 1 deletion src/qibocal/protocols/flux_dependence/qubit_flux_dependence.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@
from qibocal.update import replace

from ... import update
from ..utils import GHZ_TO_HZ, HZ_TO_GHZ, extract_feature, table_dict, table_html
from ..utils import (
GHZ_TO_HZ,
HZ_TO_GHZ,
extract_feature,
readout_frequency,
table_dict,
table_html,
)
from . import utils
from .resonator_flux_dependence import ResonatorFluxParameters

Expand Down Expand Up @@ -148,6 +155,10 @@ def _acquisition(
results = platform.execute(
[sequence],
[offset_sweepers, freq_sweepers],
updates=[
{platform.qubits[q].probe: {"frequency": readout_frequency(q, platform)}}
for q in targets
],
nshots=params.nshots,
relaxation_time=params.relaxation_time,
acquisition_type=AcquisitionType.INTEGRATION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@
from ...auto.operation import Data, Parameters, QubitId, Results, Routine
from ...config import log
from ...result import magnitude, phase
from ..utils import GHZ_TO_HZ, HZ_TO_GHZ, extract_feature, table_dict, table_html
from ..utils import (
GHZ_TO_HZ,
HZ_TO_GHZ,
extract_feature,
readout_frequency,
table_dict,
table_html,
)
from . import utils


Expand Down Expand Up @@ -111,12 +118,11 @@ def _acquisition(

qubit = platform.qubits[q]
offset0 = platform.config(qubit.flux).offset
freq0 = platform.config(qubit.probe).frequency

freq_sweepers.append(
Sweeper(
parameter=Parameter.frequency,
values=freq0 + delta_frequency_range,
values=readout_frequency(q, platform) + delta_frequency_range,
channels=[qubit.probe],
)
)
Expand Down
6 changes: 5 additions & 1 deletion src/qibocal/protocols/qubit_power_spectroscopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from ..update import replace
from .qubit_spectroscopy import QubitSpectroscopyResults
from .resonator_punchout import ResonatorPunchoutData
from .utils import HZ_TO_GHZ
from .utils import HZ_TO_GHZ, readout_frequency


@dataclass
Expand Down Expand Up @@ -101,6 +101,10 @@ def _acquisition(
results = platform.execute(
[sequence],
[[amp_sweeper], [freq_sweepers[q] for q in targets]],
updates=[
{platform.qubits[q].probe: {"frequency": readout_frequency(q, platform)}}
for q in targets
],
nshots=params.nshots,
relaxation_time=params.relaxation_time,
acquisition_type=AcquisitionType.INTEGRATION,
Expand Down
12 changes: 11 additions & 1 deletion src/qibocal/protocols/qubit_spectroscopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@

from .. import update
from .resonator_spectroscopy import ResonatorSpectroscopyData, ResSpecType
from .utils import chi2_reduced, lorentzian, lorentzian_fit, spectroscopy_plot
from .utils import (
chi2_reduced,
lorentzian,
lorentzian_fit,
readout_frequency,
spectroscopy_plot,
)


@dataclass
Expand Down Expand Up @@ -105,6 +111,10 @@ def _acquisition(
results = platform.execute(
[sequence],
[sweepers],
updates=[
{platform.qubits[q].probe: {"frequency": readout_frequency(q, platform)}}
for q in targets
],
**params.execution_parameters,
)

Expand Down
6 changes: 5 additions & 1 deletion src/qibocal/protocols/qubit_spectroscopy_ef.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
_fit,
)
from .resonator_spectroscopy import ResSpecType
from .utils import spectroscopy_plot, table_dict, table_html
from .utils import readout_frequency, spectroscopy_plot, table_dict, table_html


@dataclass
Expand Down Expand Up @@ -117,6 +117,10 @@ def _acquisition(
results = platform.execute(
[sequence],
[sweepers],
updates=[
{platform.qubits[q].probe: {"frequency": readout_frequency(q, platform)}}
for q in targets
],
**params.execution_parameters,
)

Expand Down
45 changes: 9 additions & 36 deletions src/qibocal/protocols/qutrit_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
SingleShotClassificationData,
SingleShotClassificationParameters,
)
from qibocal.protocols.utils import plot_results
from qibocal.protocols.utils import plot_results, readout_frequency

from ..auto.operation import Results
from ..config import log

COLUMNWIDTH = 600
LEGEND_FONT_SIZE = 20
Expand Down Expand Up @@ -67,22 +66,6 @@ def _acquisition(
sequences, all_ro_pulses = [], []
native = platform.natives.single_qubit

updates = []
for qubit in targets:
channel = platform.qubits[qubit].probe
try:
updates.append(
{
channel: {
"frequency": platform.calibration.single_qubits[
qubit
].readout.qudits_frequency[1]
}
}
)
except KeyError:
log.warning(f"No readout frequency for state 1 for qubit {qubit}.")

for state in states:
ro_pulses = {}
sequence = PulseSequence()
Expand Down Expand Up @@ -117,24 +100,14 @@ def _acquisition(
relaxation_time=params.relaxation_time,
acquisition_type=AcquisitionType.INTEGRATION,
)

updates = []
for qubit in targets:
channel = platform.qubits[qubit].probe
try:
# we readout at the readout frequency of |1> for better discrimination
updates.append(
{
channel: {
"frequency": platform.calibration.single_qubits[
qubit
].readout.qudits_frequency[1]
}
}
)
except KeyError:
log.warning(f"No readout frequency for state 1 for qubit {qubit}.")

updates = [
{
platform.qubits[q].probe: {
"frequency": readout_frequency(q, platform, state=1)
}
}
for q in targets
]
if params.unrolling:
results = platform.execute(sequences, **options, updates=updates)
else:
Expand Down
5 changes: 5 additions & 0 deletions src/qibocal/protocols/rabi/amplitude_frequency_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
HZ_TO_GHZ,
fallback_period,
guess_period,
readout_frequency,
table_dict,
table_html,
)
Expand Down Expand Up @@ -137,6 +138,10 @@ def _acquisition(
results = platform.execute(
[sequence],
[[amp_sweeper], [freq_sweepers[q] for q in targets]],
updates=[
{platform.qubits[q].probe: {"frequency": readout_frequency(q, platform)}}
for q in targets
],
nshots=params.nshots,
relaxation_time=params.relaxation_time,
acquisition_type=AcquisitionType.INTEGRATION,
Expand Down
6 changes: 5 additions & 1 deletion src/qibocal/protocols/rabi/amplitude_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from qibocal.auto.operation import Data, Parameters, QubitId, Results, Routine
from qibocal.calibration import CalibrationPlatform
from qibocal.config import log
from qibocal.protocols.utils import fallback_period, guess_period
from qibocal.protocols.utils import fallback_period, guess_period, readout_frequency
from qibocal.result import magnitude, phase

from . import utils
Expand Down Expand Up @@ -91,6 +91,10 @@ def _acquisition(
results = platform.execute(
[sequence],
[[sweeper]],
updates=[
{platform.qubits[q].probe: {"frequency": readout_frequency(q, platform)}}
for q in targets
],
nshots=params.nshots,
relaxation_time=params.relaxation_time,
acquisition_type=AcquisitionType.INTEGRATION,
Expand Down
Loading
Loading