def sigma_z(state, site):
    """
    Returns `(sign, state)` where `sign` is 1 or -1 if the `site`th bit of the int `state`
    is 0 or 1 respectively. Can also accept numpy arrays of ints and gives numpy arrays back
    """
    return (-1.0) ** ((state >> site) & 1), state