pygsti.construction.build_gateset

pygsti.construction.build_gateset(stateSpaceDims, stateSpaceLabels, gateLabels, gateExpressions, prepLabels, prepExpressions, effectLabels, effectExpressions, spamdefs, basis='gm', parameterization='full')

Build a new GateSet given lists of gate labels and expressions.

Parameters:
  • stateSpaceDims (list of ints) – Dimenstions specifying the structure of the density-matrix space. Elements correspond to block dimensions of an allowed density matrix in the standard basis, and the density-matrix space is the direct sum of linear spaces of dimension block-dimension^2.
  • stateSpaceLabels (a list of tuples) – Each tuple corresponds to a block of a density matrix in the standard basis (and therefore a component of the direct-sum density matrix space). Elements of a tuple are user-defined labels beginning with “L” (single level) or “Q” (two-level; qubit) which interpret the d-dimensional state space corresponding to a d x d block as a tensor product between qubit and single level systems.
  • gateLabels (list of strings) – A list of labels for each created gate in the final gateset. To conform with text file parsing conventions these names should begin with a capital G and can be followed by any number of lowercase characters, numbers, or the underscore character.
  • gateExpressions (list of strings) – A list of gate expressions, each corresponding to a gate label in gateLabels, which determine what operation each gate performs (see documentation for build_gate).
  • prepLabels (list of string) – A list of labels for each created state preparation in the final gateset. To conform with conventions these shames should begin with “rho”.
  • prepExpressions (list of strings) – A list of vector expressions for each state preparation vector (see documentation for build_vector).
  • effectLabels (list of string) – A list of labels for each created and parameterized POVM effect in the final gateset. To conform with conventions these shames should begin with “E”.
  • effectExpressions (list of strings) – A list of vector expressions for each POVM effect vector (see documentation for build_vector).
  • spamdefs (dict) –

    A dictionary mapping spam labels to (prepLabel,ELabel) 2-tuples associating a particular state preparation and effect vector with a label. prepLabel and ELabel must be contained in prepLabels and effectLabels respectively except for two special cases:

    1. ELabel can be set to “remainder” to mean an effect vector that is the identity - (other effect vectors)
    2. ELabel and prepLabel can both be “remainder” to mean a spam label that generates probabilities that are 1.0 - (sum of probabilities from all other spam labels).
  • basis ({‘gm’,’pp’,’std’}, optional) – the basis of the matrices in the returned GateSet - “std” = gate matrix operates on density mx expressed as sum of matrix units - “gm” = gate matrix operates on dentity mx expressed as sum of normalized Gell-Mann matrices - “pp” = gate matrix operates on density mx expresses as sum of tensor-product of Pauli matrices
  • parameterization ({“full”,”linear”}, optional) – How to parameterize the gates of the resulting GateSet (see documentation for build_gate).
Returns:

The created gate set.

Return type:

GateSet