code: def _decode_config(c, num_variables):
      
      def bits(c):
          n = 1 << (num_variables - 1)
          for __ in range(num_variables):
              yield 1 if c & n else -1
              n >>= 1
      return tuple(bits(c))
docs: inverse of _serialize_config, always converts to spin.