-
Notifications
You must be signed in to change notification settings - Fork 56
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
Feature msgate modelpacks #281
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Typically these gate sets are for devices with a Molmer-Sorenson two-qubit gate. Currently implemented in smq2Q_XYXX.py and smq2Q_XYZZ.py, though we may want to change these module names (?). Also, the germ and fiducial circuits in this commit were generated using older algorithms or by more dubious means of converting the circuits of another 2Q modelpack, and it would best to re-generate these using our latest circuit-selection algorithms before finalizing these modelpacks.
Previously the call would fail with a KeyError exception because we were using the wrong set of qudit labels, so I expect this wasn't caught because we've just never used it. We should add a unit test for this.
… a target model. Usually a StandardGST protocol either needs to be given a target model or is run(...) with an experiment design that can produce one via a processor spec. This commit adds better error handling and reporting for the case when a target model is not given and can't be obtained via the edesign.
…l object. Usually the objfn_builders argument is left as None, but when it's given we should be able to give it a value to that can be cast to a GSTObjFnBuilders object and not need an object of that type itself (like it says in the docstring). This commit just adds a GSTObjFnBuilders.cast call to StandardGST.__init__.
Probably not caught because we don't use this protocol much, this bug prevented ModelTest protocol objects from being serialized correctly. Required a change in auxfile-type from "serialized-object" to "list:serialized-object".
…abels. Removes a spurious reference to "_symplectic_reps" from QuditProcessorSpec (this is a member of QubitProcessorSpec but not QuditProcessorSpec), along with a repeated argument in from_nice_serialization's call to QuditProcessorSpec.__init__, causing QuditProcessorSpec to error when un-serialized. Also updates QuditProcessorSpec.map_qudit_labels so that a QubitProcessorSpec object is returned when `self` is a QubitProcessorSpec. This seems natural and expected, and I think if we don't mind a small hit to efficiency we could just have QubitProcessorSpec.map_qubit_labels fall back to this function now.
Adds an omitted 'circuit_list' argument in two places. This would only cause an issue when working with complicated experiment designs where the leaving the circuit list unspecified defaults to more circuits than are appropriate (all the dataset's circuits, which may include additional circuits for other sub-experiment-designs).
…g is reset. A call to a generic truncation function within copy_with_maxlengths reset the 'nested' flag (appropriately I think, since the edesign may no longer be nested) and copy_with_maxlengths should have set the flag so it conveyed. This commit updates the function so it does convey the nested flag and copy_with_maxlengths works as it should.
… into feature-msgate-modelpacks
…ernalgates.py This would cause Gzz and Gxx gates to be created incorrectly, e.g., in a processor spec whenever they were used. Note that this bug doesn't affect the smq2Q_XYXX and smq2Q_XYZZ modelpacks which use a (correct) hard-coded unitary in the model creation routines in modelconstruction.py.
sserita
approved these changes
Dec 13, 2022
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.
Looks good!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds two new modelpacks for gate sets typically implemented using Mølmer–Sørensen a 2-qubit gate
Adds
smq2Q_XYXX
andsmq2Q_XYZZ
modelpacks, which contain information for running GST on two-qubit gate sets that have X and Y pi/2 gates along with a maximally-entangling XX or ZZ interaction. It also adds"XX"
and"ZZ"
to the list of recognized gate types when building an explicit model from scratch. The germs and fiducial pairs in these modelpacks were generated using legacy methods. This maintains consistency with the other modelpacks in pyGSTi and results in experiment designs with the same order-of-magnitude size as existing modelpacks.This PR also contains a number of minor bug fixes and enhancements:
QubitProcessorSpec.map_qudit_labels
returns aQubitProcessorSpec
rather than aQuditProcessorSpec
StandardGSTDesign.copy_with_maxlengths
correctly updates sets thenested
attribute of the returned experiment design.StandardGST.__init__
correctly casts itsobjfn_builders
argument to aGSTObjFnBuilders
object.StandardGST
raises more meaningful errors when it requires atarget_model
be specified and one isn't (determined duringprotocol.run
)ModelTest
correctly serializes its objective function builders.ConfidenceRegionFactory.compute_hessian
when a subset of all the circuits in the relevantDataSet
should be used.