def nn(L, i, j): oplist_base = [np.identity(2) for _ in range(L)] oplist_base[i], oplist_base[j] = n(), n() op = constr_op(oplist_base) return op
def n_op(L, i): oplist_base = [np.identity(2) for _ in range(L)] oplist_base[i] = n() op = constr_op(oplist_base) return op
def xx(L, i, j): oplist_base = [np.identity(2) for _ in range(L)] oplist_base[i], oplist_base[j] = sigmax(), sigmax() op = constr_op(oplist_base) return op