def test_readout_on_reassigned_qubits(
    circuit_data: tuple[cirq.Circuit, list[cirq.LineQubit], cirq.Linspace],
) -> None:
    """test that RigettiQCSSampler can properly readout qubits after quilc has
    reassigned those qubits in the compiled native Quil.
    """
    qc = get_qc('9q-square', as_qvm=True)
    circuit, qubits, sweepable = circuit_data

    transformer = circuit_transformers.build(qubit_id_map={qubits[0]: '100', qubits[1]: '101'})
    sampler = RigettiQCSSampler(quantum_computer=qc, transformer=transformer)

    # set the seed so we get a deterministic set of results.
    qvm = cast(QVM, qc.qam)
    qvm.random_seed = 11

    repetitions = 10

    results = sampler.run_sweep(program=circuit, params=sweepable, repetitions=repetitions)
    assert len(sweepable) == len(results)

    for i, result in enumerate(results):
        assert isinstance(result, cirq.study.Result)
        assert sweepable[i] == result.params

        assert 'm' in result.measurements
        assert (repetitions, 2) == result.measurements['m'].shape

        counter = result.histogram(key='m')
        assert 2 == len(counter)
        assert 3 == counter.get(0)
        assert 7 == counter.get(2)
test that RigettiQCSSampler can properly readout qubits after quilc has
    reassigned those qubits in the compiled native Quil.
    
cirq-rigetti/cirq_rigetti/sampler_readout_reassigned_qubits_test.py