Formal math notation of masked vector
Check out the indicator function $1_S(\cdot)$. In your case it would be fined as

$$1_S: \{1, \ldots, d\} \rightarrow \{0, 1\}, j \mapsto \begin{cases}
1 &amp; j \in S \\
0 &amp; \, \text{else}
\end{cases}.$$

Multiplying this function with the respective values should give you what you are looking for.

Edit: If I understand your comment correctly, the vector you are looking for is

$$ \alpha_s = \sum\limits_{i = 1}^{d} \alpha_i e_i 1_{S^C}(i). $$

Here $e_i$ denotes the i-th unit vector of $\mathbb{R}^d$, $S^C$ is the complement $\{1, \ldots, d\} \setminus S$ in $\{1, \ldots, d\}$ and $1_{S^C}$ is the indicator function that is $1$ for $i \notin S$ and $0$ for $i \in S$.