pygsti.models.modelconstruction
Functions for the construction of new models.
Module Contents
Functions

Build a rho or E vector from an expression. 

Build a the identity vector for a given space and basis. 

Build an operation object from an expression. 

Build a new 

Creates a model by applying aliases to an existing model. 



Create a nqudit "crosstalkfree" model. 

Create a nqudit "cloudcrosstalk" model. 
Create a "cloud crosstalk" model based on maximum error weights and hops along the processor's qudit graph. 
 pygsti.models.modelconstruction.create_spam_vector(vec_expr, state_space, basis)
Build a rho or E vector from an expression.
Parameters
 vec_exprstring
the expression which determines which vector to build. Currenlty, only integers are allowed, which specify a the vector for the pure state of that index. For example, “1” means return vectorize(
1><1
). The index labels the absolute index of the state within the entire state space, and is independent of the directsum decomposition of density matrix space. state_spaceStateSpace
The state space that the created operation should act upon.
 basisstr or Basis
The basis of the returned vector. Allowed values are Matrixunit (std), GellMann (gm), Pauliproduct (pp), and Qutrit (qt) (or a custom basis object).
Returns
 numpy array
The vector specified by vec_expr in the desired basis.
 pygsti.models.modelconstruction.create_identity_vec(basis)
Build a the identity vector for a given space and basis.
Parameters
 basisBasis object
The basis of the returned vector. Allowed values are Matrixunit (std), GellMann (gm), Pauliproduct (pp), and Qutrit (qt) (or a custom basis object).
Returns
 numpy array
The identity vector in the desired basis.
 pygsti.models.modelconstruction.create_operation(op_expr, state_space, basis='pp', parameterization='full', evotype='default')
Build an operation object from an expression.
Parameters
 op_exprstring
expression for the gate to build. String is first split into parts delimited by the colon (:) character, which are composed together to create the final gate. Each part takes on of the allowed forms:
I(ssl_0, …) = identity operation on one or more state space labels (ssl_i)
X(theta, ssl) = xrotation by theta radians of qubit labeled by ssl
Y(theta, ssl) = yrotation by theta radians of qubit labeled by ssl
Z(theta, ssl) = zrotation by theta radians of qubit labeled by ssl
CX(theta, ssl0, ssl1) = controlled xrotation by theta radians. Acts on qubit labeled by ssl1 with ssl0 being the control.
CY(theta, ssl0, ssl1) = controlled yrotation by theta radians. Acts on qubit labeled by ssl1 with ssl0 being the control.
CZ(theta, ssl0, ssl1) = controlled zrotation by theta radians. Acts on qubit labeled by ssl1 with ssl0 being the control.
CNOT(ssl0, ssl1) = standard controllednot gate. Acts on qubit labeled by ssl1 with ssl0 being the control.
CPHASE(ssl0, ssl1) = standard controlledphase gate. Acts on qubit labeled by ssl1 with ssl0 being the control.
LX(theta, i0, i1) = leakage between states i0 and i1. Implemented as an xrotation between states with integer indices i0 and i1 followed by complete decoherence between the states.
 state_spaceStateSpace
The state space that the created operation should act upon.
 basisstr or Basis
The basis the returned operation should be represented in.
 parameterization{“full”,”TP”,”static”}, optional
How to parameterize the resulting gate.
“full” = return a FullArbitraryOp.
“TP” = return a FullTPOp.
“static” = return a StaticArbitraryOp.
 evotypeEvotype or str, optional
The evolution type of this operation, describing how states are represented. The special value “default” is equivalent to specifying the value of pygsti.evotypes.Evotype.default_evotype.
Returns
 LinearOperator
A gate object representing the gate given by op_expr in the desired basis.
 pygsti.models.modelconstruction.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_spaceStateSpace
the state space for the model.
 op_labelslist 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_expressionslist 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_labelslist 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_expressionslist of strings
A list of vector expressions for each state preparation vector (see documentation for
_create_spam_vector()
). effect_labelslist, 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 lengthn 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 nonqubit cases.
 effect_expressionslist, optional
A list or listoflists 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_labelslist 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 dentity mx expressed as sum of normalized GellMann matrices
“pp” = operation matrix operates on density mx expresses as sum of tensorproduct 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()
). evotypeEvotype 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
 ExplicitOpModel
