def run_sweep(
        self, program: cirq.AbstractCircuit, params: cirq.Sweepable, repetitions: int = 1
    ) -> Sequence[cirq.Result]:
        """Samples from the given Circuit.

        This allows for sweeping over different parameter values,
        unlike the `run` method.  The `params` argument will provide a
        mapping from `sympy.Symbol`s used within the circuit to a set of
        values.  Unlike the `run` method, which specifies a single
        mapping from symbol to value, this method allows a "sweep" of
        values.  This allows a user to specify execution of a family of
        related circuits efficiently.

        Note that this creates jobs for each of the sweeps in the given sweepable, and then
        blocks until all of the jobs are complete.

        Args:
            program: The circuit to sample from.
            params: Parameters to run with the program.
            repetitions: The number of times to sample.

        Returns:
            Either a list of `cirq_ionq.QPUResult` or a list of `cirq_ionq.SimulatorResult`
            depending on whether the job was running on an actual quantum processor or a simulator.
        """
        resolvers = [r for r in cirq.to_resolvers(params)]
        jobs = [
            self._service.create_job(
                circuit=cirq.resolve_parameters(program, resolver),
                repetitions=repetitions,
                target=self._target,
            )
            for resolver in resolvers
        ]
        if self._timeout_seconds is not None:
            job_results = [job.results(timeout_seconds=self._timeout_seconds) for job in jobs]
        else:
            job_results = [job.results() for job in jobs]
        flattened_job_results = list(itertools.chain.from_iterable(job_results))
        cirq_results = []
        for result, params in zip(flattened_job_results, resolvers):
            if isinstance(result, results.QPUResult):
                cirq_results.append(result.to_cirq_result(params=params))
            elif isinstance(result, results.SimulatorResult):
                cirq_results.append(result.to_cirq_result(params=params, seed=self._seed))
        return cirq_results
Samples from the given Circuit.

        This allows for sweeping over different parameter values,
        unlike the `run` method.  The `params` argument will provide a
        mapping from `sympy.Symbol`s used within the circuit to a set of
        values.  Unlike the `run` method, which specifies a single
        mapping from symbol to value, this method allows a "sweep" of
        values.  This allows a user to specify execution of a family of
        related circuits efficiently.

        Note that this creates jobs for each of the sweeps in the given sweepable, and then
        blocks until all of the jobs are complete.

        Args:
            program: The circuit to sample from.
            params: Parameters to run with the program.
            repetitions: The number of times to sample.

        Returns:
            Either a list of `cirq_ionq.QPUResult` or a list of `cirq_ionq.SimulatorResult`
            depending on whether the job was running on an actual quantum processor or a simulator.
        
cirq-ionq/cirq_ionq/sampler.py