-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wildcard Support for Instruments #527
Conversation
This adds partial support for wildcard models. At the moment this only patches in support for 1D diamond distance wildcard models.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Straightforward addition. We may revisit this and clean it all up a bit when doing #273, but I see no reason to hold up this PR over any of those concerns.
using the model introduced in https://doi.org/10.1038/s41534-023-00764-y. | ||
|
||
Parameters | ||
---------- | ||
model : Model | ||
The model to add a wildcard budget to. | ||
estimate : Estimate | ||
The estimate object containing the model and data to be used. | ||
|
||
ds : DataSet | ||
The data the model predictions are being compared with. | ||
objfn_cache : ObjectiveFunctionCache | ||
A cache for objective function evaluations. | ||
|
||
circuits_to_use : list | ||
The circuits whose data are compared. | ||
mdc_objfn : ModelDatasetCircuitsStore | ||
An object that stores the model, dataset, and circuits to be used in the computation. | ||
|
||
parameters : dict | ||
Various parameters of the estimate at hand. | ||
|
||
badfit_options : GSTBadFitOptions, optional | ||
Options specifying what post-processing actions should be performed when | ||
a fit is unsatisfactory. Contains detailed parameters for wildcard budget | ||
a fit is unsatisfactory. Contains detailed parameters for wildcard budget | ||
creation. | ||
|
||
comm : mpi4py.MPI.Comm, optional | ||
An MPI communicator used to run this computation in parallel. | ||
|
||
mem_limit : int, optional | ||
A rough per-processor memory limit in bytes. | ||
|
||
verbosity : int, optional | ||
Level of detail printed to stdout. | ||
|
||
gaugeopt_suite : GSTGaugeOptSuite, optional (default None) | ||
The 1-D wildcard models can be based on gauge-variant functions such as the diamond distance. When gauge optimization is applied this will ensure the gauge optimized models used are consistent in the wildcard model and the parent estimates. | ||
The 1-D wildcard models can be based on gauge-variant functions such as the diamond distance. | ||
When gauge optimization is applied, this will ensure the gauge optimized models used are consistent | ||
in the wildcard model and the parent estimates. | ||
|
||
Returns | ||
------- | ||
PrimitiveOpsWildcardBudget | ||
PrimitiveOpsWildcardBudget or dict | ||
The computed wildcard budget. If gauge optimization is applied, a dictionary of | ||
budgets keyed by gauge optimization labels is returned. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As always, these docstring updates are very appreciated!
This adds partial support for adding wildcard models to estimates containing quantum instruments. At the moment this only patches in support for 1D diamond distance wildcard models. This addresses issue #463.
An additional change is that a slightly different version of the instrument fidelity and instrument diamond distance functions in reportables have been copied over to optools for better discoverability. For a separate thread on eventually reconciling those two files see #526.