def support(pauli: str):
    """Returns indices where the Pauli string is non-identity."""
    has_support = lambda c: c != "I"
    inds = []
    for (i, p) in enumerate(pauli):
        if has_support(p):
            inds.append(i)
    return inds