Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def generate_circuits(self, lengths: Union[List[int], Tuple[int]], num_seq: int) -> Dict:
"""Generate sequences of gates for a full set of Clifford randomized benchmarking experirments.
Args:
lengths: Clifford lengths of the sequences to generate
num_seq: number of different sequences to generate for each length
Returns:
a dictionary containing: key = clifford length, value = list of random circuits of that length.
"""
exp_dict = rb.sample.clifford_rb_experiment(self._chip_spec, lengths, num_seq,
subsetQs=self._qubit_labels, randomizeout=False)
circuits = exp_dict['circuits']
circuits_dict = {m: [circuits[m, i] for i in range(num_seq)] for m in lengths}
return circuits_dict