Skip to content

Commit

Permalink
chore: update T1, T2 signal
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros11 committed Apr 23, 2024
1 parent 1268df6 commit df2b1f0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 26 deletions.
21 changes: 12 additions & 9 deletions src/qibocal/protocols/characterization/coherence/t1_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import plotly.graph_objects as go
from qibolab import AcquisitionType, AveragingMode, ExecutionParameters
from qibolab.platform import Platform
from qibolab.pulses import PulseSequence
from qibolab.pulses import Delay, PulseSequence
from qibolab.qubits import QubitId
from qibolab.sweeper import Parameter, Sweeper, SweeperType

Expand Down Expand Up @@ -80,15 +80,18 @@ def _acquisition(
# create a sequence of pulses for the experiment
# RX - wait t - MZ
qd_pulses = {}
delays = {}
ro_pulses = {}
sequence = PulseSequence()
for qubit in targets:
qd_pulses[qubit] = platform.create_RX_pulse(qubit, start=0)
ro_pulses[qubit] = platform.create_qubit_readout_pulse(
qubit, start=qd_pulses[qubit].duration
qd_pulses[qubit] = platform.qubits[qubit].native_gates.RX
ro_pulses[qubit] = platform.qubits[qubit].native_gates.MZ
delays[qubit] = Delay(
duration=qd_pulses[qubit].duration, channel=ro_pulses[qubit].channel
)
sequence.add(qd_pulses[qubit])
sequence.add(ro_pulses[qubit])
sequence.append(qd_pulses[qubit])
sequence.append(delays[qubit])
sequence.append(ro_pulses[qubit])

# define the parameter to sweep and its range:
# wait time before readout
Expand All @@ -99,9 +102,9 @@ def _acquisition(
)

sweeper = Sweeper(
Parameter.start,
Parameter.duration,
ro_wait_range,
[ro_pulses[qubit] for qubit in targets],
[delays[qubit] for qubit in targets],
type=SweeperType.ABSOLUTE,
)

Expand All @@ -122,7 +125,7 @@ def _acquisition(

data = T1SignalData()
for qubit in targets:
result = results[ro_pulses[qubit].serial]
result = results[ro_pulses[qubit].id]
if params.single_shot:
_waits = np.array(len(result.magnitude) * [ro_wait_range])
else:
Expand Down
36 changes: 19 additions & 17 deletions src/qibocal/protocols/characterization/coherence/t2_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import plotly.graph_objects as go
from qibolab import AcquisitionType, AveragingMode, ExecutionParameters
from qibolab.platform import Platform
from qibolab.pulses import PulseSequence
from qibolab.pulses import Delay, PulseSequence
from qibolab.qubits import QubitId
from qibolab.sweeper import Parameter, Sweeper, SweeperType

Expand Down Expand Up @@ -59,21 +59,23 @@ def _acquisition(
# create a sequence of pulses for the experiment
# RX90 - t - RX90 - MZ
ro_pulses = {}
RX90_pulses1 = {}
RX90_pulses2 = {}
qd_delays = {}
ro_delays = {}
sequence = PulseSequence()
for qubit in targets:
RX90_pulses1[qubit] = platform.create_RX90_pulse(qubit, start=0)
RX90_pulses2[qubit] = platform.create_RX90_pulse(
qubit,
start=RX90_pulses1[qubit].finish,
)
ro_pulses[qubit] = platform.create_qubit_readout_pulse(
qubit, start=RX90_pulses2[qubit].finish
for q in targets:
qubit = platform.qubits[q]
qd_pulse = qubit.native_gates.RX90
qd_delays[q] = Delay(duration=16, channel=qubit.drive.name)
ro_delays[q] = Delay(duration=16, channel=qubit.readout.name)
ro_pulses[q] = qubit.native_gates.MZ
sequence.append(qd_pulse)
sequence.append(qd_delays[q])
sequence.append(qd_pulse)
sequence.append(
Delay(duration=2 * qd_pulse.duration, channel=qubit.readout.name)
)
sequence.add(RX90_pulses1[qubit])
sequence.add(RX90_pulses2[qubit])
sequence.add(ro_pulses[qubit])
sequence.append(ro_delays[q])
sequence.append(ro_pulses[q])

# define the parameter to sweep and its range:
waits = np.arange(
Expand All @@ -84,9 +86,9 @@ def _acquisition(
)

sweeper = Sweeper(
Parameter.start,
Parameter.duration,
waits,
[RX90_pulses2[qubit] for qubit in targets],
[qd_delays[q] for q in targets] + [ro_delays[q] for q in targets],
type=SweeperType.ABSOLUTE,
)

Expand All @@ -106,7 +108,7 @@ def _acquisition(

data = T2SignalData()
for qubit in targets:
result = results[ro_pulses[qubit].serial]
result = results[ro_pulses[qubit].id]
if params.single_shot:
_waits = np.array(len(result.magnitude) * [waits])
else:
Expand Down

0 comments on commit df2b1f0

Please sign in to comment.