pygsti.models.modelconstruction.create_explicit_model_from_expressions

pygsti.models.modelconstruction.create_explicit_model_from_expressions#

create_explicit_model_from_expressions(state_space, op_labels, op_expressions, prep_labels=('rho0',), prep_expressions=('0',), effect_labels='standard', effect_expressions='standard', povm_labels='Mdefault', basis='auto', gate_type='full', prep_type='auto', povm_type='auto', instrument_type='auto', evotype='default')#

Build a new ExplicitOpModel given lists of labels and expressions.

Parameters:
  • state_space (StateSpace) – the state space for the model.

  • op_labels (list of strings) –

    A list of labels for each created gate in the final model. 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.

  • op_expressions (list of strings) – A list of gate expressions, each corresponding to a operation label in op_labels, which determine what operation each gate performs (see documentation for create_operation()).

  • prep_labels (list of string) – A list of labels for each created state preparation in the final model. To conform with conventions these labels should begin with “rho”.

  • prep_expressions (list of strings) – A list of vector expressions for each state preparation vector (see documentation for _create_spam_vector()).

  • effect_labels (list, optional) – If povm_labels is a string, then this is just a list of the effect (outcome) labels for the single POVM. If povm_labels is a tuple, then effect_labels must be a list of lists of effect labels, each list corresponding to a POVM. If set to the special string “standard” then the length-n binary strings are used when the state space consists of n qubits (e.g. “000”, “001”, … “111” for 3 qubits) and the labels “0”, “1”, … “<dim>” are used, where <dim> is the dimension of the state space, in all non-qubit cases.

  • effect_expressions (list, optional) – A list or list-of-lists of (string) vector expressions for each POVM effect vector (see documentation for _create_spam_vector()). Expressions correspond to labels in effect_labels. If set to the special string “standard”, then the expressions “0”, “1”, … “<dim>” are used, where <dim> is the dimension of the state space.

  • povm_labels (list or string, optional) – A list of POVM labels, or a single (string) label. In the latter case, only a single POVM is created and the format of effect_labels and effect_expressions is simplified (see above).

  • basis ({'gm','pp','std','qt','auto'}, optional) –

    the basis of the matrices in the returned Model

    • ”std” = operation matrix operates on density mx expressed as sum of matrix units

    • ”gm” = operation matrix operates on density mx expressed as sum of normalized Gell-Mann matrices

    • ”pp” = operation matrix operates on density mx expresses as sum of tensor-product of Pauli matrices

    • ”qt” = operation matrix operates on density mx expressed as sum of Qutrit basis matrices

    • ”auto” = “pp” if possible (integer num of qubits), “qt” if density matrix dim == 3, and “gm” otherwise.

  • parameterization ({"full","TP"}, optional) – How to parameterize the gates of the resulting Model (see documentation for create_operation()).

  • evotype (Evotype or str, optional) – The evolution type of this model, describing how states are represented. The special value “default” is equivalent to specifying the value of pygsti.evotypes.Evotype.default_evotype.

Returns:

The created model.

Return type:

ExplicitOpModel