The created model.
 pygsti.models.modelconstruction.create_explicit_alias_model(mdl_primitives, alias_dict)
Creates a model by applying aliases to an existing model.
The new model is created by composing the gates of an existing Model, mdl_primitives, according to a dictionary of Circuit`s, `alias_dict. The keys of alias_dict are the operation labels of the returned Model. state preparations and POVMs are unaltered, and simply copied from mdl_primitives.
Parameters
 mdl_primitivesModel
A Model containing the “primitive” gates (those used to compose the gates of the returned model).
 alias_dictdictionary
A dictionary whose keys are strings and values are Circuit objects specifying sequences of primitive gates. Each key,value pair specifies the composition rule for a creating a gate in the returned model.
Returns
 Model
A model whose gates are compositions of primitive gates and whose spam operations are the same as those of mdl_primitives.
 pygsti.models.modelconstruction.create_explicit_model(processor_spec, custom_gates=None, depolarization_strengths=None, stochastic_error_probs=None, lindblad_error_coeffs=None, depolarization_parameterization='depolarize', stochastic_parameterization='stochastic', lindblad_parameterization='auto', evotype='default', simulator='auto', ideal_gate_type='auto', ideal_spam_type='computational', embed_gates=False, basis='pp')
 pygsti.models.modelconstruction.create_crosstalk_free_model(processor_spec, custom_gates=None, depolarization_strengths=None, stochastic_error_probs=None, lindblad_error_coeffs=None, depolarization_parameterization='depolarize', stochastic_parameterization='stochastic', lindblad_parameterization='auto', evotype='default', simulator='auto', on_construction_error='raise', independent_gates=False, independent_spam=True, ensure_composed_gates=False, ideal_gate_type='auto', ideal_spam_type='computational', implicit_idle_mode='none', basis='pp')
Create a nqudit “crosstalkfree” model.
By virtue of being crosstalkfree, this model’s operations only act nontrivially on their target qudits. Gates consist of an ideal gate operation possibly followed by an error operation.
Errors can be specified using any combination of the 4 error rate/coeff arguments, but each gate name must be provided exclusively to one type of specification. Each specification results in a different type of operation, depending on the parameterization:
depolarization_strengths > DepolarizeOp, StochasticNoiseOp, or exp(LindbladErrorgen)
stochastic_error_probs > StochasticNoiseOp or exp(LindbladErrorgen)
lindblad_error_coeffs > exp(LindbladErrorgen)
In addition to the gate names, the special values “prep” and “povm” may be used as keys to specify the error on the state preparation, measurement, respectively.
Parameters
 processor_specProcessorSpec
The processor specification to create a model for. This object specifies the gate names and unitaries for the processor, and their availability on the processor.
 custom_gatesdict, optional
A dictionary that associates with gate labels
LinearOperator
,OpFactory
, or numpy.ndarray objects. These objects override any other behavior for constructing their designated operations. Keys of this dictionary may be stringtype gate names or labels that include target qudits. depolarization_strengthsdict, optional
A dictionary whose keys are gate names (e.g. “Gx”) and whose values are floats that specify the strength of uniform depolarization.
 stochastic_error_probsdict, optional
A dictionary whose keys are gate names (e.g. “Gx”) and whose values are tuples that specify Paulistochastic rates for each of the nontrivial Paulis (so a 3tuple would be expected for a 1Q gate and a 15tuple for a 2Q gate).
 lindblad_error_coeffsdict, optional
A dictionary whose keys are gate names (e.g. “Gx”) and whose values are dictionaries corresponding to the lindblad_term_dict kwarg taken by LindbladErrorgen. Keys are (termType, basisLabel1, <basisLabel2>) tuples, where termType can be “H” (Hamiltonian), “S” (Stochastic), or “A” (Affine). Hamiltonian and Affine terms always have a single basis label (so key is a 2tuple) whereas Stochastic tuples with 1 basis label indicate a diagonal term, and are the only types of terms allowed when nonham_mode != “all”. Otherwise, Stochastic term tuples can include 2 basis labels to specify “offdiagonal” nonHamiltonian Lindblad terms. Basis labels can be strings or integers. Values are complex coefficients.
 depolarization_parameterizationstr of {“depolarize”, “stochastic”, or “lindblad”}
