Skip to content

Commit 7976ed5

Browse files
committed
Merge branch 'main' into juan/2
2 parents 7f372be + fe08c22 commit 7976ed5

46 files changed

Lines changed: 2437 additions & 1177 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
- --config=pyproject.toml
2323
- --all
2424
- repo: https://github.com/astral-sh/ruff-pre-commit
25-
rev: v0.12.0
25+
rev: v0.12.5
2626
hooks:
2727
# Run the linter.
2828
- id: ruff

doc/source/protocols/readout_optimization.rst

Lines changed: 0 additions & 32 deletions
This file was deleted.
28.3 KB
Loading
File renamed without changes.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
Readout optimization
2+
====================
3+
4+
Qibocal provides different protocols to improve the readout pulse parameters by optimizing the assignment fidelity.
5+
6+
Resonator Amplitude
7+
-------------------
8+
9+
The resonator amplitude protocol improves the readout amplitude by optimizing the assignment fidelity.
10+
11+
Parameters
12+
^^^^^^^^^^
13+
14+
.. autoclass:: qibocal.protocols.readout_optimization.resonator_amplitude.ResonatorAmplitudeParameters
15+
:noindex:
16+
17+
18+
Example
19+
^^^^^^^
20+
21+
It follows an example runcard of the resonator amplitude routine with the plot
22+
generated in the report.
23+
24+
.. code-block:: yaml
25+
26+
- id: resonator_amplitude
27+
operation: resonator_amplitude
28+
parameters:
29+
amplitude_step: 0.0005
30+
amplitude_start: 0.001
31+
amplitude_stop: 0.005
32+
33+
As shown in the picture below, the protocol sweeps the readout amplitude and evaluates the errors probability.
34+
35+
.. image:: readout_amplitude.png
36+
37+
38+
Resonator Frequency
39+
-------------------
40+
41+
The resonator frequency protocol performs a sweep of the readout frequency to maximize assignment fidelity.
42+
43+
44+
Parameters
45+
^^^^^^^^^^
46+
47+
.. autoclass:: qibocal.protocols.readout_optimization.resonator_frequency.ResonatorFrequencyParameters
48+
:noindex:
49+
50+
51+
Example
52+
^^^^^^^
53+
54+
In the following we show a possible runcard for the optimization of the resonator frequency together with expected output plot.
55+
56+
.. code-block:: yaml
57+
58+
- id: resonator_frequency
59+
operation: resonator_frequency
60+
parameters:
61+
freq_width: 1_000_000
62+
freq_step: 100_000
63+
64+
.. image:: frequency_optimization.png
65+
66+
67+
68+
Resonator Optimization
69+
----------------------
70+
71+
In addition to this metric, the protocol also computes the quantum non-demolition-ness (QND) of the measurement, which serves to evaluate measurement-induced state disturbance.
72+
To capture leakage outside the computational basis the protocol includes the computation of QND with an additional :math:`\pi` pulse.
73+
Readout parameters are then updated based on the configuration that yields the highest assignment fidelity.
74+
75+
76+
Parameters
77+
^^^^^^^^^^
78+
79+
.. autoclass:: qibocal.protocols.readout_optimization.resonator_optimization.ResonatorOptimizationParameters
80+
:noindex:
81+
82+
83+
Example
84+
^^^^^^^
85+
86+
A possible runcard for the resonator optimization protocol could be:
87+
88+
.. code-block:: yaml
89+
90+
- id: resonator optimization
91+
operation: resonator_optimization
92+
parameters:
93+
freq_width: 3_000_000
94+
freq_step: 125_000
95+
amplitude_step: 0.00025
96+
amplitude_start: 0.00025
97+
amplitude_stop: 0.0085
98+
delay: 1000
99+
100+
The plot generated by the report should be similar to the following one:
101+
102+
.. image:: resonator_optimization.png
65.1 KB
Loading

doc/source/tutorials/connect-to-queue.bash

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ print(s.getsockname()[1])
99
s.close()
1010
EOF
1111

12-
IP=$(hostname -I | cut -d ' ' -f 1)
12+
read -rd '' getip <<EOF
13+
import sys
14+
15+
ips = sys.stdin.read().split(" ")
16+
print([ip for ip in ips if ip.startswith(sys.argv[1])][0])
17+
EOF
18+
19+
SUBNET=""
20+
IP=$(hostname -I | python -c "$getip" "$SUBNET")
1321
PORT=$(python -c "$getport")
1422

