Simple Estimation

Function Reference

qinfer.simple_est_prec(data, freq_min=0.0, freq_max=1.0, n_particles=6000, return_all=False)[source]

Estimates a simple precession (cos²) from experimental data. Note that this model is mainly for testing purposes, as it does not consider the phase or amplitude of precession, leaving only the frequency.

Parameters:
  • data (see Data Argument Type) – Data to be used in estimating the precession frequency.
  • freq_min (float) – The minimum feasible frequency to consider.
  • freq_max (float) – The maximum feasible frequency to consider.
  • n_particles (int) – The number of particles to be used in estimating the precession frequency.
  • return_all (bool) – Controls whether additional return values are provided, such as the updater.
Columns:
  • counts (int) – How many counts were observed at the sampled time.
  • t (float) – The evolutions time at which the samples were collected.
  • n_shots (int) – How many samples were collected at the given evolution time.
Return mean:

Bayesian mean estimator for the precession frequency.

Return var:

Variance of the final posterior over frequency.

Return extra:

See Extra Return Values. Only returned if return_all is True.

qinfer.simple_est_rb(data, interleaved=False, p_min=0.0, p_max=1.0, n_particles=8000, return_all=False)[source]

Estimates the fidelity of a gateset from a standard or interleaved randomized benchmarking experiment.

Parameters:
  • data (see Data Argument Type) – Data to be used in estimating the gateset fidelity.
  • p_min (float) – Minimum value of the parameter \(p\) to consider feasible.
  • p_max (float) – Minimum value of the parameter \(p\) to consider feasible.
  • n_particles (int) – The number of particles to be used in estimating the randomized benchmarking model.
  • return_all (bool) – Controls whether additional return values are provided, such as the updater.
Columns:
  • counts (int) – How many sequences of length \(m\) were observed to survive.
  • m (int) – How many gates were used for sequences in this row of the data.
  • n_shots (int) – How many different sequences of length \(m\) were measured.
  • reference (bool)True if this row represents reference sequences, or False if the gate of interest is interleaved. Note that this column is omitted if interleaved is False.
Return mean:

Bayesian mean estimator for the model vector \((p, A, B)\), or \((\tilde{p}, p_{\text{ref}}, A, B)\) for the interleaved case.

Return var:

Variance of the final posterior over RB model vectors.

Return extra:

See Extra Return Values. Only returned if return_all is True.

Data Argument Type

Each of the functions above takes as its first argument the data to be used in estimation. This data can be passed in two different ways (more will be added soon):

  • A file-like object or a str containing a file name: These will cause the data to be loaded from the given file as comma-separated values. Columns will be read in based on the order in which they appear in the file.
  • A DataFrame: This will cause the data to be loaded from the given data frame, reading in columns by their headings.
  • An ndarray with scalar data type and shape (n_rows, n_cols): Each column will be read in by its order.
  • An ndarray with record data types and shape (n_rows, ): Each column will be read in as a field of the array.

Extra Return Values

Each of the functions above supports an argument return_all. If True, a dictionary with the following fields will be returned as well:

  • updater (SMCUpdater): An updater representing the final posterior for the estimation procedure.