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

Add proper protocols documentation #861

Merged
merged 73 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
7270e61
docs: Add qubit spectroscopy documentation
andrea-pasquale May 20, 2024
1db1b3c
doc: Add qubit_ef
andrea-pasquale May 20, 2024
17f4d03
doc: Fix subsections in sphinx
andrea-pasquale May 20, 2024
3ad5543
fix: Fix _fit -> fit
andrea-pasquale May 20, 2024
f842b28
fix docs: crossreference private functions
Edoardo-Pedicillo May 21, 2024
7d89509
doc: Fix layout
andrea-pasquale May 21, 2024
249071f
doc: Introduce folder for protocol
andrea-pasquale May 21, 2024
2dd06cc
feat: Add Ramsey
andrea-pasquale May 21, 2024
63cc67e
doc: Add ref to Ramsey
andrea-pasquale May 21, 2024
2d6a169
Update doc/source/protocols/qubit_spectroscopy/qubit_spectroscopy.rst
andrea-pasquale May 21, 2024
c9f1ea1
docs: add Rabi docs
Edoardo-Pedicillo May 22, 2024
618f44c
time of flight
rodolfocarobene May 27, 2024
6cd31d0
calibrate kernels
rodolfocarobene May 27, 2024
96631bb
add plots
rodolfocarobene May 27, 2024
270bdc9
review
rodolfocarobene May 27, 2024
70fdaaa
docs: add singleshot docs
Edoardo-Pedicillo May 28, 2024
e4ea6bc
review
rodolfocarobene May 28, 2024
e1c7a00
typos
rodolfocarobene May 28, 2024
b9cfb83
Apply suggestions from code review
rodolfocarobene May 28, 2024
1320fb5
review
rodolfocarobene May 28, 2024
6362cd7
fix test output
rodolfocarobene May 28, 2024
1309ff7
doc: Add T1 documentation
andrea-pasquale Jun 3, 2024
7618aea
doc: Add T2 documentation
andrea-pasquale Jun 3, 2024
b1b0e61
doc: Hahn Echo documentation
andrea-pasquale Jun 3, 2024
264c8f5
Merge pull request #871 from qiboteam/doc_signal
rodolfocarobene Jun 4, 2024
40c3e30
fix: remove prints
Edoardo-Pedicillo Jun 4, 2024
66157cd
remove
Edoardo-Pedicillo Jun 5, 2024
11a7c95
doc: Add flux dependence protocols
andrea-pasquale Jun 7, 2024
c2d6fa7
Merge branch 'main' into add_doc
andrea-pasquale Jun 7, 2024
30cd1a6
doc: Add references and fix docstrings
andrea-pasquale Jun 7, 2024
3e6181f
doc: Add crosstalk
andrea-pasquale Jun 10, 2024
b9c5743
docs: add requirements
Edoardo-Pedicillo Jun 10, 2024
5f1844e
docs: add Rabi docs
Edoardo-Pedicillo May 22, 2024
25892b0
docs: add singleshot docs
Edoardo-Pedicillo Jun 10, 2024
8dc6d99
fix: remove prints
Edoardo-Pedicillo Jun 4, 2024
9651418
remove
Edoardo-Pedicillo Jun 5, 2024
c3e836b
docs: add requirements
Edoardo-Pedicillo Jun 10, 2024
8eb882f
Merge branch 'rabi_docs' of github.com:qiboteam/qibocal into rabi_docs
Edoardo-Pedicillo Jun 10, 2024
0780fce
refactor: move Rabi docs
Edoardo-Pedicillo Jun 11, 2024
a4c7861
rafctor: dispersive shift docs
Edoardo-Pedicillo Jun 12, 2024
4300ae9
fix: remove qubit spectroscopy in index.rst
Edoardo-Pedicillo Jun 12, 2024
e6674fc
fix identation
Edoardo-Pedicillo Jun 12, 2024
9dfd68e
fix: restore guess_frequency
Edoardo-Pedicillo Jun 12, 2024
1f77a67
fix: fix rabi formulas
Edoardo-Pedicillo Jun 12, 2024
abac813
docs: add All-XY
Edoardo-Pedicillo Jun 14, 2024
4380a63
push missing files
Edoardo-Pedicillo Jun 14, 2024
453e99f
Apply suggestions from code review
Edoardo-Pedicillo Jun 14, 2024
54f688e
docs: add flipping
Edoardo-Pedicillo Jun 14, 2024
a9860ee
Merge branch 'rabi_docs' of github.com:qiboteam/qibocal into rabi_docs
Edoardo-Pedicillo Jun 14, 2024
841910f
doc: Add autoclass in protocols
andrea-pasquale Jun 19, 2024
0d10475
doc: Update signal experiments
andrea-pasquale Jun 19, 2024
16f77fe
doc: Update resonator spectroscopies
andrea-pasquale Jun 19, 2024
c8ed227
doc: Add requirements section to protocols
andrea-pasquale Jun 19, 2024
b569ae9
doc: Add qubit spec ef plot
andrea-pasquale Jun 19, 2024
2d0e4f3
Rodolfo review
andrea-pasquale Jun 20, 2024
1faf952
docs: expand flipping
Edoardo-Pedicillo Jun 20, 2024
3009a54
docs: explain better flip and add reference in singleshot
Edoardo-Pedicillo Jun 20, 2024
1e316c4
docs: add more classifiers
Edoardo-Pedicillo Jun 20, 2024
7b04bb3
doc: Alessandro review
andrea-pasquale Jun 21, 2024
536c87a
doc: Left over comments after Alessandro review
andrea-pasquale Jun 21, 2024
dd29dfb
doc: Change authors and depth
andrea-pasquale Jun 21, 2024
7acacee
doc: Specify flux tunable transmons
andrea-pasquale Jun 21, 2024
cc5036c
Apply suggestions from code review
Edoardo-Pedicillo Jun 21, 2024
7c733bc
docs: add allxy rst file
Edoardo-Pedicillo Jun 21, 2024
21185bb
docs: minor fixes
Edoardo-Pedicillo Jun 21, 2024
6259a1a
docs: explain flipping signal
Edoardo-Pedicillo Jun 21, 2024
2319f11
Merge branch 'rabi_docs' of github.com:qiboteam/qibocal into rabi_docs
Edoardo-Pedicillo Jun 21, 2024
d17f7df
docs: change autoclass
Edoardo-Pedicillo Jun 21, 2024
d954972
Merge branch 'add_doc' into rabi_docs
Edoardo-Pedicillo Jun 21, 2024
05970a6
docs: add missing links
Edoardo-Pedicillo Jun 21, 2024
6e97826
doc: Fix update section in qubit and add T2 echo plot
andrea-pasquale Jun 21, 2024
1ced4b9
Merge pull request #868 from qiboteam/rabi_docs
andrea-pasquale Jun 21, 2024
ab4e61b
doc: Missing verb
andrea-pasquale Jun 21, 2024
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
7 changes: 7 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
# master_doc = "index"