Determines whether a DepolarizeOp, StochasticNoiseOp, or LindbladErrorgen is used to parameterize the depolarization noise, respectively. When “depolarize” (the default), a DepolarizeOp is created with the strength given in depolarization_strengths. When “stochastic”, the depolarization strength is split evenly among the stochastic channels of a StochasticOp. When “lindblad”, the depolarization strength is split evenly among the coefficients of the stochastic error generators (which are exponentiated to form a LindbladErrorgen with the “depol” parameterization).
 stochastic_parameterizationstr of {“stochastic”, or “lindblad”}
Determines whether a StochasticNoiseOp or LindbladErrorgen is used to parameterize the stochastic noise, respectively. When “stochastic”, elements of stochastic_error_probs are used as coefficients in a linear combination of stochastic channels (the default). When “lindblad”, the elements of stochastic_error_probs are coefficients of stochastic error generators (which are exponentiated to form a LindbladErrorgen with the “cptp” parameterization).
 lindblad_parameterization“auto” or a LindbladErrorgen paramtype
Determines the parameterization of the LindbladErrorgen. When “auto” (the default), the parameterization is inferred from the types of error generators specified in the lindblad_error_coeffs dictionaries. When not “auto”, the parameterization type is passed through to the LindbladErrorgen.
 evotypeEvotype or str, optional
The evolution type. The special value “default” is equivalent to specifying the value of pygsti.evotypes.Evotype.default_evotype.
 simulatorForwardSimulator or {“auto”, “matrix”, “map”}
The simulator used to compute predicted probabilities for the resulting
Model
. Using “auto” selects “matrix” when there are 2 qubits or less, and otherwise selects “map”. on_construction_error{‘raise’,’warn’,ignore’}
What to do when the creation of a gate with the given parameterization fails. Usually you’ll want to “raise” the error. In some cases, for example when converting as many gates as you can into parameterization=”clifford” gates, “warn” or even “ignore” may be useful.
 independent_gatesbool, optional
Whether gates are allowed independent local noise or not. If False, then all gates with the same name (e.g. “Gx”) will have the same (local) noise (e.g. an overrotation by 1 degree), and the operation_bks[‘gates’] dictionary contains a single key per gate name. If True, then gates with the same name acting on different qudits may have different local noise, and so the operation_bks[‘gates’] dictionary contains a key for each gate available gate placement.
 ensure_composed_gatesbool, optional
If True then the elements of the operation_bks[‘gates’] will always be
ComposedOp
objects. The purpose of this is to facilitate modifying the gate operations after the model is created. If False, then the appropriately parameterized gate objects (often dense gates) are used directly. ideal_gate_typestr or tuple, optional
A gate type or tuple of gate types (listed in order of priority) which is used to construct the ideal gates. A gate type usually specifies the Python class that will be created, which determines 1) the parameterization of the gate and 2) the class/category of the gate (e.g. a
StaticClifford
operation has no parameters and is a Clifford operation). ideal_spam_typestr or tuple, optional
Similar to ideal_gate_type but for SPAM elements (state preparations and POVMs).
 implicit_idle_mode{‘none’, ‘add_global’, ‘pad_1Q’}
The way idle operations are added implicitly within the created model. “none” doesn’t add any “extra” idle operations when there is a layer that contains some gates but not gates on all the qudits. “add_global” adds the global idle operation, i.e., the operation for a global idle layer (zero gates  a completely empty layer), to every layer that is simulated, using the global idle as a background idle that always occurs regardless of the operation. “pad_1Q” applies the 1qubit idle gate (if one exists) to all idling qubits within a circuit layer.
 basisBasis or str, optional
The basis to use when constructing operator representations for the elements of the created model.
Returns
 LocalNoiseModel
A model with “rho0” prep, “Mdefault” POVM, and gates labeled by the gate names and qudit labels (as specified by processor_spec). For instance, the operation label for the “Gx” gate on the second qudit might be Label(“Gx”,1).
 pygsti.models.modelconstruction.create_cloud_crosstalk_model(processor_spec, custom_gates=None, depolarization_strengths=None, stochastic_error_probs=None, lindblad_error_coeffs=None, depolarization_parameterization='depolarize', stochastic_parameterization='stochastic', lindblad_parameterization='auto', evotype='default', simulator='auto', independent_gates=False, independent_spam=True, errcomp_type='gates', implicit_idle_mode='none', basis='pp', verbosity=0)
