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

Feature msgate modelpacks #281

Merged
merged 12 commits into from
Dec 13, 2022
Merged

Feature msgate modelpacks #281

merged 12 commits into from
Dec 13, 2022

Conversation

enielse
Copy link
Collaborator

@enielse enielse commented Nov 30, 2022

Adds two new modelpacks for gate sets typically implemented using Mølmer–Sørensen a 2-qubit gate

Adds smq2Q_XYXX and smq2Q_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 a QubitProcessorSpec rather than a QuditProcessorSpec
  • StandardGSTDesign.copy_with_maxlengths correctly updates sets the nested attribute of the returned experiment design.
  • StandardGST.__init__ correctly casts its objfn_builders argument to a GSTObjFnBuilders object.
  • StandardGST raises more meaningful errors when it requires a target_model be specified and one isn't (determined during protocol.run)
  • ModelTest correctly serializes its objective function builders.
  • fixes a bug in ConfidenceRegionFactory.compute_hessian when a subset of all the circuits in the relevant DataSet should be used.
  • updates a few docstring typos.

Erik Nielsen and others added 12 commits September 12, 2022 07:56
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.
…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.
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.

Looks good!

@sserita sserita merged commit d83670a into develop Dec 13, 2022
@sserita sserita deleted the feature-msgate-modelpacks branch December 13, 2022 16:26
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