Skip to content

Commit 038304c

Browse files
authored
Merge pull request #972 from qiboteam/remove-characterization
Remove characterization
2 parents 0d5b313 + af0d7f9 commit 038304c

File tree

23 files changed

+271
-900
lines changed

23 files changed

+271
-900
lines changed

doc/source/getting-started/experiment.rst

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -180,28 +180,6 @@ And the we can define the runcard ``my_platform/parameters.json``:
180180
}
181181
},
182182
"two_qubits": {}
183-
},
184-
"characterization": {
185-
"single_qubit": {
186-
"0": {
187-
"anharmonicity": 0,
188-
"Ec": 0,
189-
"Ej": 0,
190-
"g": 0,
191-
"T1": 0.0,
192-
"T2": 0.0,
193-
"threshold": 0.0,
194-
"iq_angle": 0.0,
195-
"mean_gnd_states": [
196-
0.0,
197-
0.0
198-
],
199-
"mean_exc_states": [
200-
0.0,
201-
0.0
202-
]
203-
}
204-
}
205183
}
206184
}
207185

doc/source/tutorials/lab.rst

Lines changed: 9 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ How to define a platform for a self-hosted QPU?
1414
The :class:`qibolab.platform.Platform` object holds all the information required
1515
to execute programs, and in particular :class:`qibolab.pulses.PulseSequence` in
1616
a real QPU. It is comprised by different objects that contain information about
17-
the qubit characterization and connectivity, the native gates and the lab's
18-
instrumentation.
17+
the native gates and the lab's instrumentation.
1918

2019
The following cell shows how to define a single qubit platform from scratch,
2120
using different Qibolab primitives.
@@ -92,8 +91,7 @@ coded following the abstract :class:`qibolab.instruments.abstract.Instrument`
9291
interface.
9392

9493
Furthermore, above we defined three channels that connect the qubit to the
95-
control instrument and we assigned two native gates to the qubit. In this
96-
example we neglected or characterization parameters associated to the qubit.
94+
control instrument and we assigned two native gates to the qubit.
9795
These can be passed when defining the :class:`qibolab.qubits.Qubit` objects.
9896

9997
When the QPU contains more than one qubit, some of the qubits are connected so
@@ -179,7 +177,7 @@ hold the parameters of the two-qubit gates.
179177
)
180178

