def ustr(i, state):
    """
    Remove electron at orbital i in state.

    Parameters
    ----------
    i : int
        Spin-orbital index
    state : str
        Product state.

    Returns
    -------
    state_new : str
        Product state
    amp : int
        Amplitude. 0, -1 or 1.

    """
    if state[i] == "0":
        return "", 0
    elif state[i] == "1":
        state_new = state[:i] + "0" + state[i+1:]
        amp = 1 if state[:i].count("1") % 2 == 0 else -1
        return state_new, amp
    else:
        raise Exception("String representation of state is wrong.")