pygsti.models.modelconstruction.create_crosstalk_free_model

pygsti.models.modelconstruction.create_crosstalk_free_model#

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 n-qudit “crosstalk-free” model.

By virtue of being crosstalk-free, 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_spec (ProcessorSpec) – 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_gates (dict, 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 string-type gate names or labels that include target qudits.

  • depolarization_strengths (dict, 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_probs (dict, optional) – A dictionary whose keys are gate names (e.g. “Gx”) and whose values are tuples that specify Pauli-stochastic rates for each of the non-trivial Paulis (so a 3-tuple would be expected for a 1Q gate and a 15-tuple for a 2Q gate).

  • lindblad_error_coeffs (dict, 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 2-tuple) 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 “off-diagonal” non-Hamiltonian Lindblad terms. Basis labels can be strings or integers. Values are complex coefficients.

  • depolarization_parameterization (str 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_parameterization (str 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.

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

  • simulator (ForwardSimulator or {"auto", "matrix", "map"}) – The simulator used to compute predicted probabilities for the resulting Model. Using “auto” currently 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_gates (bool, 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_gates (bool, 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_type (str 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_type (str 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 1-qubit idle gate (if one exists) to all idling qubits within a circuit layer.

  • basis (Basis or str, optional) – The basis to use when constructing operator representations for the elements of the created model.

Returns:

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).

Return type:

LocalNoiseModel