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]]
qulacsvis.utils.gate.to_latex_style(gate_name: str) str[source]

Get string for latex from gate name.

Parameters

gate_name (str) – Gate name.

Returns

string for LaTex.

Return type

str

Raises

KeyError – If gate name is not found.

qulacsvis.utils.gate.to_text_style(gate_name: str) str[source]