:py:mod:`pygsti.forwardsims.weakforwardsim` =========================================== .. py:module:: pygsti.forwardsims.weakforwardsim .. autoapi-nested-parse:: Defines the WeakForwardSimulator calculator class Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: pygsti.forwardsims.weakforwardsim.WeakForwardSimulator .. py:class:: WeakForwardSimulator(shots, model=None, base_seed=None) Bases: :py:obj:`pygsti.forwardsims.forwardsim.ForwardSimulator` A calculator of circuit outcome probabilities from a "weak" forward simulator (i.e. probabilites taken as average frequencies over a number of "shots"). Due to their ability to only sample outcome probabilities, WeakForwardSimulators rely heavily on implementing the _compute_sparse_circuit_outcome_probabilities function of ForwardSimulators. Construct a new WeakForwardSimulator object. Parameters ---------- shots: int Number of times to run each circuit to obtain an approximate probability model : Model Optional parent Model to be stored with the Simulator base_seed: int, optional Base seed for RNG of probabilitic operations during circuit simulation. Incremented for every shot such that deterministic seeding behavior can be carried out with both serial or MPI execution. If not provided, falls back to using time.time() to get a valid seed. .. py:attribute:: shots .. py:attribute:: base_seed :value: 'None' .. py:method:: bulk_probs(circuits, clip_to=None, resource_alloc=None, smartc=None) Construct a dictionary containing the probabilities for an entire list of circuits. Parameters ---------- circuits : list of Circuits The list of circuits. May also be a :class:`CircuitOutcomeProbabilityArrayLayout` object containing pre-computed quantities that make this function run faster. clip_to : 2-tuple, optional (min,max) to clip return value if not None. resource_alloc : ResourceAllocation, optional A resource allocation object describing the available resources and a strategy for partitioning them. smartc : SmartCache, optional A cache object to cache & use previously cached values inside this function. Returns ------- probs : dictionary A dictionary such that `probs[circuit]` is an ordered dictionary of outcome probabilities whose keys are outcome labels.