Skip to content
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

Merged
merged 1 commit into from
Jan 20, 2025
Merged

Conversation

coreyostrove
Copy link
Contributor

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.

This adds partial support for wildcard models. At the moment this only patches in support for 1D diamond distance wildcard models.
@coreyostrove coreyostrove added this to the 0.9.14 milestone Jan 17, 2025
@coreyostrove coreyostrove self-assigned this Jan 17, 2025
@coreyostrove coreyostrove marked this pull request as ready for review January 17, 2025 06:45
@coreyostrove coreyostrove requested review from a team as code owners January 17, 2025 06:45
@coreyostrove coreyostrove requested review from sserita and removed request for a team January 17, 2025 06:45
@coreyostrove coreyostrove changed the base branch from master to develop January 17, 2025 06:46
@sserita sserita modified the milestones: 0.9.14, 0.9.13.1 Jan 20, 2025
Copy link
Contributor

@sserita sserita left a 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.

Comment on lines +2297 to +2331
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.

Copy link
Contributor

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!

@sserita sserita merged commit 3690893 into develop Jan 20, 2025
4 checks passed
@sserita sserita deleted the feature-instrument-wildcard branch January 20, 2025 22:54
@sserita sserita mentioned this pull request Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants