raise TypeError("Entangle index list expected but got {}".format(type(v)))
ret_map = {}
for k, v in entangler_map.items():
ret_map[int(k)] = [int(x) for x in v]
for k, v in ret_map.items():
if k < 0 or k >= num_qubits:
raise ValueError("Qubit value {} invalid for {} qubits".format(k, num_qubits))
for i in v:
After Change
raise TypeError("Entangle index list expected but got {}".format(type(src_to_targ)))
ret_map = []
ret_map = [[int(src), int(targ)] for src, targ in entangler_map]
for src, targ in ret_map:
if src < 0 or src >= num_qubits:
raise ValueError("Qubit entangle source value {} invalid for {} qubits".format(src, num_qubits))