pygsti.modelpacks.stdtarget

Helper functions for standard model modules.

Module Contents

Functions

stdmodule_to_smqmodule(std_module)

Converts a pyGSTi "standard module" to a "standard multi-qubit module".

pygsti.modelpacks.stdtarget.stdmodule_to_smqmodule(std_module)

Converts a pyGSTi “standard module” to a “standard multi-qubit module”.

PyGSTi provides a number of 1- and 2-qubit models corrsponding to commonly used gate sets, along with related meta-information. Each such model+metadata is stored in a “standard module” beneath pygsti.modelpacks.legacy (e.g. pygsti.modelpacks.legacy.std1Q_XYI is the standard module for modeling a single-qubit quantum processor which can perform X(pi/2), Y(pi/2) and idle operations). Because they deal with just 1- and 2-qubit models, multi-qubit labelling conventions are not used to improve readability. For example, a “X(pi/2)” gate is labelled “Gx” (in a 1Q context) or “Gix” (in a 2Q context) rather than “Gx:0” or “Gx:1” respectively.

There are times, however, when you many want a standard module with this multi-qubit labelling convention (e.g. performing 1Q-GST on the 3rd qubit of a 5-qubit processor). We call such a module a standard multi-qubit module, and these typically begin with “smq” rather than “std”.

Standard multi-qubit modules are created by this function. For example, If you want the multi-qubit version of pygsti.modelpacks.legacy.std1Q_XYI you must:

  1. import std1Q_XYI (from pygsti.modelpacks.legacy import std1Q_XYI)

  2. call this function (i.e. stdmodule_to_smqmodule(std1Q_XYI))

  3. import smq1Q_XYI (from pygsti.modelpacks.legacy import smq1Q_XYI)

The smq1Q_XYI module will look just like the std1Q_XYI module but use multi-qubit labelling conventions.

Deprecated since version v0.9.9: stdmodule_to_smqmodule will be removed in future versions of pyGSTi. Instead, import pre-built SMQ modelpacks directly from pygsti.modelpacks.

Parameters

std_moduleModule

The standard module to convert to a standard-multi-qubit module.

Returns

Module

The new module, although it’s better to import this using the appropriate “smq”-prefixed name as described above.