cirq.sample_sweep

cirq.sample_sweep(program: cirq.Circuit, params: Union[Dict[str, float], cirq.study.resolver.ParamResolver, cirq.study.sweeps.Sweep, Iterable[Union[Dict[str, float], cirq.study.resolver.ParamResolver, cirq.study.sweeps.Sweep]], None], *, noise: cirq.NOISE_MODEL_LIKE = None, repetitions: int = 1, dtype: Type[numpy.number] = <class 'numpy.complex64'>, seed: cirq.RANDOM_STATE_OR_SEED_LIKE = None) → List[cirq.study.trial_result.TrialResult][source]

Runs the supplied Circuit, mimicking quantum hardware.

In contrast to run, this allows for sweeping over different parameter
values.
Parameters
  • program – The circuit to simulate.

  • params – Parameters to run with the program.

  • noise – Noise model to use while running the simulation.

  • repetitions – The number of repetitions to simulate, per set of parameter values.

  • dtype – The numpy.dtype used by the simulation. Typically one of numpy.complex64 or numpy.complex128. Favors speed over precision by default, i.e. uses numpy.complex64.

  • seed – The random seed to use for this simulator.

Returns

TrialResult list for this run; one for each possible parameter resolver.