Create a nqudit “cloudcrosstalk” model.
In a cloud crosstalk model, gates consist of a (local) ideal gates followed by an error operation that can act nontrivially on any of the processor’s qudits (not just a gate’s target qudits). Typically a gate’s errors are specified relative to the gate’s target qudits, forming a “cloud” of errors around the target qudits using some notion of locality (that may not be spatial, e.g. local in frequency). Currently, the “ideal” portion of each gate can only be created as a static (parameterless) object – all gate parameters come from the error operation.
Errors can be specified using any combination of the 4 error rate/coeff arguments, but each gate name must be provided exclusively to one type of specification. Each specification results in a different type of operation, depending on the parameterization:
depolarization_strengths > DepolarizeOp, StochasticNoiseOp, or exp(LindbladErrorgen)
stochastic_error_probs > StochasticNoiseOp or exp(LindbladErrorgen)
lindblad_error_coeffs > exp(LindbladErrorgen)
In addition to the gate names, the special values “prep” and “povm” may be used as keys to specify the error on the state preparation, measurement, respectively.
Parameters
 processor_specProcessorSpec
The processor specification to create a model for. This object specifies the gate names and unitaries for the processor, and their availability on the processor.
 custom_gatesdict, optional
A dictionary that associates with gate labels
LinearOperator
,OpFactory
, or numpy.ndarray objects. These objects override any other behavior for constructing their designated operations. Keys of this dictionary may be stringtype gate names or labels that include target qudits. depolarization_strengthsdict, optional
A dictionary whose keys are gate names (e.g. “Gx”) and whose values are floats that specify the strength of uniform depolarization.
 stochastic_error_probsdict, optional
A dictionary whose keys are gate names (e.g. “Gx”) and whose values are tuples that specify Paulistochastic rates for each of the nontrivial Paulis (so a 3tuple would be expected for a 1Q gate and a 15tuple for a 2Q gate).
 lindblad_error_coeffsdict, optional
A dictionary whose keys are gate names (e.g. “Gx”) and whose values are dictionaries corresponding to the lindblad_term_dict kwarg taken by LindbladErrorgen. Keys are (termType, basisLabel1, <basisLabel2>) tuples, where termType can be “H” (Hamiltonian), “S” (Stochastic), or “A” (Affine). Hamiltonian and Affine terms always have a single basis label (so key is a 2tuple) whereas Stochastic tuples with 1 basis label indicate a diagonal term, and are the only types of terms allowed when nonham_mode != “all”. Otherwise, Stochastic term tuples can include 2 basis labels to specify “offdiagonal” nonHamiltonian Lindblad terms. Basis labels can be strings or integers. Values are complex coefficients.
 depolarization_parameterizationstr of {“depolarize”, “stochastic”, or “lindblad”}
Determines whether a DepolarizeOp, StochasticNoiseOp, or LindbladErrorgen is used to parameterize the depolarization noise, respectively. When “depolarize” (the default), a DepolarizeOp is created with the strength given in depolarization_strengths. When “stochastic”, the depolarization strength is split evenly among the stochastic channels of a StochasticOp. When “lindblad”, the depolarization strength is split evenly among the coefficients of the stochastic error generators (which are exponentiated to form a LindbladErrorgen with the “depol” parameterization).
 stochastic_parameterizationstr of {“stochastic”, or “lindblad”}
Determines whether a StochasticNoiseOp or LindbladErrorgen is used to parameterize the stochastic noise, respectively. When “stochastic”, elements of stochastic_error_probs are used as coefficients in a linear combination of stochastic channels (the default). When “lindblad”, the elements of stochastic_error_probs are coefficients of stochastic error generators (which are exponentiated to form a LindbladErrorgen with the “cptp” parameterization).
 lindblad_parameterization“auto” or a LindbladErrorgen paramtype
Determines the parameterization of the LindbladErrorgen. When “auto” (the default), the parameterization is inferred from the types of error generators specified in the lindblad_error_coeffs dictionaries. When not “auto”, the parameterization type is passed through to the LindbladErrorgen.
 evotypeEvotype or str, optional
The evolution type. The special value “default” is equivalent to specifying the value of pygsti.evotypes.Evotype.default_evotype.
 simulatorForwardSimulator or {“auto”, “matrix”, “map”}
