def parallel_single_qubit_randomized_benchmarking(
    sampler: cirq.Sampler,
    qubits: Sequence[cirq.Qid],
    use_xy_basis: bool = True,
    *,
    num_clifford_range: Sequence[int] = tuple(
        np.logspace(np.log10(5), np.log10(1000), 5, dtype=int)
    ),
    num_circuits: int = 10,
    repetitions: int = 1000,
) -> ParallelRandomizedBenchmarkingResult:
    """Clifford-based randomized benchmarking (RB) single qubits in parallel.

    This is the same as `single_qubit_randomized_benchmarking` except on all
    of the specified qubits in parallel, i.e. with the individual randomized
    benchmarking circuits zipped together.

    Args:
        sampler: The quantum engine or simulator to run the circuits.
        use_xy_basis: Determines if the Clifford gates are built with x and y
            rotations (True) or x and z rotations (False).
        qubits: The qubits to benchmark.
        num_clifford_range: The different numbers of Cliffords in the RB study.
        num_circuits: The number of random circuits generated for each
            number of Cliffords.
        repetitions: The number of repetitions of each circuit.

    Returns:
        A dictionary from qubits to RandomizedBenchMarkResult objects.
    """

    clifford_group = _single_qubit_cliffords()
    c1 = clifford_group.c1_in_xy if use_xy_basis else clifford_group.c1_in_xz

    # create circuits
    circuits_all: list[cirq.AbstractCircuit] = []
    for num_cliffords in num_clifford_range:
        for _ in range(num_circuits):
            circuits_all.append(_create_parallel_rb_circuit(qubits, num_cliffords, c1))

    # run circuits
    results = sampler.run_batch(circuits_all, repetitions=repetitions)
    gnd_probs: dict = {q: [] for q in qubits}
    idx = 0
    for num_cliffords in num_clifford_range:
        excited_probs: dict[cirq.Qid, list[float]] = {q: [] for q in qubits}
        for _ in range(num_circuits):
            result = results[idx][0]
            for qubit in qubits:
                excited_probs[qubit].append(np.mean(result.measurements[str(qubit)]))
            idx += 1
        for qubit in qubits:
            gnd_probs[qubit].append(1.0 - np.mean(excited_probs[qubit]))
    return ParallelRandomizedBenchmarkingResult(
        {q: RandomizedBenchMarkResult(num_clifford_range, gnd_probs[q]) for q in qubits}
    )
Clifford-based randomized benchmarking (RB) single qubits in parallel.

    This is the same as `single_qubit_randomized_benchmarking` except on all
    of the specified qubits in parallel, i.e. with the individual randomized
    benchmarking circuits zipped together.

    Args:
        sampler: The quantum engine or simulator to run the circuits.
        use_xy_basis: Determines if the Clifford gates are built with x and y
            rotations (True) or x and z rotations (False).
        qubits: The qubits to benchmark.
        num_clifford_range: The different numbers of Cliffords in the RB study.
        num_circuits: The number of random circuits generated for each
            number of Cliffords.
        repetitions: The number of repetitions of each circuit.

    Returns:
        A dictionary from qubits to RandomizedBenchMarkResult objects.
    
cirq-core/cirq/experiments/qubit_characterizations.py