# Summation of amplitudes [duplicate]

I was wondering how to create generalized entangled superpositions of qubits when I came to need of an algorithm to generate the following:

Suppose we have two $$n$$ qubit states, $$|\psi\rangle = \sum_X \alpha_X\ |X\rangle$$ and, $$|\phi\rangle = \sum_X \beta_X\ |X\rangle.$$

How do I come up with a state, $$|\psi'\rangle = \frac1{\sqrt N}\sum_X (\alpha_X+\beta_X)\ |X\rangle,$$ where $$N$$ is the normalization factor?