The simulator used to compute predicted probabilities for the resulting
Model
. Using “auto” selects “matrix” when there are 2 qubits or less, and otherwise selects “map”. independent_gatesbool, optional
Whether gates are allowed independent noise or not. If False, then all gates with the same name (e.g. “Gx”) will have the same noise (e.g. an overrotation by 1 degree), and the operation_bks[‘cloudnoise’] dictionary will contains a single key per gate name. If True, then gates with the same name acting on different qudits may have different local noise, and so the operation_bks[‘cloudnoise’] dictionary contains a key for each gate available gate placement.
 independent_spambool, optional
Similar to indepenent_gates but for SPAM operations.
 errcomp_type{‘gates’, ‘errorgens’}
Whether errors should be combined by composing error maps (gates) or by exponentiating the sum of error generators (composing the error generators, errorgens). The latter is only an option when the noise is given solely in terms of Lindblad error coefficients.
 implicit_idle_mode{‘none’, ‘add_global’, ‘pad_1Q’}
The way idle operations are added implicitly within the created model. “none” doesn’t add any “extra” idle operations when there is a layer that contains some gates but not gates on all the qudits. “add_global” adds the global idle operation, i.e., the operation for a global idle layer (zero gates  a completely empty layer), to every layer that is simulated, using the global idle as a background idle that always occurs regardless of the operation. “pad_1Q” applies the 1qubit idle gate (if one exists) to all idling qubits within a circuit layer.
 basisBasis or str, optional
The basis to use when constructing operator representations for the elements of the created model.
 verbosityint or VerbosityPrinter, optional
Amount of detail to print to stdout.
Returns
CloudNoiseModel
 pygsti.models.modelconstruction.create_cloud_crosstalk_model_from_hops_and_weights(processor_spec, custom_gates=None, max_idle_weight=1, max_spam_weight=1, maxhops=0, extra_weight_1_hops=0, extra_gate_weight=0, simulator='auto', evotype='default', gate_type='H+S', spam_type='H+S', implicit_idle_mode='none', errcomp_type='gates', independent_gates=True, independent_spam=True, connected_highweight_errors=True, basis='pp', verbosity=0)
Create a “cloud crosstalk” model based on maximum error weights and hops along the processor’s qudit graph.
This function provides a convenient way to construct cloud crosstalk models whose gate errors consist of Pauli elementary error generators (i.e. that correspond to Lindblad error coefficients) that are limited in weight (number of nonidentity Paulis) and support (which qudits have nontrivial Paulis on them). Errors are taken to be approximately local, meaning they are concentrated near the target qudits of a gate, with the notion of locality taken from the processor specification’s qudit graph. The caller provides maximumweight, maximumhop (a “hop” is the movement along a single graph edge), and gate type arguments to specify the set of possible errors on a gate.
The global idle gate (corresponding to an empty circuit layer) has errors that are limited only by a maximum weight, max_idle_weight.
State preparation and POVM errors are constructed similarly, with a globalidlelike error following or preceding the preparation or measurement, respectively.
Gate errors are placed on all the qudits that can be reached with at most maxhops hops from (any of) the gate’s target qudits. Elementary error generators up to weight W, where W equals the number of target qudits (e.g., 2 for a CNOT gate) plus extra_gate_weight are allowed. Weight1 terms are a special case, and the extra_weight_1_hops argument adds to the usual maxhops in this case to allow weight1 errors on a possibly larger region of qudits around the target qudits.
Parameters
 processor_specProcessorSpec
The processor specification to create a model for. This object specifies the gate names and unitaries for the processor, and their availability on the processor.
 custom_gatesdict
A dictionary that associates with gate labels
LinearOperator
,OpFactory
, or numpy.ndarray objects. These objects describe the full action of the gate or primitivelayer they’re labeled by (so if the model represents states by density matrices these objects are superoperators, not unitaries), and override any standard construction based on builtin gate names or nonstd_gate_unitaries. Keys of this dictionary must be stringtype gate names – they cannot include state space labels – and they must be static (have zero parameters) because they represent only the ideal behavior of each gate – the cloudnoise operations represent the parameterized noise. To finetune how this noise is parameterized, call theCloudNoiseModel
constructor directly. max_idle_weightint, optional
The maximumweight for errors on the global idle gate.
 max_spam_weightint, optional
The maximumweight for state preparation and measurement (SPAM) errors.
 maxhopsint