autodoc_mock_imports = ["qm"]
autodoc_default_options = {
"members": True,
"undoc-members": True,
"private-members": True,
"inherited-members": True,
"exclude-members": "load, execution_parameters, classify",
alecandido marked this conversation as resolved.
Show resolved Hide resolved
}

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting-started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ your quantum hardware.
installation
interface
runcard
protocols
../protocols/index
example
16 changes: 0 additions & 16 deletions doc/source/getting-started/protocols.rst

This file was deleted.

2 changes: 1 addition & 1 deletion doc/source/getting-started/runcard.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _runcard:

How to execute calibration protocols in ``Qibocal``?
================================================
====================================================

In ``Qibocal`` we adopt a declarative programming paradigm, i.e. the user should specify directly
what he wants to do without caring about the underlying implementation.
Expand Down
Binary file added doc/source/protocols/allxy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions doc/source/protocols/allxy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
All-XY
======

The All-XY experiment is commonly used to evaluate the quality of the single qubit rotations :cite:p:`gao2021practical`. In this protocol, a sequence
of single qubit rotations pairs are performed, such that the resulting states form a staircase pattern where only :math:`\ket{0}`,
:math:`\ket{1}` or a superposition of the two are present.

Parameters
^^^^^^^^^^

.. autoclass::
qibocal.protocols.allxy.allxy.AllXYParameters
:noindex:

Example
^^^^^^^
It follows a runcard example of this experiment.

.. code-block:: yaml

- id: allxy
operation: allxy
parameters:
nshots: 2000

The expected output is the following:

.. image:: allxy.png
Binary file modified doc/source/protocols/classification.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/dispersive_shift.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions doc/source/protocols/dispersive_shift.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.. _dispersive_shift:

Dispersive shift
================

In this section we present the dispersive shift routines provided by Qibocal.

Theory
------

A system with a qubit and a resonator, interacting with each other, is described by the James-Cummings Hamiltonian.
Restricting the qubit states to the first two levels, we get

.. math::
\hat{H}_{\text{JC}} = \hbar \omega_r \hat{a}^\dagger \hat{a} + \frac{\hbar \omega_q}{2} \hat{\sigma}_z + \hbar g (\hat{a}^\dagger \hat{\sigma}_- + \hat{a} \hat{\sigma}_+)

where :math:`\omega_r` and :math:`\omega_q` are respectively the resonator and the qubit frequencies, and :math:`g` is the coupling
constant between the qubit and the resonator.
In the dispersive regime :math:`g \ll \lvert \omega_r - \omega_q \rvert`, the Hamiltonian can be rewritten as

.. math::
:label: eq_1

\hat{H}_{\text{eff}} = \hbar \hat{a}^\dagger \hat{a} (\omega_r - \chi \hat{\sigma}_z) + \frac{\hbar}{2} (\omega_q + \chi) \hat{\sigma}_z

where we introduced the dispersive shift

.. math::
\chi = \frac{g^2}{\lambda}.

Equation :eq:`eq_1` shows that the resonator frequency is :math:`\omega_{r,0} = \omega_r - \chi` (:math:`\omega_{r,1} = \omega_r + \chi`) when the
qubit is in the ground (excited) state. The separation between the two freqiencies is :math:`\lvert 2 \chi \rvert`.

Routine description
^^^^^^^^^^^^^^^^^^^
After collecting the data from the two spectroscopies, for each readout frequency the distance of the centers of the blobs for
:math:`\ket{0}` and :math:`\ket{1}` states are evaluated. The best readout frequency is the one maximizing the distance between the two blobs.

Parameters
^^^^^^^^^^

.. autoclass:: qibocal.protocols.dispersive_shift.DispersiveShiftParameters
:noindex:

Example
^^^^^^^
It follows an example of the experiment parameters.

.. code-block:: yaml

- id: dispersive shift qt
operation: dispersive_shift_qutrit
parameters:
freq_step: 200000
freq_width: 1000000


After running `qq auto`, the experiment is executed and the result will looks like
the following picture.

.. image:: dispersive_shift.png

Requirements
^^^^^^^^^^^^
- :ref:`rabi`
Binary file added doc/source/protocols/flipping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions doc/source/protocols/flipping.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Flipping
========

The flipping experiment corrects the amplitude in the qubit drive pulse. In this experiment,
we applying an :math:`R_x(\pi/2)` rotation followed by :math:`N` flips (two :math:`R_x(\pi)` rotations)
and we measure the qubit state.
The first :math:`R_x(\pi/2)` is necessary to discriminate the over rotations and under rotations of the :math:`R_x(\pi)` pulse:
without it the difference between the two cases is just a global phase, i.e., the
probabilities are the same. With the :math:`R_x(\pi/2)` pulse, in case of under rotations the state will be closer to :math:`\ket{0}`
after the initial flip, in the over rotations one the final state will be closer to :math:`\ket{1}`.

By fitting the resulting data with a sinusoidal function, we can determine the delta amplitude, which allows us to refine the
:math:`\pi` pulse amplitue.

