pygsti.extras.drift.trmodel

Functions for Fourier analysis of equally spaced time-series data

Module Contents

Classes

TimeResolvedModel

Encapsulates a basic form of time-resolved model, for implementing simple types of time-resolved characterization,

Functions

negloglikelihood(trmodel, ds[, minp, maxp])

The negative loglikelihood for a TimeResolvedModel given the time-series data.

maxlikelihood(trmodel, ds[, minp, maxp, bounds, ...])

Finds the maximum likelihood TimeResolvedModel given the data.

class pygsti.extras.drift.trmodel.TimeResolvedModel(hyperparameters, parameters)

Bases: object

Encapsulates a basic form of time-resolved model, for implementing simple types of time-resolved characterization, e.g., time-resolved Ramsey spectroscopy. This object is a container for specifying a particular time-resolved model, which is achieved by defining the method probabilities. See the docstring of that method for further details.

This object is not intended to be used to encapsulate a time-resolved model that requires any intensive computations, e.g., a time-resolved process matrix model for full time-resolved GST. Instead, it is intend to be used for easy DIY time-resolved tomography on very simple models.

Initializes a TimResolvedModel object.

Parameters

hyperparameters: list

A set of meta-parameters, that define the model. For example, these could be frequencies to include in a Fourier decomposition.

parameters: list

The values for the parameters of the model. For example, these could be the amplitudes for each frequency in a Fourier decomposition.

Returns

TimeResolvedModel

hyperparameters
parameters
set_parameters(parameters)

Sets the parameters of the model.

parameters_copy()

Returns the parameters of the model.

abstract probabilities(circuit, times)

Specified in each derived class

Specifying this method is the core to building a time-resolved model. This method should return the probabiilties for each outcome, for the input circuit at the specified times.

Parameters
circuitCircuit

The circuit to return the probability trajectories for.

timeslist

The times to calculate the probabilities for.

Returns
dict

A dictionary where the keys are the possible outcomes of the circuit, and the value for an outcome is a list of the probabilities to obtain that outcomes at the specified times (so this list is the same length as times).

copy()
pygsti.extras.drift.trmodel.negloglikelihood(trmodel, ds, minp=0, maxp=1)

The negative loglikelihood for a TimeResolvedModel given the time-series data.

Parameters

timeresolvedmodel: TimeResolvedModel

The TimeResolvedModel to calculate the likelihood of.

ds: DataSet

A DataSet, containing time-series data.

minp, maxp: float, optional

Value used to smooth the 0 and 1 probability boundaries for the likelihood function. To get the extact nll, leave as 0 and 1.

Returns

float

The negative loglikelihood of the model.

pygsti.extras.drift.trmodel.maxlikelihood(trmodel, ds, minp=0.0001, maxp=1 - 1e-06, bounds=None, returnoptout=False, optoptions=None, verbosity=1)

Finds the maximum likelihood TimeResolvedModel given the data.

Parameters

timeresolvedmodel: TimeResolvedModel

The TimeResolvedModel that is used as the seed, and which defines the class of parameterized models to optimize over.

ds: DataSet

A DataSet, containing time-series data.

minp, maxp: float, optional

Value used to smooth the 0 and 1 probability boundaries for the likelihood function.

bounds: list or None, optional

Bounds on the parameters, as specified in scipy.optimize.minimize

optout: bool, optional

Wether to return the output of scipy.optimize.minimize

optoptions: dict, optional

Optional arguments for scipy.optimize.minimize.

Returns

float

The maximum loglikelihood model