The locality constraint: for a gate, errors (of weight up to the maximum weight for the gate) are allowed to occur on the gate’s target qudits and those reachable by hopping at most maxhops times from a target qudit along nearestneighbor links (defined by the geometry).
 extra_weight_1_hopsint, optional
Additional hops (adds to maxhops) for weight1 errors. A value > 0 can be useful for allowing just weight1 errors (of which there are relatively few) to be dispersed farther from a gate’s target qudits. For example, a crosstalkdetecting model might use this.
 extra_gate_weightint, optional
Addtional weight, beyond the number of target qudits (taken as a “base weight”  i.e. weight 2 for a 2Q gate), allowed for gate errors. If this equals 1, for instance, then 1qudit gates can have up to weight2 errors and 2qudit gates can have up to weight3 errors.
 simulatorForwardSimulator or {“auto”, “matrix”, “map”}
The circuit simulator used to compute any requested probabilities, e.g. from
probs()
orbulk_probs()
. Using “auto” selects “matrix” when there are 2 qudits or less, and otherwise selects “map”. evotypeEvotype 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.
 gate_typestr, optional
The Lindbladerror parameterization type used for gate operations. This may be expanded in the future, but currently the gate errors must be of the Lindblad errorgenerator coefficients type, and this argument specifies what elementary errorgenerator coefficients are initially allowed (and linked to model parameters), before maximumweight and locality constraints are imposed. In addition to the usual Lindblad error types, (e.g. “H”, “H+S”) the special values “none” is allowed to indicate that there should be no errors on the gates (useful if you only want errors on the SPAM, for instance).
 spam_typestr, optional
Similar to gate_type but for SPAM elements (state preparations and POVMs). This specifies the Lindbladerror parameterization for the state prepearation and POVM.
 implicit_idle_mode{‘none’, ‘add_global’, ‘pad_1Q’}
The way idle operations are added implicitly within the created model. “none” doesn’t add any “extra” idle operations when there is a layer that contains some gates but not gates on all the qudits. “add_global” adds the global idle operation, i.e., the operation for a global idle layer (zero gates  a completely empty layer), to every layer that is simulated, using the global idle as a background idle that always occurs regardless of the operation. “pad_1Q” applies the 1qubit idle gate (if one exists) to all idling qubits within a circuit layer.
 errcomp_type{“gates”,”errorgens”}
How errors are composed when creating layer operations in the created model. “gates” means that the errors on multiple gates in a single layer are composed as separate and subsequent processes. Specifically, the layer operation has the form Composed(target,idleErr,cloudErr) where target is a composition of all the ideal gate operations in the layer, idleErr is the global idle error if implicit_idle_mode == ‘add_global’, and cloudErr is the composition (ordered as layerlabel) of cloud noise contributions, i.e. a map that acts as the product of exponentiated errorgenerator matrices. “errorgens” means that layer operations have the form Composed(target, error) where target is as above and error results from composing (summing) the idle and cloudnoise error generators, i.e. a map that acts as the exponentiated sum of error generators (ordering is irrelevant in this case).
 independent_gatesbool, optional
Whether the noise added to a gate when it acts on one set of target qudits is independent of its noise on a different set of target qudits. If False, then all gates with the same name (e.g. “Gx”) will be constrained to having the same noise on the cloud around the target qudits (even though the target qudits and cloud are different). If True, then gate noise operations for different sets of target qudits are independent.
 independent_spambool, optional
Similar to independent_gates but for state preparation and measurement operations. When False, the noise applied to each set (individual or pair or triple etc.) of qudits must be the same, e.g., if the state preparation is a perfect preparation followed by a singlequdit rotation then this rotation must be by the same angle on all of the qudits.
 connected_highweight_errorsbool, optional
An additional constraint regarding highweight errors. When True, only high weight (weight 2+) elementary error generators whose nontrivial Paulis occupy a connected portion of the qudit graph are allowed. For example, if the qudit graph is a 1D chain of 4 qudits, 1234, and weight2 errors are allowed on a singlequdit gate with target = qudit2, then weight2 errors on 12 and 23 would be allowed, but errors on 13 would be forbidden. When False, no constraint is imposed.
 basisBasis or str, optional
The basis to use when constructing operator representations for the elements of the created model.
 verbosityint or VerbosityPrinter, optional
An integer >= 0 dictating how must output to send to stdout.
Returns
CloudNoiseModel