Parameters
^^^^^^^^^^

.. autoclass:: qibocal.protocols.flipping.FlippingParameters
:noindex:

Example
^^^^^^^
It follows a runcard example of this experiment.

.. code-block:: yaml

- id: flipping
operation: flipping
parameters:
detuning: 0.05
nflips_max: 30
nflips_step: 1

The expected output is the following:

.. image:: flipping.png

Qibocal provides also a "signal" version of this routine, it follows a possible runcard
with its report.

.. code-block:: yaml

- id: flipping
operation: flipping_signal
parameters:
detuning: -0.5
nflips_max: 20
nflips_step: 1

.. image:: flipping_signal.png

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

- :ref:`rabi`
- :ref:`single_shot`
Binary file added doc/source/protocols/flipping_signal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
111 changes: 111 additions & 0 deletions doc/source/protocols/flux/crosstalk.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
Flux crosstalk experiments
==========================

In this section we show how to run flux crosstalk experiments.

As we saw in :ref:`flux` the external flux affecting a qubit line :math:`i`
will receive contributions from other qubits

.. math::

\Phi_i = \sum_{j} C_{ij} V_j + \Phi_i^{\text{offset}} \quad ,

which means that the transmon frequency can change when current is applied
on other qubits.

.. _qubit_crosstalk:

Qubit crosstalk
---------------

It is possible to measure qubit crosstalk by running a `qubit_crosstalk` experiment.
Assuming that the target qubit is at the sweetspot, in order to measure crosstalk
effects it is suggested to bias the qubit away.

Here is a possible runcard where we measure the crosstalk on qubit 2
caused by qubit 3 and 0.

Parameters
^^^^^^^^^^

.. autoclass:: qibocal.protocols.flux_dependence.qubit_crosstalk.QubitCrosstalkParameters
:noindex:

Example
^^^^^^^

.. code-block:: yaml

- id: qubit crosstalk
operation: qubit_crosstalk
targets: [2]
parameters:
bias_point:
2: 0.25
bias_step: 0.001
bias_width: 0.05
drive_amplitude: 0.002
drive_duration: 4000
flux_qubits: [0, 3]
freq_step: 200000
freq_width: 10000000
nshots: 1024
relaxation_time: 20000


.. image:: qubit_crosstalk.png

The previous runcard aims at extracting the crosstalk coefficients
:math:`C_{20}` and :math:`C_{23}`.

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

- :ref:`qubit_flux`

.. _resonator_crosstalk:

Resonator crosstalk
-------------------

In a similar fashion it is possible to repeat the previous experiment
by sweeping the readout frequency. Note that in this case it will be
necessary to bias the qubit away from its sweetspot more to observe
significant variations.
rodolfocarobene marked this conversation as resolved.
Show resolved Hide resolved

Parameters
^^^^^^^^^^

.. autoclass:: qibocal.protocols.flux_dependence.resonator_crosstalk.ResCrosstalkParameters
:noindex:

Example
^^^^^^^

.. code-block:: yaml

- id: resonator crosstalk
operation: resonator_crosstalk
targets: [2]
parameters:
bias_point:
2: 0.5
bias_step: 0.01
bias_width: 0.4
flux_qubits: [0, 3]
freq_step: 100000
freq_width: 6000000
nshots: 2000

.. image:: resonator_crosstalk.png

As we can see, even by biasing the qubit away from its sweetspot we are not able to see
a dependence ( a deviation from the straight line) but only a shift.

The protocols aims at extracting the crosstalk coefficients
:math:`C_{20}` and :math:`C_{23}`.

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

- :ref:`resonator_flux`
Binary file added doc/source/protocols/flux/qubit_crosstalk.png
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the weird signals in the two rows at the bottom?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happens relatively often with 2D sweeps... I don't know exactly why. Qibocal post-processing for the acquisition is the same for all rows.

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/flux/qubit_flux.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/flux/resonator_crosstalk.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/flux/resonator_flux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading