Skip to content

analysis

tergite_autocalibration.lib.nodes.characterization.t2.analysis

Classes:

Name Description
BaseT2QubitAnalysis

Base class for T2 qubit analysis.

T2EchoNodeAnalysis

Node analysis for T2 Echo measurements.

T2EchoQubitAnalysis

Class for T2 Echo qubit analysis.

T2Model

Generate a cosine model that can be fit to Rabi oscillation data.

T2NodeAnalysis

Node analysis for T2 measurements.

T2QubitAnalysis

Class for T2 qubit analysis.

Functions:

Name Description
cos_func

Generate a cosine function with exponential decay.

BaseT2QubitAnalysis

BaseT2QubitAnalysis(name, redis_fields)

Bases: BaseQubitAnalysis, ABC

Base class for T2 qubit analysis. This class provides the structure for analyzing T2 times for a single qubit. It should be subclassed to implement specific fitting models and extraction methods.

Methods:

Name Description
analyse_qubit

Run the actual analysis function

analyse_t2_times

Perform the analysis of T2 times for the qubit.

plot

Plot the fitted values from the analysis

process_qubit

Setup the qubit data and analyze it.

rotate_to_probability_axis

Rotates the S21 IQ points to the real - normalized axis

analyse_qubit abstractmethod

analyse_qubit() -> QOI

Run the actual analysis function

Returns:

Type Description
QOI

The quantity of interest as QOI wrapped object

analyse_t2_times

analyse_t2_times()

Perform the analysis of T2 times for the qubit. This method identifies the coordinates for delays and repetitions, extracts the magnitudes for each repetition, fits the model, and calculates the average T2 time and its error.

plot

plot(primary_axis)

Plot the fitted values from the analysis Args: primary_axis: The axis object from matplotlib to be plotted Returns: None, will just plot the fitted values

process_qubit

process_qubit(dataset, qubit_element) -> QOI

Setup the qubit data and analyze it. Args: dataset: xarray dataset with the qubit data qubit_element: name of the qubit element Returns: QOI: Quantity of interest as QOI wrapped object

rotate_to_probability_axis

rotate_to_probability_axis(complex_measurement_data)

Rotates the S21 IQ points to the real - normalized axis that describes the |0> - |1> axis. !!! It Assumes that complex_measurement_data[-2] corresponds to the |0> and complex_measurement_data[-1] corresponds to the |1>

T2EchoNodeAnalysis

T2EchoNodeAnalysis(name, redis_fields)

Bases: BaseAllQubitsAnalysis

Node analysis for T2 Echo measurements. This class performs T2 Echo analysis for multiple qubits and uses the T2EchoQubitAnalysis class for individual qubit analysis.

Methods:

Name Description
analyze_node

Analyze the node and save the results to redis.

open_dataset

Open the dataset for the analysis.

analyze_node

analyze_node(data_path: Path, index: int = 0) -> QOI

Analyze the node and save the results to redis. Args: data_path: Path to the dataset index: Index of the dataset to be analyzed

Returns:

Name Type Description
analysis_results QOI

Dictionary with the analysis results for each qubit

open_dataset

open_dataset(index: int = 0) -> Dataset

Open the dataset for the analysis.

Parameters:

Name Type Description Default
index int

By default 0 for most of the measurements, can be set to load multiple datasets.

0

Returns:

Type Description
Dataset

xarray.Dataset with measurement results

T2EchoQubitAnalysis

T2EchoQubitAnalysis(name, redis_fields)

Bases: BaseT2QubitAnalysis

Class for T2 Echo qubit analysis. This class implements the analysis of T2 Echo times for a single qubit using an exponential decay model. It fits the model to the data and extracts the T2 Echo time.

Methods:

Name Description
analyse_t2_times

Perform the analysis of T2 times for the qubit.

plot

Plot the fitted values from the analysis

process_qubit

Setup the qubit data and analyze it.

rotate_to_probability_axis

Rotates the S21 IQ points to the real - normalized axis

analyse_t2_times

analyse_t2_times()

