def str2vec (s):
    """Converts the binary string of '0' and '1' characters to a vector.

    An element of the resulting vector is `-1` if the binary string
    contains a `'0'` at the corresponding bit position, otherwise the
    element is `1`.
    """
    return [ -1 if c == '0' else 1 for c in s.strip() ]