1523
echo "Forward your local port with:"
@@ -19,6 +27,6 @@ echo
1927
echo "Connect to:"
2028
echo " https://localhost:9180"
2129

22-
jupyter lab --ip "$IP" --port "$PORT"
30+
jupyter lab --ip "$IP" --port "$PORT" --no-browser
2331
# you can also test this with:
2432
# python -m http.server -b "$IP" "$PORT"

doc/source/tutorials/interactive.rst

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,60 @@ the following script should help automating the process.
3333

3434
Once the required server is dispatched as queue job with the script, the instructions to
3535
connect will appear in the output (usually redirected by the queue system on a file).
36+
37+
38+
.. note::
39+
40+
If the system you are targeting, the *remote computing node*, is actually part of
41+
multiple networks, and you need to discriminate the correct one to use, just add the
42+
subnetwork as a string in the former
43+
44+
E.g. you could use::
45+
46+
SUBNET="192.168.XXX"
47+
48+
to specify a local network whose 3rd byte is ``XXX`` (e.g. ``0``, ``1``, ..., ``255``)
49+
50+
51+
Step-by-step guide
52+
~~~~~~~~~~~~~~~~~~
53+
54+
In case of doubts, let's go step by step through the script usage.
55+
56+
#. the **script** itself is supposed to be executed on the **remote computing node**
57+
(cf. figure above), which is the one with direct access to the resources (thus, the
58+
one which is usually already behind the queue)
59+
#. notice that the instructions printed in the output will direct you to establish a
60+
**further SSH connection**, which will be the bridge between the local system and the
61+
remote computing node, through the access node (cf. figure above), on it can be
62+
established with a further `ssh` command execution on the **local system**
63+
#. eventually, the **client connection** should be established from the same **local
64+
system**
65+
66+
.. admonition:: Example: SLURM + laptop
67+
68+
In the case of SLURM queue system, which is accessible through an access node, where
69+
the user `ssh` from its laptop:
70+
71+
- the script is the one you should `sbatch` - possibly adding to it all the rest of
72+
the logic, as needed
73+
- the further `ssh` command (printed in the instructions) should be run on the laptop
74+
- the final URL to connect can be pasted in a browser on the same laptop (e.g.
75+
Mozilla Firefox)
76+
77+
Further notes
78+
~~~~~~~~~~~~~
79+
80+
.. admonition:: Jupyter tokens
81+
82+
*This is not related to this guide, but just to Jupyter itself.*
83+
84+
When Jupyter opens the browser automatically, it uses a URL containing a *token*, for
85+
ease of access.
86+
If you just specify the address and port, the token will not be included. But you can
87+
find it in the output of the command in the jupyter server (thus in the log of the
88+
queue job, if you are using a queue, as in this guide), and manually insert it in the
89+
page which is presented by Jupyter when the URL token is not used.
90+
91+
More details in Jupyter docs:
92+
https://jupyter-server.readthedocs.io/en/stable/operators/security.html

flake.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525

2626
env = {
2727
QIBOLAB_PLATFORMS = (dirOf config.env.DEVENV_ROOT) + "/qibolab_platforms_qrc";
28+
LD_LIBRARY_PATH = builtins.concatStringsSep ":" (map (p: "${p}/lib") (with pkgs; [
29+
stdenv.cc.cc.lib
30+
zlib
31+
]));
32+
PYTHONBREAKPOINT = "pudb.set_trace";
2833
};
2934

3035
languages = {

platforms/qubit/parameters.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"hamiltonian":{
1414
"transmon_levels": 2,
15-
"single_qubit": {
15+
"qubits": {
1616
"0": {
1717
"frequency": 5e9,
1818
"anharmonicity": -200e6,
@@ -74,7 +74,7 @@
7474
"0/drive",
7575
{
7676
"duration": 40,
77-
"amplitude": 0.07975,
77+
"amplitude": 0.06349,
7878
"envelope": {
7979
"kind": "gaussian",
8080
"rel_sigma": 0.2
@@ -97,9 +97,8 @@
9797
"duration": 100.0,
9898
"amplitude": 0.1,
9999
"envelope": {
100-
"kind": "gaussian_square",
101-
"rel_sigma": 0.2,
102-
"width": 0.75
100+
"kind": "gaussian",
101+
"rel_sigma": 0.2
103102
},
104103
"relative_phase": 0.0,
105104
"kind": "pulse"

0 commit comments

Comments
 (0)