Skip to content

Commit

Permalink
Merge branch 'main' into cr_sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
jevillegasdatTII committed Feb 18, 2025
2 parents 2343e0a + cc2da88 commit b5d0417
Show file tree
Hide file tree
Showing 163 changed files with 5,775 additions and 10,212 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Qibocal key features:

Qibocal documentation is available [here](https://qibo.science/qibocal/stable/).

>[!NOTE]
> Qibocal `main` contains some breaking changes compared to `0.1` versions.
> A small guide to make the transition as smooth as possible can be found [`here`](changes.md).
## Installation

The package can be installed by source:
Expand Down
24 changes: 12 additions & 12 deletions calibration_scripts/rx_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
e.platform.settings.nshots = 2000

rabi_output = e.rabi_amplitude(
min_amp_factor=0.5,
max_amp_factor=1.5,
step_amp_factor=0.01,
pulse_length=e.platform.qubits[target].native_gates.RX.duration,
min_amp=0.0,
max_amp=2,
step_amp=0.01,
pulse_length=e.platform.natives.single_qubit[target].RX[0][1].duration,
)
# update only if chi2 is satisfied
if rabi_output.results.chi2[target][0] > 2:
Expand All @@ -43,10 +43,10 @@
ramsey_output.update_platform(e.platform)

rabi_output_2 = e.rabi_amplitude(
min_amp_factor=0.5,
max_amp_factor=1.5,
step_amp_factor=0.01,
pulse_length=e.platform.qubits[target].native_gates.RX.duration,
min_amp=0,
max_amp=0.2,
step_amp=0.01,
pulse_length=e.platform.natives.single_qubit[target].RX[0][1].duration,
)
# update only if chi2 is satisfied
if rabi_output_2.results.chi2[target][0] > 2:
Expand All @@ -61,10 +61,10 @@
)

rabi_output_3 = e.rabi_amplitude(
min_amp_factor=0.5,
max_amp_factor=1.5,
step_amp_factor=0.01,
pulse_length=e.platform.qubits[target].native_gates.RX.duration,
min_amp=0,
max_amp=0.2,
step_amp=0.01,
pulse_length=e.platform.natives.single_qubit[target].RX[0][1].duration,
)
# update only if chi2 is satisfied
if rabi_output_3.results.chi2[target][0] > 2:
Expand Down
14 changes: 14 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Changes in `main`
After merging [#990](https://github.com/qiboteam/qibocal/pull/990), Qibocal is now compatible with Qibolab 0.2.1.
For this reason, a small internal refactoring and some breaking changes were required.
The main differences concern the acquisition functions and the protocol parameters:
- The amplitudes are no longer relative to the values defined in the platform, but to
the maximum value the instruments reach (internally stored in `Qibolab`).
It implies renaming the amplitude parameters and converting the new amplitude level accordingly.
- The platform parameters that were previously in the `parameters.json`
but required by `Qibolab` to execute circuits and pulse sequences (like $E_J$, $T_1$ and $T_2$),
are moved to the `calibration.json` stored inside each platform folder.
- In the Rabi and flipping experiment, Qibocal provides the possibility to calibrate the $RX(\pi/2)$.
- Small changes in the report template.
- Some protocols are not supported anymore(https://github.com/qiboteam/qibocal/pull/990#issue-2559341729
for a list of them).
2 changes: 1 addition & 1 deletion doc/source/getting-started/interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ This program will upload your report to the server and generate an unique URL.


``qq compare``
^^^^^^^^^^^^^
^^^^^^^^^^^^^^


Using ``qq compare`` it is possible to compare together two ``Qibocal`` reports.
Expand Down
Binary file removed doc/source/protocols/avoided_crossing.png
Binary file not shown.
55 changes: 0 additions & 55 deletions doc/source/protocols/avoided_crossing.rst

This file was deleted.

25 changes: 22 additions & 3 deletions doc/source/protocols/chevron.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
Chevron
=======

In order to implement a two-qubit gate in superconducting quantum computing, it is necessary to bring the two qubits near resonance using specific pulse sequences.
The Chevron protocol implemented in Qibocal can be used to calibrate both CZ and iSWAP gates.

The pulse sequence used to calibrate the iSWAP gate consists of a :math:`\pi` pulse followed by a flux pulse of varying amplitude and duration, applied to the qubit with the highest frequency in the pair.
The initial :math:`pi` pulse brings the qubit into the state :math:`\ket{1}` while the flux pulse detunes its frequency near resonance with the second qubit. The implementation of the iSWAP gate leverages the avoided crossing between the states :math:`\ket{10}` and :math:`\ket{01}`.

The expected population oscillation pattern follows:
.. math::
p_e(t, \delta) = \frac{\Delta^2}{\Delta^2 + 4g^2} + {4g^2}{\Delta^2 + 4g^2}\cos^2\left(\frac{\sqrt{\Delta^2 + 4g^2}}{2}t\right)
where :math:`\Delta=\omega_1 - \omega_2`, and :math:`g` is the coupling constant for the two qubits.

The pulse sequence used to calibrate the CZ gate is the same as the one for the iSWAP gate, with the addition of an initial :math:`\pi` pulse applied to the qubit with the lower frequency so that both qubits are initially prepared in the :math:`\ket{1}`. With this sequence the CZ gate is implemented leveraging the avoided crossing between the states :math:`\ket{11}` and :math:`\ket{20}`.

Parameters
^^^^^^^^^^

Expand All @@ -18,13 +32,18 @@ Below is an example runcard for this experiment.
- id: chevron
operation: chevron
parameters:
amplitude_max_factor: 1.1
amplitude_min_factor: 0.9
amplitude_step_factor: 0.01
amplitude_max: 1.1
amplitude_min: 0.9
amplitude_step: 0.01
duration_max: 51
duration_min: 4
duration_step: 2
The expected output is the following:

.. image:: chevron.png

The plot represents the probability of measuring qubit 1 in the excited state as a function of the flux pulse parameters.
The characteristic shape of the plot, known as a Chevron pattern, appears as a consequence of the interaction of the two qubits through their coupling, leading to population exchange.

Before running the Chevron routine it may be useful to run a Cryoscope experiment in order to correct possible distortions in the flux pulse.
Binary file removed doc/source/protocols/coupler/chevron.png
Binary file not shown.
35 changes: 0 additions & 35 deletions doc/source/protocols/coupler/chevron.rst

This file was deleted.

Binary file added doc/source/protocols/cpmg/cpmg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions doc/source/protocols/cpmg/cpmg.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
CPMG sequence
=============

In this section we show how to run the dynamical decoupling sequence CPMG.

The CPMG sequence consists in applying N equally spaced :math:`\pi` pulses
within two :math:`\pi / 2` pulses. By increasing the number of :math:`\pi` pulses :math:`T_2`
should increase since the estimation is less sensitive to noises of the type :math:`1/f`
eventually reaching the :math:`2 T_1` limit.


The fit is again a dumped exponential of the following form:

.. math::
p_e(t) = A + B e^{ - t / T^{(N)}_2}
Parameters
^^^^^^^^^^

.. autoclass:: qibocal.protocols.coherence.cpmg.CpmgParameters
:noindex:

Example
^^^^^^^

A possible runcard to launch a CPMG experiment could be the following:

.. code-block:: yaml
- id: CPMG
operation: cpmg
parameters:
delay_between_pulses_end: 100000
delay_between_pulses_start: 4
delay_between_pulses_step: 1000
n: 10
nshots: 1000
The expected output is the following:

.. image:: cpmg.png

:math:`T_2` is determined by fitting the output signal using
the formula presented above.

Requirements
^^^^^^^^^^^^

- :ref:`single-shot`
94 changes: 94 additions & 0 deletions doc/source/protocols/drag/drag.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
DRAG experiments
================

In this section we show how to run DRAG experiments using Qibocal

.. _drag:


DRAG :cite:p:`Motzoi_2009, Gambetta_2011`: pulses can be used to lower both phase and leakage errors.
It consists of adding a quadrature component to the pulse which is proportional
to the time derivative of the in-phase component. Given a pulse with an in-phase component :math:`\Omega_x`
the quadrature component :math:`\Omega_y` is evaluated as

.. math::
\Omega_y (t) = \beta \frac{d\Omega_x}{dt} ,
where :math:`\beta` is a scaling parameter.

Qibocal provides two separate protocols to calibrate :math:`\beta`.


Method 1
--------

:math:`\beta` can be extracted by playing the pulse sequence composed of
:math:`[R_X(\pi) - R_X(-\pi)]^N` for different values of :math:`\beta` as shown in :cite:p:`Sheldon_2016`.
The post-processing consists of measuring the probability of :math:`\ket{0}` for every :math:`\beta`
and fitting the curve with a cosine. The correct :math:`\beta` value is the one which maximizes
the curve.

Parameters
^^^^^^^^^^

.. autoclass:: qibocal.protocols.drag.DragTuningParameters
:noindex:

Example
^^^^^^^

.. code-block:: yaml
- id: drag tuning
operation: drag_tuning
parameters:
beta_start: -1
beta_end: 1
beta_step: 0.1
nflips: 5
unrolling: true
Running this protocol you should get something like this:

.. image:: drag_tuning.png


Method 2
--------

The second method consists of playing two different sequences
:math:`R_Y(\pi) R_X(\pi/2)` and :math:`R_X(\pi) R_Y(\pi/2)`. These are two
of the AllXY sequences which exhibit opposite sign of phase error as highlighted
in :cite:p:`reed2013entanglementquantumerrorcorrection`.
The post-processing consists of measuring the probability of :math:`\ket{1}` for every :math:`\beta`
and performing a linear fit for both sequences. The correct :math:`\beta` value is the one where the two lines
cross.

Parameters
^^^^^^^^^^

.. autoclass:: qibocal.protocols.drag_simple.DragTuningSimpleParameters
:noindex:

Example
^^^^^^^

.. code-block:: yaml
- id: drag simple
operation: drag_simple
parameters:
beta_start: -1
beta_end: 1
beta_step: 0.1
unrolling: true
.. image:: drag_simple.png


Requirements
^^^^^^^^^^^^

- :ref:`single-shot`
Binary file added doc/source/protocols/drag/drag_simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/protocols/drag/drag_tuning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b5d0417

Please sign in to comment.