def METHOD_NAME(
    self,
    circuits: Sequence[QuantumCircuit],
    parameter_values: Sequence[Sequence[float]],
    parameters: Sequence[Sequence[Parameter]],
    **options,
) -> SamplerGradientResult:
    """Compute the sampler gradients on the given circuits."""
    job_circuits, job_param_values, metadata = [], [], []
    all_n = []
    for circuit, parameter_values_, parameters_ in zip(circuits, parameter_values, parameters):
        # Prepare circuits for the gradient of the specified parameters.
        metadata.append({"parameters": parameters_})
        circuit_key = _circuit_key(circuit)
        if circuit_key not in self._lin_comb_cache:
            # Cache the circuits for the linear combination of unitaries.
            # We only cache the circuits for the specified parameters in the future.
            self._lin_comb_cache[circuit_key] = _make_lin_comb_gradient_circuit(
                circuit, add_measurement=True
            )
        lin_comb_circuits = self._lin_comb_cache[circuit_key]
        gradient_circuits = []
        for param in parameters_:
            gradient_circuits.append(lin_comb_circuits[param])
        # Combine inputs into a single job to reduce overhead.
        n = len(gradient_circuits)
        job_circuits.extend(gradient_circuits)
        job_param_values.extend([parameter_values_] * n)
        all_n.append(n)
    # Run the single job with all circuits.
    job = self._sampler.run(job_circuits, job_param_values, **options)
    try:
        results = job.result()
    except Exception as exc:
        raise AlgorithmError("Sampler job failed.") from exc
    # Compute the gradients.
    gradients = []
    partial_sum_n = 0
    for i, n in enumerate(all_n):
        gradient = []
        result = results.quasi_dists[partial_sum_n : partial_sum_n + n]
        m = 2 ** circuits[i].num_qubits
        for dist in result:
            grad_dist: dict[int, float] = defaultdict(float)
            for key, value in dist.items():
                if key < m:
                    grad_dist[key] += value
                else:
                    grad_dist[key - m] -= value
            gradient.append(dict(grad_dist))
        gradients.append(gradient)
        partial_sum_n += n
    opt = self._get_local_options(options)
    return SamplerGradientResult(gradients=gradients, metadata=metadata, options=opt)