181179
# define the pair of qubits
182-
pair = QubitPair(qubit0, qubit1)
180+
pair = QubitPair(qubit0.name, qubit1.name)
183181
pair.native_gates = TwoQubitNatives(
184182
CZ=FixedSequenceFactory(
185183
PulseSequence(
@@ -222,7 +220,7 @@ coupler but qibolab will take them into account when calling :class:`qibolab.nat
222220
# Look above example
223221

224222
# define the pair of qubits
225-
pair = QubitPair(qubit0, qubit1, coupler_01)
223+
pair = QubitPair(qubit0.name, qubit1.name)
226224
pair.native_gates = TwoQubitNatives(
227225
CZ=FixedSequenceFactory(
228226
PulseSequence(
@@ -408,22 +406,6 @@ a two-qubit system:
408406
]
409407
}
410408
}
411-
},
412-
"characterization": {
413-
"single_qubit": {
414-
"0": {
415-
"T1": 0.0,
416-
"T2": 0.0,
417-
"threshold": 0.00028502261712637096,
418-
"iq_angle": 1.283105298787488
419-
},
420-
"1": {
421-
"T1": 0.0,
422-
"T2": 0.0,
423-
"threshold": 0.0002694329123116206,
424-
"iq_angle": 4.912447775569025
425-
}
426-
}
427409
}
428410
}
429411
@@ -433,19 +415,6 @@ we need the following changes to the previous runcard:
433415
.. code-block:: json
434416
435417
{
436-
"qubits": [
437-
0,
438-
1
439-
],
440-
"couplers": [
441-
0
442-
],
443-
"topology": {
444-
"0": [
445-
0,
446-
1
447-
]
448-
},
449418
"components": {
450419
"flux_coupler_01": {
451420
"bias": 0.12
@@ -497,15 +466,12 @@ we need the following changes to the previous runcard:
497466
}
498467
}
499468
500-
This file contains different sections: ``qubits`` is a list with the qubit
501-
names, ``couplers`` one with the coupler names , ``settings`` defines default execution parameters, ``topology`` defines
502-
the qubit connectivity (qubit pairs), ``native_gates`` specifies the calibrated
503-
pulse parameters for implementing single and two-qubit gates and
504-
``characterization`` provides the physical parameters associated to each qubit and coupler.
469+
This file contains different sections: ``components`` defines the configuration of channel
470+
parameters, while ``native_gates`` specifies the calibrated pulse parameters for implementing
471+
single and two-qubit gates.
505472
Note that such parameters may slightly differ depending on the QPU architecture,
506473
however the pulses under ``native_gates`` should comply with the
507-
:class:`qibolab.pulses.Pulse` API and the parameters under ``characterization``
508-
should be a subset of :class:`qibolab.qubits.Qubit` attributes.
474+
:class:`qibolab.pulses.Pulse` API.
509475

510476
Providing the above runcard is not sufficient to instantiate a
511477
:class:`qibolab.platform.Platform`. This should still be done using a
@@ -642,7 +608,7 @@ With the following additions for coupler architectures:
642608
couplers=couplers,
643609
)
644610

645-
Note that this assumes that the runcard is saved as ``<folder>/parameters.yml`` where ``<folder>``
611+
Note that this assumes that the runcard is saved as ``<folder>/parameters.json`` where ``<folder>``
646612
is the directory containing ``platform.py``.
647613

648614

@@ -660,21 +626,11 @@ The runcard can contain an ``instruments`` section that provides these parameter
660626
661627
{
662628
"nqubits": 2,
663-
"qubits": [
664-
0,
665-
1
666-
],
667629
"settings": {
668630
"nshots": 1024,
669631
"sampling_rate": 1000000000,
670632
"relaxation_time": 50000
671633
},
672-
"topology": [
673-
[
674-
0,
675-
1
676-
]
677-
],
678634
"instruments": {
679635
"twpa_pump": {
680636
"frequency": 4600000000,
@@ -684,22 +640,6 @@ The runcard can contain an ``instruments`` section that provides these parameter
684640
"native_gates": {
685641
"single_qubit": {},
686642
"two_qubit": {}
687-
},
688-
"characterization": {
689-
"single_qubit": {
690-
"0": {
691-
"T1": 0.0,
692-
"T2": 0.0,
693-
"threshold": 0.00028502261712637096,
694-
"iq_angle": 1.283105298787488
695-
},
696-
"1": {
697-
"T1": 0.0,
698-
"T2": 0.0,
699-
"threshold": 0.0002694329123116206,
700-
"iq_angle": 4.912447775569025
701-
}
702-
}
703643
}
704644
}
705645

src/qibolab/compilers/compiler.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
rz_rule,
1616
z_rule,
1717
)
18+
from qibolab.components import Channel
1819
from qibolab.platform import Platform
1920
from qibolab.pulses import Delay, PulseSequence
2021
from qibolab.qubits import QubitId
@@ -150,8 +151,12 @@ def compile(
150151
measurement_map = {}
151152
channel_clock = defaultdict(float)
152153

154+
def find_max(channels: list[Channel]):
155+
return max(channel_clock[ch.name] for ch in channels)
156+
153157
def qubit_clock(el: QubitId):
154-
return max(channel_clock[ch.name] for ch in platform.elements[el].channels)
158+
elements = platform.qubits if el in platform.qubits else platform.couplers
159+
return max(channel_clock[ch.name] for ch in elements[el].channels)
155160

156161
# process circuit gates
157162
for moment in circuit.queue.moments:

src/qibolab/components/configs.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
configuration defined by these classes.
88
"""
99

10-
from dataclasses import dataclass
11-
from typing import Union
10+
from dataclasses import dataclass, field
11+
from typing import Optional, Union
12+
13+
import numpy.typing as npt
1214

1315
__all__ = [
1416
"DcConfig",
@@ -78,5 +80,17 @@ class AcquisitionConfig:
7880
smearing: float
7981
"""FIXME:"""
8082

83+
# FIXME: this is temporary solution to deliver the information to drivers
84+
# until we make acquisition channels first class citizens in the sequences
85+
# so that each acquisition command carries the info with it.
86+
threshold: Optional[float] = None
87+
"""Signal threshold for discriminating ground and excited states."""
88+
iq_angle: Optional[float] = None
89+
"""Signal angle in the IQ-plane for disciminating ground and excited
90+
states."""
91+
kernel: Optional[npt.NDArray] = field(default=None, repr=False)
92+
"""Integration weights to be used when post-processing the acquired
93+
signal."""
94+
8195

8296
Config = Union[DcConfig, IqMixerConfig, OscillatorConfig, IqConfig, AcquisitionConfig]

0 commit comments

Comments
 (0)