From 1d3957d7e0c30930469e9220655a0ee8a5b30f0d Mon Sep 17 00:00:00 2001 From: DavidSarlle Date: Thu, 7 Sep 2023 14:26:43 +0400 Subject: [PATCH 1/9] Added qubit attributes fitted from resonator flux and used in qubit flux tracking --- src/qibolab/platform.py | 22 ++++++++++++++++++++++ src/qibolab/qubits.py | 9 +++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/qibolab/platform.py b/src/qibolab/platform.py index bccb50b13..7fccd6831 100644 --- a/src/qibolab/platform.py +++ b/src/qibolab/platform.py @@ -197,6 +197,28 @@ def update(self, updates: dict): elif par == "classifiers_hpars": self.qubits[qubit].classifiers_hpars = value + + # Flux resonatos spectroscopy + elif par == "flux_to_bias": + self.qubits[qubit].flux_to_bias = value + + elif par == "asymmetry": + self.qubits[qubit].asymmetry = value + + elif par == "readout_coupling": + self.qubits[qubit].g = value + + elif par == "brf": + self.qubits[qubit].brf = value + + elif par == "ssf_brf": + self.qubits[qubit].ssf_brf = value + + elif par == "Ec": + self.qubits[qubit].Ec = value + + elif par == "Ej": + self.qubits[qubit].Ej = value else: raise_error(ValueError, f"Unknown parameter {par} for qubit {qubit}") diff --git a/src/qibolab/qubits.py b/src/qibolab/qubits.py index dd2392414..f619b5b0d 100644 --- a/src/qibolab/qubits.py +++ b/src/qibolab/qubits.py @@ -41,11 +41,17 @@ class Qubit: readout_frequency: int = 0 # this is the dressed frequency drive_frequency: int = 0 anharmonicity: int = 0 + + sweetspot: float = 0 + flux_to_bias: float = 0.0 + asymmetry: float = 0.0 + brf: float = 0.0 + ssf_brf: float = 0.0 Ec: int = 0 Ej: int = 0 g: int = 0 + assigment_fidelity: float = 0.0 - sweetspot: float = 0 peak_voltage: float = 0 pi_pulse_amplitude: float = 0 T1: int = 0 @@ -55,7 +61,6 @@ class Qubit: state1_voltage: int = 0 mean_gnd_states: List[float] = field(default_factory=lambda: [0, 0]) mean_exc_states: List[float] = field(default_factory=lambda: [0, 0]) - resonator_polycoef_flux: List[float] = field(default_factory=list) # parameters for single shot classification threshold: Optional[float] = None From 5c1a71466074e4a1aeda6cd4749c1e534ede5fdf Mon Sep 17 00:00:00 2001 From: DavidSarlle Date: Thu, 7 Sep 2023 15:08:37 +0400 Subject: [PATCH 2/9] fix attr types --- src/qibolab/platform.py | 16 ++++++++-------- src/qibolab/qubits.py | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/qibolab/platform.py b/src/qibolab/platform.py index 7fccd6831..445564589 100644 --- a/src/qibolab/platform.py +++ b/src/qibolab/platform.py @@ -198,27 +198,27 @@ def update(self, updates: dict): elif par == "classifiers_hpars": self.qubits[qubit].classifiers_hpars = value - # Flux resonatos spectroscopy + # Flux resonator spectroscopy elif par == "flux_to_bias": - self.qubits[qubit].flux_to_bias = value + self.qubits[qubit].flux_to_bias = float(value) elif par == "asymmetry": - self.qubits[qubit].asymmetry = value + self.qubits[qubit].asymmetry = float(value) elif par == "readout_coupling": - self.qubits[qubit].g = value + self.qubits[qubit].g = int(value) elif par == "brf": - self.qubits[qubit].brf = value + self.qubits[qubit].brf = float(value) elif par == "ssf_brf": - self.qubits[qubit].ssf_brf = value + self.qubits[qubit].ssf_brf = float(value) elif par == "Ec": - self.qubits[qubit].Ec = value + self.qubits[qubit].Ec = int(value) elif par == "Ej": - self.qubits[qubit].Ej = value + self.qubits[qubit].Ej = int(value) else: raise_error(ValueError, f"Unknown parameter {par} for qubit {qubit}") diff --git a/src/qibolab/qubits.py b/src/qibolab/qubits.py index f619b5b0d..4c198b6e9 100644 --- a/src/qibolab/qubits.py +++ b/src/qibolab/qubits.py @@ -43,10 +43,10 @@ class Qubit: anharmonicity: int = 0 sweetspot: float = 0 - flux_to_bias: float = 0.0 - asymmetry: float = 0.0 - brf: float = 0.0 - ssf_brf: float = 0.0 + flux_to_bias: float = 0 + asymmetry: float = 0 + brf: float = 0 + ssf_brf: float = 0 Ec: int = 0 Ej: int = 0 g: int = 0 From 8565259d5abf02ac416b66357057a0633bed79b1 Mon Sep 17 00:00:00 2001 From: DavidSarlle Date: Fri, 8 Sep 2023 14:35:39 +0400 Subject: [PATCH 3/9] change attribut types --- src/qibolab/platform.py | 9 +++------ src/qibolab/qubits.py | 16 ++++++++-------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/qibolab/platform.py b/src/qibolab/platform.py index 445564589..8b5031ed7 100644 --- a/src/qibolab/platform.py +++ b/src/qibolab/platform.py @@ -133,9 +133,6 @@ def update(self, updates: dict): elif par == "sweetspot": sweetspot = float(value) self.qubits[qubit].sweetspot = sweetspot - if self.qubits[qubit].flux is not None: - # set sweetspot as the flux offset (IS THIS NEEDED?) - self.qubits[qubit].flux.offset = sweetspot # qubit_spectroscopy / qubit_spectroscopy_flux / ramsey elif par == "drive_frequency": @@ -206,7 +203,7 @@ def update(self, updates: dict): self.qubits[qubit].asymmetry = float(value) elif par == "readout_coupling": - self.qubits[qubit].g = int(value) + self.qubits[qubit].g = float(value) elif par == "brf": self.qubits[qubit].brf = float(value) @@ -215,10 +212,10 @@ def update(self, updates: dict): self.qubits[qubit].ssf_brf = float(value) elif par == "Ec": - self.qubits[qubit].Ec = int(value) + self.qubits[qubit].Ec = float(value) elif par == "Ej": - self.qubits[qubit].Ej = int(value) + self.qubits[qubit].Ej = float(value) else: raise_error(ValueError, f"Unknown parameter {par} for qubit {qubit}") diff --git a/src/qibolab/qubits.py b/src/qibolab/qubits.py index 4c198b6e9..18c0fbcce 100644 --- a/src/qibolab/qubits.py +++ b/src/qibolab/qubits.py @@ -42,14 +42,14 @@ class Qubit: drive_frequency: int = 0 anharmonicity: int = 0 - sweetspot: float = 0 - flux_to_bias: float = 0 - asymmetry: float = 0 - brf: float = 0 - ssf_brf: float = 0 - Ec: int = 0 - Ej: int = 0 - g: int = 0 + sweetspot: float = 0.0 + flux_to_bias: float = 0.0 + asymmetry: float = 0.0 + brf: float = 0.0 + ssf_brf: float = 0.0 + Ec: float = 0.0 + Ej: float = 0.0 + g: float = 0.0 assigment_fidelity: float = 0.0 peak_voltage: float = 0 From a7bd207ed76773320a8c6708bce731c06d305136 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 08:24:32 +0000 Subject: [PATCH 4/9] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/qibolab/platform.py | 8 ++++---- src/qibolab/qubits.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qibolab/platform.py b/src/qibolab/platform.py index 8b5031ed7..c5873c71d 100644 --- a/src/qibolab/platform.py +++ b/src/qibolab/platform.py @@ -194,11 +194,11 @@ def update(self, updates: dict): elif par == "classifiers_hpars": self.qubits[qubit].classifiers_hpars = value - - # Flux resonator spectroscopy + + # Flux resonator spectroscopy elif par == "flux_to_bias": self.qubits[qubit].flux_to_bias = float(value) - + elif par == "asymmetry": self.qubits[qubit].asymmetry = float(value) @@ -207,7 +207,7 @@ def update(self, updates: dict): elif par == "brf": self.qubits[qubit].brf = float(value) - + elif par == "ssf_brf": self.qubits[qubit].ssf_brf = float(value) diff --git a/src/qibolab/qubits.py b/src/qibolab/qubits.py index 18c0fbcce..e64cf8c39 100644 --- a/src/qibolab/qubits.py +++ b/src/qibolab/qubits.py @@ -41,10 +41,10 @@ class Qubit: readout_frequency: int = 0 # this is the dressed frequency drive_frequency: int = 0 anharmonicity: int = 0 - + sweetspot: float = 0.0 flux_to_bias: float = 0.0 - asymmetry: float = 0.0 + asymmetry: float = 0.0 brf: float = 0.0 ssf_brf: float = 0.0 Ec: float = 0.0 From 7348fade8cf127a03424819a6cd90a4aa0123097 Mon Sep 17 00:00:00 2001 From: DavidSarlle Date: Thu, 14 Sep 2023 12:41:44 +0400 Subject: [PATCH 5/9] removing resonator_polycoef_flux from tests --- tests/dummy_qrc/zurich.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/dummy_qrc/zurich.yml b/tests/dummy_qrc/zurich.yml index 159a611c1..b54cd968c 100644 --- a/tests/dummy_qrc/zurich.yml +++ b/tests/dummy_qrc/zurich.yml @@ -149,7 +149,6 @@ characterization: single_qubit: 0: readout_frequency: 5_229_200_000 #5_233_200_000 - resonator_polycoef_flux: [] drive_frequency: 4_095_830_788 #4_093_830_788 T1: 0.0 T2: 0.0 @@ -168,7 +167,6 @@ characterization: 1: readout_frequency: 4_931_000_000 - resonator_polycoef_flux: [] drive_frequency: 4_170_000_000 T1: 0. T2: 0. @@ -177,7 +175,6 @@ characterization: mean_exc_states: [0, 0] 2: readout_frequency: 6.109e+9 #6_112_000_000 - resonator_polycoef_flux: [] drive_frequency: 4_300_587_281 # 4_401_600_000 #4_541_100_000 T1: 0. T2: 0. @@ -190,7 +187,6 @@ characterization: # alpha: 208 MHz 3: readout_frequency: 5_783_000_000 - resonator_polycoef_flux: [] drive_frequency: 4_100_000_000 T1: 0. T2: 0. @@ -199,7 +195,6 @@ characterization: mean_exc_states: [0, 0] 4: readout_frequency: 5_515_000_000 - resonator_polycoef_flux: [] drive_frequency: 4_196_800_000 T1: 0. T2: 0. From 93d20b4e5acd7206730470f5d497a66130c903b9 Mon Sep 17 00:00:00 2001 From: DavidSarlle Date: Thu, 21 Sep 2023 13:23:17 +0400 Subject: [PATCH 6/9] added docstrings and changed Ec, Ej attribute names to small letters --- src/qibolab/platform.py | 8 ++++---- src/qibolab/qubits.py | 13 +++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/qibolab/platform.py b/src/qibolab/platform.py index 5b9d66e11..1c677f23e 100644 --- a/src/qibolab/platform.py +++ b/src/qibolab/platform.py @@ -214,11 +214,11 @@ def update(self, updates: dict): elif par == "ssf_brf": self.qubits[qubit].ssf_brf = float(value) - elif par == "Ec": - self.qubits[qubit].Ec = float(value) + elif par == "ec": + self.qubits[qubit].ec = float(value) - elif par == "Ej": - self.qubits[qubit].Ej = float(value) + elif par == "ej": + self.qubits[qubit].ej = float(value) else: raise_error(ValueError, f"Unknown parameter {par} for qubit {qubit}") diff --git a/src/qibolab/qubits.py b/src/qibolab/qubits.py index e64cf8c39..6303addbb 100644 --- a/src/qibolab/qubits.py +++ b/src/qibolab/qubits.py @@ -38,18 +38,23 @@ class Qubit: name: QubitId bare_resonator_frequency: int = 0 - readout_frequency: int = 0 # this is the dressed frequency + readout_frequency: int = 0 + """ Readout dressed frequency""" drive_frequency: int = 0 anharmonicity: int = 0 - sweetspot: float = 0.0 flux_to_bias: float = 0.0 asymmetry: float = 0.0 brf: float = 0.0 + """Bare resonator frequency obtained during resonator flux spectrosocopy""" ssf_brf: float = 0.0 - Ec: float = 0.0 - Ej: float = 0.0 + """Estimated sweetspot qubit frequency divided by the bare_resonator_frequency""" + ec: float = 0.0 + """Readout Charge Energy""" + ej: float = 0.0 + """Readout Josephson Energy""" g: float = 0.0 + """Readout coupling""" assigment_fidelity: float = 0.0 peak_voltage: float = 0 From 48f4fd751bd00ed84d5045dafbf2e83fbc5b226e Mon Sep 17 00:00:00 2001 From: DavidSarlle Date: Thu, 21 Sep 2023 14:43:45 +0400 Subject: [PATCH 7/9] changing attribute names Ec, Ej --- src/qibolab/platform.py | 8 ++++---- src/qibolab/qubits.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qibolab/platform.py b/src/qibolab/platform.py index 1c677f23e..5b9d66e11 100644 --- a/src/qibolab/platform.py +++ b/src/qibolab/platform.py @@ -214,11 +214,11 @@ def update(self, updates: dict): elif par == "ssf_brf": self.qubits[qubit].ssf_brf = float(value) - elif par == "ec": - self.qubits[qubit].ec = float(value) + elif par == "Ec": + self.qubits[qubit].Ec = float(value) - elif par == "ej": - self.qubits[qubit].ej = float(value) + elif par == "Ej": + self.qubits[qubit].Ej = float(value) else: raise_error(ValueError, f"Unknown parameter {par} for qubit {qubit}") diff --git a/src/qibolab/qubits.py b/src/qibolab/qubits.py index 6303addbb..84c5d9829 100644 --- a/src/qibolab/qubits.py +++ b/src/qibolab/qubits.py @@ -49,9 +49,9 @@ class Qubit: """Bare resonator frequency obtained during resonator flux spectrosocopy""" ssf_brf: float = 0.0 """Estimated sweetspot qubit frequency divided by the bare_resonator_frequency""" - ec: float = 0.0 + Ec: float = 0.0 """Readout Charge Energy""" - ej: float = 0.0 + Ej: float = 0.0 """Readout Josephson Energy""" g: float = 0.0 """Readout coupling""" From a86ab21afb43941f4cc3c3e39bc08b4663399b62 Mon Sep 17 00:00:00 2001 From: DavidSarlle Date: Thu, 21 Sep 2023 18:26:46 +0400 Subject: [PATCH 8/9] modified docstring brf --- src/qibolab/qubits.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qibolab/qubits.py b/src/qibolab/qubits.py index 84c5d9829..d71704ace 100644 --- a/src/qibolab/qubits.py +++ b/src/qibolab/qubits.py @@ -46,7 +46,7 @@ class Qubit: flux_to_bias: float = 0.0 asymmetry: float = 0.0 brf: float = 0.0 - """Bare resonator frequency obtained during resonator flux spectrosocopy""" + """Bare resonator frequency at sweetspot""" ssf_brf: float = 0.0 """Estimated sweetspot qubit frequency divided by the bare_resonator_frequency""" Ec: float = 0.0 From a79ea7d3a93d7d1ee3fb6abcf3eec5ee885d31a2 Mon Sep 17 00:00:00 2001 From: DavidSarlle Date: Wed, 27 Sep 2023 12:55:11 +0400 Subject: [PATCH 9/9] renaming brf --- src/qibolab/platform.py | 22 ---------------------- src/qibolab/qubits.py | 2 +- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/qibolab/platform.py b/src/qibolab/platform.py index 5b9d66e11..76539ac99 100644 --- a/src/qibolab/platform.py +++ b/src/qibolab/platform.py @@ -198,28 +198,6 @@ def update(self, updates: dict): elif par == "classifiers_hpars": self.qubits[qubit].classifiers_hpars = value - # Flux resonator spectroscopy - elif par == "flux_to_bias": - self.qubits[qubit].flux_to_bias = float(value) - - elif par == "asymmetry": - self.qubits[qubit].asymmetry = float(value) - - elif par == "readout_coupling": - self.qubits[qubit].g = float(value) - - elif par == "brf": - self.qubits[qubit].brf = float(value) - - elif par == "ssf_brf": - self.qubits[qubit].ssf_brf = float(value) - - elif par == "Ec": - self.qubits[qubit].Ec = float(value) - - elif par == "Ej": - self.qubits[qubit].Ej = float(value) - else: raise_error(ValueError, f"Unknown parameter {par} for qubit {qubit}") diff --git a/src/qibolab/qubits.py b/src/qibolab/qubits.py index d71704ace..4f328d4a2 100644 --- a/src/qibolab/qubits.py +++ b/src/qibolab/qubits.py @@ -45,7 +45,7 @@ class Qubit: sweetspot: float = 0.0 flux_to_bias: float = 0.0 asymmetry: float = 0.0 - brf: float = 0.0 + bare_resonator_frequency_sweetspot: float = 0.0 """Bare resonator frequency at sweetspot""" ssf_brf: float = 0.0 """Estimated sweetspot qubit frequency divided by the bare_resonator_frequency"""