pygsti.algorithms.directx
Functions for generating Direct-(LGST, MC2GST, MLGST) models
Module Contents
Functions
|
Constructs a model that contains LGST estimates for circuits_to_estimate. |
|
Constructs a model of LGST estimates for target gates and circuit_to_estimate. |
|
Constructs a dictionary with keys == circuits and values == Direct-LGST Models. |
|
Constructs a model of LSGST estimates for target gates and circuit_to_estimate. |
|
Constructs a dictionary with keys == circuits and values == Direct-LSGST Models. |
|
Constructs a model of MLEGST estimates for target gates and circuit_to_estimate. |
|
Constructs a dictionary with keys == circuits and values == Direct-MLEGST Models. |
|
Constructs a model containing a single LSGST estimate of circuit_to_estimate. |
|
Constructs a dictionary with keys == circuits and values == Focused-LSGST Models. |
- pygsti.algorithms.directx.model_with_lgst_circuit_estimates(circuits_to_estimate, dataset, prep_fiducials, meas_fiducials, target_model, include_target_ops=True, op_label_aliases=None, guess_model_for_gauge=None, circuit_labels=None, svd_truncate_to=None, verbosity=0)
Constructs a model that contains LGST estimates for circuits_to_estimate.
For each circuit in circuits_to_estimate, the constructed model contains the LGST estimate for s as separate gate, labeled either by the corresponding element of circuit_labels or by the tuple of s itself.
Parameters
- circuits_to_estimatelist of Circuits or tuples
The circuits to estimate using LGST
- datasetDataSet
The data to use for LGST
- prep_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective preparation.
- meas_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective measurement.
- target_modelModel
A model used by LGST to specify which operation labels should be estimated, a guess for which gauge these estimates should be returned in, and used to simplify circuits.
- include_target_opsbool, optional
If True, the operation labels in target_model will be included in the returned model.
- op_label_aliasesdictionary, optional
Dictionary whose keys are operation label “aliases” and whose values are tuples corresponding to what that operation label should be expanded into before querying the dataset. Defaults to the empty dictionary (no aliases defined) e.g. opLabelAliases[‘Gx^3’] = (‘Gx’,’Gx’,’Gx’)
- guess_model_for_gaugeModel, optional
A model used to compute a gauge transformation that is applied to the LGST estimates. This gauge transformation is computed such that if the estimated gates matched the model given, then the gate matrices would match, i.e. the gauge would be the same as the model supplied. Defaults to the target_model.
- circuit_labelslist of strings, optional
A list of labels in one-to-one correspondence with the circuit in circuits_to_estimate. These labels are the keys to access the operation matrices in the returned Model, i.e. op_matrix = returned_model[op_label]
- svd_truncate_toint, optional
The Hilbert space dimension to truncate the operation matrices to using a SVD to keep only the largest svdToTruncateTo singular values of the I_tildle LGST matrix. Zero means no truncation. Defaults to dimension of target_model.
- verbosityint, optional
Verbosity value to send to run_lgst(…) call.
Returns
- Model
A model containing LGST estimates for all the requested circuits and possibly the gates in target_model.
- pygsti.algorithms.directx.direct_lgst_model(circuit_to_estimate, circuit_label, dataset, prep_fiducials, meas_fiducials, target_model, op_label_aliases=None, svd_truncate_to=None, verbosity=0)
Constructs a model of LGST estimates for target gates and circuit_to_estimate.
Parameters
- circuit_to_estimateCircuit or tuple
The single circuit to estimate using LGST
- circuit_labelstring
The label for the estimate of circuit_to_estimate. i.e. op_matrix = returned_model[op_label]
- datasetDataSet
The data to use for LGST
- prep_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective preparation.
- meas_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective measurement.
- target_modelModel
The target model used by LGST to extract operation labels and an initial gauge
- op_label_aliasesdictionary, optional
Dictionary whose keys are operation label “aliases” and whose values are tuples corresponding to what that operation label should be expanded into before querying the dataset. Defaults to the empty dictionary (no aliases defined) e.g. opLabelAliases[‘Gx^3’] = (‘Gx’,’Gx’,’Gx’)
- svd_truncate_toint, optional
The Hilbert space dimension to truncate the operation matrices to using a SVD to keep only the largest svdToTruncateTo singular values of the I_tildle LGST matrix. Zero means no truncation. Defaults to dimension of target_model.
- verbosityint, optional
Verbosity value to send to run_lgst(…) call.
Returns
- Model
A model containing LGST estimates of circuit_to_estimate and the gates of target_model.
- pygsti.algorithms.directx.direct_lgst_models(circuits, dataset, prep_fiducials, meas_fiducials, target_model, op_label_aliases=None, svd_truncate_to=None, verbosity=0)
Constructs a dictionary with keys == circuits and values == Direct-LGST Models.
Parameters
- circuitslist of Circuit or tuple objects
The circuits to estimate using LGST. The elements of this list are the keys of the returned dictionary.
- datasetDataSet
The data to use for all LGST estimates.
- prep_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective preparation.
- meas_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective measurement.
- target_modelModel
The target model used by LGST to extract operation labels and an initial gauge
- op_label_aliasesdictionary, optional
Dictionary whose keys are operation label “aliases” and whose values are tuples corresponding to what that operation label should be expanded into before querying the dataset. Defaults to the empty dictionary (no aliases defined) e.g. opLabelAliases[‘Gx^3’] = (‘Gx’,’Gx’,’Gx’)
- svd_truncate_toint, optional
The Hilbert space dimension to truncate the operation matrices to using a SVD to keep only the largest svdToTruncateTo singular values of the I_tildle LGST matrix. Zero means no truncation. Defaults to dimension of target_model.
- verbosityint, optional
Verbosity value to send to run_lgst(…) call.
Returns
- dict
A dictionary that relates each circuit to a Model containing the LGST estimate of that circuit’s action (as a SPAM-less operation sequence) stored under the operation label “GsigmaLbl”, along with LGST estimates of the gates in target_model.
- pygsti.algorithms.directx.direct_mc2gst_model(circuit_to_estimate, circuit_label, dataset, prep_fiducials, meas_fiducials, target_model, op_label_aliases=None, svd_truncate_to=None, min_prob_clip_for_weighting=0.0001, prob_clip_interval=(-1000000.0, 1000000.0), verbosity=0)
Constructs a model of LSGST estimates for target gates and circuit_to_estimate.
Starting with a Direct-LGST estimate for circuit_to_estimate, runs LSGST using the same strings that LGST would have used to estimate circuit_to_estimate and each of the target gates. That is, LSGST is run with strings of the form:
prep_fiducial
meas_fiducial
prep_fiducial + meas_fiducial
prep_fiducial + single_gate + meas_fiducial
prep_fiducial + circuit_to_estimate + meas_fiducial
and the resulting Model estimate is returned.
Parameters
- circuit_to_estimateCircuit
The single circuit to estimate using LSGST
- circuit_labelstring
The label for the estimate of circuit_to_estimate. i.e. op_matrix = returned_mode[op_label]
- datasetDataSet
The data to use for LGST
- prep_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective preparation.
- meas_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective measurement.
- target_modelModel
The target model used by LGST to extract operation labels and an initial gauge
- op_label_aliasesdictionary, optional
Dictionary whose keys are operation label “aliases” and whose values are tuples corresponding to what that operation label should be expanded into before querying the dataset. Defaults to the empty dictionary (no aliases defined) e.g. opLabelAliases[‘Gx^3’] = (‘Gx’,’Gx’,’Gx’)
- svd_truncate_toint, optional
The Hilbert space dimension to truncate the operation matrices to using a SVD to keep only the largest svdToTruncateTo singular values of the I_tildle LGST matrix. Zero means no truncation. Defaults to dimension of target_model.
- min_prob_clip_for_weightingfloat, optional
defines the clipping interval for the statistical weight used within the chi^2 function (see chi2fn).
- prob_clip_interval2-tuple, optional
(min,max) to clip probabilities to within Model probability computation routines (see Model.bulk_fill_probs)
- verbosityint, optional
Verbosity value to send to run_lgst(…) and do_mc2gst(…) calls.
Returns
- Model
A model containing LSGST estimates of circuit_to_estimate and the gates of target_model.
- pygsti.algorithms.directx.direct_mc2gst_models(circuits, dataset, prep_fiducials, meas_fiducials, target_model, op_label_aliases=None, svd_truncate_to=None, min_prob_clip_for_weighting=0.0001, prob_clip_interval=(-1000000.0, 1000000.0), verbosity=0)
Constructs a dictionary with keys == circuits and values == Direct-LSGST Models.
Parameters
- circuitslist of Circuit or tuple objects
The circuits to estimate using LSGST. The elements of this list are the keys of the returned dictionary.
- datasetDataSet
The data to use for all LGST and LSGST estimates.
- prep_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective preparation.
- meas_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective measurement.
- target_modelModel
The target model used by LGST to extract operation labels and an initial gauge
- op_label_aliasesdictionary, optional
Dictionary whose keys are operation label “aliases” and whose values are tuples corresponding to what that operation label should be expanded into before querying the dataset. Defaults to the empty dictionary (no aliases defined) e.g. opLabelAliases[‘Gx^3’] = (‘Gx’,’Gx’,’Gx’)
- svd_truncate_toint, optional
The Hilbert space dimension to truncate the operation matrices to using a SVD to keep only the largest svdToTruncateTo singular values of the I_tildle LGST matrix. Zero means no truncation. Defaults to dimension of target_model.
- min_prob_clip_for_weightingfloat, optional
defines the clipping interval for the statistical weight used within the chi^2 function (see chi2fn).
- prob_clip_interval2-tuple, optional
(min,max) to clip probabilities to within Model probability computation routines (see Model.bulk_fill_probs)
- verbosityint, optional
Verbosity value to send to run_lgst(…) and do_mc2gst(…) calls.
Returns
- dict
A dictionary that relates each circuit to a Model containing the LGST estimate of that circuit’s action (as a SPAM-less operation sequence) stored under the operation label “GsigmaLbl”, along with LSGST estimates of the gates in target_model.
- pygsti.algorithms.directx.direct_mlgst_model(circuit_to_estimate, circuit_label, dataset, prep_fiducials, meas_fiducials, target_model, op_label_aliases=None, svd_truncate_to=None, min_prob_clip=1e-06, prob_clip_interval=(-1000000.0, 1000000.0), verbosity=0)
Constructs a model of MLEGST estimates for target gates and circuit_to_estimate.
Starting with a Direct-LGST estimate for circuit_to_estimate, runs MLEGST using the same strings that LGST would have used to estimate circuit_to_estimate and each of the target gates. That is, MLEGST is run with strings of the form:
prep_fiducial
meas_fiducial
prep_fiducial + meas_fiducial
prep_fiducial + singleGate + meas_fiducial
prep_fiducial + circuit_to_estimate + meas_fiducial
and the resulting Model estimate is returned.
Parameters
- circuit_to_estimateCircuit or tuple
The single circuit to estimate using LSGST
- circuit_labelstring
The label for the estimate of circuit_to_estimate. i.e. op_matrix = returned_model[op_label]
- datasetDataSet
The data to use for LGST
- prep_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective preparation.
- meas_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective measurement.
- target_modelModel
The target model used by LGST to extract operation labels and an initial gauge
- op_label_aliasesdictionary, optional
Dictionary whose keys are operation label “aliases” and whose values are tuples corresponding to what that operation label should be expanded into before querying the dataset. Defaults to the empty dictionary (no aliases defined) e.g. opLabelAliases[‘Gx^3’] = (‘Gx’,’Gx’,’Gx’)
- svd_truncate_toint, optional
The Hilbert space dimension to truncate the operation matrices to using a SVD to keep only the largest svdToTruncateTo singular values of the I_tildle LGST matrix. Zero means no truncation. Defaults to dimension of target_model.
- min_prob_clipfloat, optional
defines the minimum probability “patch point” used within the logl function.
- prob_clip_interval2-tuple, optional
(min,max) to clip probabilities to within Model probability computation routines (see Model.bulk_fill_probs)
- verbosityint, optional
Verbosity value to send to run_lgst(…) and do_mlgst(…) calls.
Returns
- Model
A model containing MLEGST estimates of circuit_to_estimate and the gates of target_model.
- pygsti.algorithms.directx.direct_mlgst_models(circuits, dataset, prep_fiducials, meas_fiducials, target_model, op_label_aliases=None, svd_truncate_to=None, min_prob_clip=1e-06, prob_clip_interval=(-1000000.0, 1000000.0), verbosity=0)
Constructs a dictionary with keys == circuits and values == Direct-MLEGST Models.
Parameters
- circuitslist of Circuit or tuple objects
The circuits to estimate using MLEGST. The elements of this list are the keys of the returned dictionary.
- datasetDataSet
The data to use for all LGST and LSGST estimates.
- prep_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective preparation.
- meas_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective measurement.
- target_modelModel
The target model used by LGST to extract operation labels and an initial gauge
- op_label_aliasesdictionary, optional
Dictionary whose keys are operation label “aliases” and whose values are tuples corresponding to what that operation label should be expanded into before querying the dataset. Defaults to the empty dictionary (no aliases defined) e.g. opLabelAliases[‘Gx^3’] = (‘Gx’,’Gx’,’Gx’)
- svd_truncate_toint, optional
The Hilbert space dimension to truncate the operation matrices to using a SVD to keep only the largest svdToTruncateTo singular values of the I_tildle LGST matrix. Zero means no truncation. Defaults to dimension of target_model.
- min_prob_clipfloat, optional
defines the minimum probability “patch point” used within the logl function.
- prob_clip_interval2-tuple, optional
(min,max) to clip probabilities to within Model probability computation routines (see Model.bulk_fill_probs)
- verbosityint, optional
Verbosity value to send to run_lgst(…) and do_mlgst(…) calls.
Returns
- dict
A dictionary that relates each circuit to a Model containing the LGST estimate of that circuit’s action (as a SPAM-less operation sequence) stored under the operation label “GsigmaLbl”, along with MLEGST estimates of the gates in target_model.
- pygsti.algorithms.directx.focused_mc2gst_model(circuit_to_estimate, circuit_label, dataset, prep_fiducials, meas_fiducials, start_model, op_label_aliases=None, min_prob_clip_for_weighting=0.0001, prob_clip_interval=(-1000000.0, 1000000.0), verbosity=0)
Constructs a model containing a single LSGST estimate of circuit_to_estimate.
Starting with start_model, run LSGST with the same circuits that LGST would use to estimate circuit_to_estimate. That is, LSGST is run with strings of the form: prep_fiducial + circuit_to_estimate + meas_fiducial and return the resulting Model.
Parameters
- circuit_to_estimateCircuit or tuple
The single circuit to estimate using LSGST
- circuit_labelstring
The label for the estimate of circuit_to_estimate. i.e. op_matrix = returned_model[op_label]
- datasetDataSet
The data to use for LGST
- prep_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective preparation.
- meas_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective measurement.
- start_modelModel
The model to seed LSGST with. Often times obtained via LGST.
- op_label_aliasesdictionary, optional
Dictionary whose keys are operation label “aliases” and whose values are tuples corresponding to what that operation label should be expanded into before querying the dataset. Defaults to the empty dictionary (no aliases defined) e.g. opLabelAliases[‘Gx^3’] = (‘Gx’,’Gx’,’Gx’)
- min_prob_clip_for_weightingfloat, optional
defines the clipping interval for the statistical weight used within the chi^2 function (see chi2fn).
- prob_clip_interval2-tuple, optional
(min,max) to clip probabilities to within Model probability computation routines (see Model.bulk_fill_probs)
- verbosityint, optional
Verbosity value to send do_mc2gst(…) call.
Returns
- Model
A model containing LSGST estimate of circuit_to_estimate.
- pygsti.algorithms.directx.focused_mc2gst_models(circuits, dataset, prep_fiducials, meas_fiducials, start_model, op_label_aliases=None, min_prob_clip_for_weighting=0.0001, prob_clip_interval=(-1000000.0, 1000000.0), verbosity=0)
Constructs a dictionary with keys == circuits and values == Focused-LSGST Models.
Parameters
- circuitslist of Circuit or tuple objects
The circuits to estimate using LSGST. The elements of this list are the keys of the returned dictionary.
- datasetDataSet
The data to use for all LGST and LSGST estimates.
- prep_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective preparation.
- meas_fiducialslist of Circuits
Fiducial circuits used to construct an informationally complete effective measurement.
- start_modelModel
The model to seed LSGST with. Often times obtained via LGST.
- op_label_aliasesdictionary, optional
Dictionary whose keys are operation label “aliases” and whose values are tuples corresponding to what that operation label should be expanded into before querying the dataset. Defaults to the empty dictionary (no aliases defined) e.g. opLabelAliases[‘Gx^3’] = (‘Gx’,’Gx’,’Gx’)
- min_prob_clip_for_weightingfloat, optional
defines the clipping interval for the statistical weight used within the chi^2 function (see chi2fn).
- prob_clip_interval2-tuple, optional
(min,max) to clip probabilities to within Model probability computation routines (see Model.bulk_fill_probs)
- verbosityint, optional
Verbosity value to send to do_mc2gst(…) call.
Returns
- dict
A dictionary that relates each circuit to a Model containing the LSGST estimate of that circuit’s action, stored under the operation label “GsigmaLbl”.