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 37 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
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.
173 changes: 173 additions & 0 deletions doc/source/protocols/flux/single.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
.. _flux:

Frequency vs flux experiments
=============================

In this section we show how to run experiments to study
the flux dependence.

Flux-tunable transmons
----------------------

It can be shown for flux-tunable transmons that applying an external flux
:math:`\Phi` induces to a detuning on the transmon frequency :cite:p:`Koch_2007`.
By applying short flux pulses it is possible to tune the transmon frequency in order
of GHz, which leads to several applications including quantum logical gates.

The transmon frequency as a function of the external flux can be expressed as :cite:p:`Barrett_2023`

.. math::

f_q(\Phi) = \Bigg( f_q^{\text{max}} + \frac{E_C}{h} \Bigg) \sqrt[4]{d^2 + (1-d^2)\cos^2\Big( \pi \frac{\Phi}{\Phi_0}\Big)} - \frac{E_C}{h} \,

where :math:`f_{\text{max}} = ( \sqrt{8 E_C E_J} - E_C) / h` is the maximum qubit frequency,
:math:`d` is the junctions asymmetry, :math:`E_C` is the charging energy,
:math:`E_J` is the Josephson energy and :math:`\Phi_0 = h / (2e)` is the flux quanta.

The resonator detuning in the transmon regime :math:`E_J \gg E_C` can be computed as

.. math::

f_r(\Phi) = f_r^{\text{bare}} + g_0^2 \frac{\sqrt[4]{d^2 + (1-d^2)\cos^2\Big( \pi \frac{\Phi}{\Phi_0}\Big)}}{f_r^{\text{bare}} - f_q(\Phi)} \,

where :math:`f_r^{\text{bare}}` is the bare frequency of the resonator and :math:`g_0^2` is the
coupling between the transmon and the resonator.

In Qibocal we provide two experiments to measure and fit the curves described by the two equations
above. To measure the qubit detuning a 2D sweep is performed probing the systems at different drive frequencies
and at different flux (bias) offset values. For the resonator we perform the same experiment
by sweeping the readout frequency instead of the drive frequency.

.. _qubit_flux:

Qubit flux dependence
---------------------

Parameters
^^^^^^^^^^

.. autoclass:: qibocal.protocols.flux_dependence.qubit_flux_dependence.QubitFluxParameters
:noindex:

Example
^^^^^^^

A possible runcard to assess how the qubit frequency changes by varying flux is the following:

.. code-block:: yaml

- id: qubit flux dependence
operation: qubit_flux
parameters:
bias_step: 0.001
bias_width: 0.05
drive_amplitude: 0.002
drive_duration: 4000
freq_step: 200000
freq_width: 10000000
nshots: 1024
relaxation_time: 20000


The expected output is the following:

.. image:: qubit_flux.png

From the acquired data this protocol estimates the flux insensitive point "sweetspot",
which corresponds to the flux value where the frequency is maximed, as well as the drive frequency
and the diagonal crosstalk coefficient :math:`V_{ii}`.
Both the sweetspot and the :math:`C_{ii}` can be understood by writing the full expression for
the flux felt by qubit :math:`i` :cite:p:`Barrett_2023`:

.. math::

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

where :math:`C_{ij}` is known in the literature as the crosstalk matrix, while
:math:`V_{i}` is the applied voltage.

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

- :ref:`qubit_spectroscopy`

.. _resonator_flux:

Resonator flux dependence
-------------------------

Parameters
^^^^^^^^^^

.. autoclass:: qibocal.protocols.flux_dependence.resonator_flux_dependence.ResonatorFluxParameters
:noindex:

Example
^^^^^^^

A possible runcard to assess how the resonator frequency changes by varying flux is the following:

.. code-block:: yaml

- id: resonator flux dependence
operation: resonator_flux
parameters:
bias_step: 0.01
bias_width: 0.4
freq_step: 100000
freq_width: 6000000
nshots: 2000
relaxation_time: 1000


From this protocol it is possible to extract both the bare and the dressed resonator frequency
as well as an estimate for the coupling :math:`g_0`.
It is suggested to run this protocol only after executing the qubit flux dependence experiment
since some of the coefficients required can be computed with that experiment.


.. image:: resonator_flux.png

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

- :ref:`resonator_punchout`
- :ref:`qubit_flux`

Qubit flux dependence (tracking)
--------------------------------

As we saw above both the resonator and the qubit are affected by an external flux.
In the qubit flux dependence the measurement is performed at fixed readout frequency.
To take into account how the transmon shifts in frequency when probing the qubit we have
another experiment `qubit_flux_tracking`.

Parameters
^^^^^^^^^^

.. autoclass:: qibocal.protocols.flux_dependence.qubit_flux_tracking.QubitFluxTrackParameters
:noindex:

Example
^^^^^^^

Here is a possible runcard:

.. code-block:: yaml

- id: qubit flux dependence
operation: qubit_flux_tracking
parameters:
bias_step: 0.001
bias_width: 0.05
drive_amplitude: 0.002
drive_duration: 4000
freq_step: 200000
freq_width: 10000000
nshots: 1024
relaxation_time: 20000

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

- :ref:`resonator_flux`
15 changes: 15 additions & 0 deletions doc/source/protocols/index.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
Protocols
=========

Here is a scheme with the protocols currently available in Qibocal.


.. image:: ../getting-started/qpu_characterization.svg

In this section we introduce the basics of all protocols supported by ``qibocal``.

.. toctree::
:maxdepth: 1

signal/time_of_flight
signal/calibrate_kernel
resonator_spectroscopy
resonator_punchout
qubit_spectroscopy/qubit_spectroscopy
ramsey/ramsey
t1/t1
t2/t2
t2_echo/t2_echo
flux/single
flux/crosstalk
references
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading