Quantum Computing, Quantum Physics, Programming, Physics, Science.
range(len(arr)): if arr[idx] != 'I': new_arr.append(arr[idx]) new_qub.append(qubits[idx]) h_y = 1 / np.sqrt(2) * np.array([[1, -1j], [1j, -1]]) for i in range(len(new_arr)): if new_arr[i] == 'X': qc.h(new_qub[i]) elif new_arr[i] == 'Y': qc.unitary(h_y, [new_qub[i]], r'$H_y$') sim_z(t, qc, new_qub)