pygsti.tools.lindbladtools.random_CPTP_error_generator_rates

pygsti.tools.lindbladtools.random_CPTP_error_generator_rates#

random_CPTP_error_generator_rates(num_qubits, errorgen_types=('H', 'S', 'C', 'A'), max_weights=None, H_params=(0.0, 0.01), SCA_params=(0.0, 0.01), error_metric=None, error_metric_value=None, relative_HS_contribution=None, fixed_errorgen_rates=None, sslbl_overlap=None, label_type='global', seed=None, qubit_labels=None)#

Function for generating a random set of CPTP error generator rates.

Parameters:
  • num_qubits (int) – Number of qubits the error generator acts upon.

  • errorgen_types (tuple of str, optional (default('H', 'S', 'C', 'A'))) – Tuple of strings designating elementary error generator types to include in this basis. Note that due to the CP constraint, certain values are not allowed, and any tuple containing ‘C’ or ‘A’ terms must also include ‘S’.

  • max_weights (dict, optional (default None)) – An optional dictionary specifying the maximum weight for each of the elementary error generator types, with keys given by the strings ‘H’, ‘S’, ‘C’ and ‘A’. If None then there is no maximum weight. If specified, any error generator types without entries will have no maximum weight associated with them.

  • H_params (tuple of floats, optional (default (0.,.01))) – Mean and standard deviation parameters for a normal distribution from which the H rates will be sampled. Note that specifying a non-zero value for the mean with generator_infidelity set to a non-trivial value is not supported, and will raise an error.

  • SCA_params (tuple of floats, optional (default (0.,.01))) – Mean and standard deviation parameters for a normal distribution from which the entries of the matrix used in the construction of the S, C and A rates will be construction is sampled. Note that specifying a non-zero value for the mean with generator_infidelity set to a non-trivial value is not supported, and will raise an error.

  • error_metric (str, optional (default None)) –

    An optional string, used in conjunction with the error_metric_value kwarg which specifies which metric to use in setting the sampled channel’s overall error rate. If None, no target value for the channel’s overall error rate is used. Currently supported options include:

    • ’generator_infidelity’

    • ’total_generator_error’

  • error_metric_value (float, optional (default None)) – An float between 0 and 1 which gives the target value of the error metric specified in ‘error_metric’ for the channel induced by the randomly produced error generator. If None then no target value is used and the returned error generator will have a random generator infidelity.

  • relative_HS_contribution (tuple, optional (default None)) – An optional tuple, used in conjunction with the generator_infidelity kwarg, specifying the relative contributions of the H and S error generators to the generator infidelity. The values in this tuple should sum to 1. The first entry corresponds to the H sector, and the second the S sector.

  • sslbl_overlap (list of sslbls, optional (default None)) – A list of state space labels corresponding to qudits the support of an error generator must overlap with (i.e. the support must include at least one of these qudits) in order to be included in this basis.

  • fixed_errorgen_rates (dict, optional (default None)) – An optional dictionary whose keys are LocalElementaryErrorgenLabel objects, and whose values are error generator rates. When specified, the rates in this dictionary will override any randomly selected values in the final returned error generator rate dictionary. The inclusion of these rates is performed independently of any of the kwargs which otherwise control the weight and allowed types of the error generators in this model. If specifying fixed C and A rates it is possible for the final error generator to be non-CP.

  • label_type (str, optional (default 'global')) – String which can be either ‘global’ or ‘local’, indicating whether to return a dictionary with keys which are GlobalElementaryErrorgenLabel or LocalElementaryErrorgenLabel objects respectively.

  • seed (int, optional (default None)) – An optional integer used in seeding the RNG.

  • qubit_labels (list or int or str, optional (default None)) – An optional list of qubit labels upon which the error generator should act. Only utilized when returning global labels.

Return type:

Dictionary of error generator coefficient labels and rates