Perform the analysis of T2 times for the qubit. This method identifies the coordinates for delays and repetitions, extracts the magnitudes for each repetition, fits the model, and calculates the average T2 time and its error.

plot

plot(primary_axis)

Plot the fitted values from the analysis Args: primary_axis: The axis object from matplotlib to be plotted Returns: None, will just plot the fitted values

process_qubit

process_qubit(dataset, qubit_element) -> QOI

Setup the qubit data and analyze it. Args: dataset: xarray dataset with the qubit data qubit_element: name of the qubit element Returns: QOI: Quantity of interest as QOI wrapped object

rotate_to_probability_axis

rotate_to_probability_axis(complex_measurement_data)

Rotates the S21 IQ points to the real - normalized axis that describes the |0> - |1> axis. !!! It Assumes that complex_measurement_data[-2] corresponds to the |0> and complex_measurement_data[-1] corresponds to the |1>

T2Model

T2Model(*args, **kwargs)

Bases: Model

Generate a cosine model that can be fit to Rabi oscillation data.

T2NodeAnalysis

T2NodeAnalysis(name, redis_fields)

Bases: BaseAllQubitsAnalysis

Node analysis for T2 measurements. This class performs T2 analysis for multiple qubits and uses the T2QubitAnalysis class for individual qubit analysis.

Methods:

Name Description
analyze_node

Analyze the node and save the results to redis.

open_dataset

Open the dataset for the analysis.

analyze_node

analyze_node(data_path: Path, index: int = 0) -> QOI

Analyze the node and save the results to redis. Args: data_path: Path to the dataset index: Index of the dataset to be analyzed

Returns:

Name Type Description
analysis_results QOI

Dictionary with the analysis results for each qubit

open_dataset

open_dataset(index: int = 0) -> Dataset

Open the dataset for the analysis.

Parameters:

Name Type Description Default
index int

By default 0 for most of the measurements, can be set to load multiple datasets.

0

Returns:

Type Description
Dataset

xarray.Dataset with measurement results

T2QubitAnalysis

T2QubitAnalysis(name, redis_fields)

Bases: BaseT2QubitAnalysis

Class for T2 qubit analysis. This class implements the analysis of T2 times for a single qubit using a cosine model with exponential decay. It fits the model to the data and extracts the T2 time.

Methods:

Name Description
analyse_t2_times

Perform the analysis of T2 times for the qubit.

plot

Plot the fitted values from the analysis

process_qubit

Setup the qubit data and analyze it.

rotate_to_probability_axis

Rotates the S21 IQ points to the real - normalized axis

analyse_t2_times

analyse_t2_times()

Perform the analysis of T2 times for the qubit. This method identifies the coordinates for delays and repetitions, extracts the magnitudes for each repetition, fits the model, and calculates the average T2 time and its error.

plot

plot(primary_axis)

Plot the fitted values from the analysis Args: primary_axis: The axis object from matplotlib to be plotted Returns: None, will just plot the fitted values

process_qubit

process_qubit(dataset, qubit_element) -> QOI

Setup the qubit data and analyze it. Args: dataset: xarray dataset with the qubit data qubit_element: name of the qubit element Returns: QOI: Quantity of interest as QOI wrapped object

rotate_to_probability_axis

rotate_to_probability_axis(complex_measurement_data)

Rotates the S21 IQ points to the real - normalized axis that describes the |0> - |1> axis. !!! It Assumes that complex_measurement_data[-2] corresponds to the |0> and complex_measurement_data[-1] corresponds to the |1>

cos_func

cos_func(x: float, frequency: float, amplitude: float, offset: float, x0: float, phase: float = 0) -> float

Generate a cosine function with exponential decay. Args: x (float): The input value. frequency (float): The frequency of the cosine wave. amplitude (float): The amplitude of the cosine wave. offset (float): The offset to be added to the cosine wave. x0 (float): The decay constant for the exponential decay. phase (float, optional): The phase shift of the cosine wave. Defaults to 0. Returns: float: The value of the cosine function with exponential decay at x.