qulacsvis.utils.gate module
- qulacsvis.utils.gate.grouping_adjacent_gates(target_bits: List[int]) List[List[int]] [source]
Grouping adjacent gates.
- Parameters
target_bit (List[int]) – The target bit list.
- Returns
The grouped target bit list.
- Return type
List[List[int]]
Examples
>>> target_bits = [1, 2, 3, 5, 7, 8] >>> print(grouping_adjacent_gates(target_bits)) >>> [[1, 2, 3], [5], [7, 8]]