Computes SamplesDisplays in the supplied Circuit or Schedule.

        In contrast to `compute_displays`, this allows for sweeping
        over different parameter values.

        Args:
            program: The circuit or schedule to simulate.
            params: Parameters to run with the program.

        Returns:
            List of ComputeDisplaysResults for this run, one for each
            possible parameter resolver.

def compute_samples_displays_sweep(
            self,
            program: Union[circuits.Circuit, schedules.Schedule],
            params: Optional[study.Sweepable] = None
    ) -> List[study.ComputeDisplaysResult]:
        """Computes SamplesDisplays in the supplied Circuit or Schedule.

        In contrast to `compute_displays`, this allows for sweeping
        over different parameter values.

        Args:
            program: The circuit or schedule to simulate.
            params: Parameters to run with the program.

        Returns:
            List of ComputeDisplaysResults for this run, one for each
            possible parameter resolver.
        """
        circuit = (program if isinstance(program, circuits.Circuit)
                   else program.to_circuit())
        param_resolvers = study.to_resolvers(params or study.ParamResolver({}))

        compute_displays_results = []  # type: List[study.ComputeDisplaysResult]
        for param_resolver in param_resolvers:
            display_values = {}  # type: Dict[Hashable, Any]
            preceding_circuit = circuits.Circuit()
            for i, moment in enumerate(circuit):
                displays = (op for op in moment
                            if isinstance(op, ops.SamplesDisplay))
                for display in displays:
                    measurement_key = str(display.key)
                    measurement_circuit = circuits.Circuit.from_ops(
                        display.measurement_basis_change(),
                        ops.measure(*display.qubits,
                                    key=measurement_key)
                    )
                    measurements = self._run(
                        preceding_circuit + measurement_circuit,
                        param_resolver,
                        display.num_samples)
                    display_values[display.key] = (
                        display.value_derived_from_samples(
                            measurements[measurement_key]))
                preceding_circuit.append(circuit[i])
            compute_displays_results.append(study.ComputeDisplaysResult(
                params=param_resolver,
                display_values=display_values))

        return compute_displays_results