Summary: Neither of your two approaches is in accordance with a correct application of a $\pi/2$-pulse. The first matrix contains a fabricated phase shift, the second one is obtained by a basis change which can't simply be applied twice.
Some introductory remarks
- A $\pi/2$-pulse represents a 90°-rotation of the Bloch vector on the Bloch sphere around some axis. Around which axis depends on the form of the interaction Hamiltonian, which should be of the form $V \simeq \Omega_x\sigma_x + \Omega_y \sigma_y $, from which you derive the unitary transformation above by changing into a suitable interaction picture etc.. It is this unitary that should be used.
- Furthermore, having a $\pi/2$-pulse puts certain restrictions on the length of the pulse, i.e. you get a certain condition on the length of the pulse, which is $\Omega t = \pi$ if I'm not mistaken. So when you write $U_{"\pi/2"}$, you should have eliminated already all $\Omega$'s and $t$'s there, leaving you with something like
$$ U_{"\pi/2"} = \frac{1}{\sqrt 2} \begin{pmatrix}1&1\\-\mathrm i&\mathrm i\end{pmatrix},$$
and some expression accordingly for $U_{"\pi/2"}'$. (I will later show why $U_{"\pi/2"}$ is not a $\pi/2$ pulse, therefore the $"\pi/2"$ in it.)
Non-equivalence of the two matrices
What you do here is to decompose the unitary into $U'_{"\pi/2"}$ and a second unitary matrix of the form
$$ U_b = \begin{pmatrix}1&0\\0&\mathrm i\end{pmatrix},$$
which also corresponds to a basis change of your state vector. This is equivalent to introduce a phase between the two basis states, or to rotate the basis of the Bloch sphere accordingly. However, if you apply two pulses $U_{"\pi/2"}$ in row,
$$U_{"\pi/2"} U_{"\pi/2"} = U_{"\pi/2"}' U_b U_{"\pi/2"}' U_b$$
you see that this is inequivalent to two consequential applications of $U_{"\pi/2"}'$ obviously.
Why your $U_{"\pi/2"}$ is not a $\pi/2$-pulse
Coming back to the question why $U_{"\pi/2"}$ applied twice does not give a $\pi$-rotation. This is easy to see now by just multiplying it with itself, yielding a matrix with all entries equal in modulus $(\simeq \pm 1 \pm \mathrm i)$. However, multiplying $U_{"\pi/2"}'$ with itself gives the desired $\pi$-pulse, which requires to have only entries in the off-diagonal.
So what, then, is $U_{"\pi/2"}$ really doing? It is bringing your state vector into a superposition state when starting from one of the two basis states. But besides a rotation round an axis in the equatorial plane it introduces a phase, which is equivalent to a rotation around the $z$-axis. Thus, your $U_{"\pi/2"}$ is a combination of a $\pi/2$-pulse around, say, the $x$-axis with a rotation around the $z$-axis. A second rotation around the $x$-axis then has a different effect (here, if I see it correct, it does nothing, because the vector is just parallel to the rotation axis), and the further phase (=rotation around the $z$-axis) leads to a final state, which is still in the equatorial plane of the Bloch sphere.
Physically, this situation is similar to that of the frequency of the radiation field being not resonant with the transition frequency of the two-level system. Then, the transformation in the interaction picture does not remove the term $\sim \sigma_z$ of the two-level system Hamiltonian, so that these terms show up in the unitary, yielding a phase shift which is proportional to $\sim \Delta t$, where $\Delta$ is the detuning between the radiation frequency and the transition frequency. However, as the other answer pointed out, the limit of $t=0$ yields some instantaneous phase shift.
As I pointed out in the comment below, this is not unphysical per se, but can accommodate a phase shift between two pulses that is, for instance, imposed by shift of the phase of the radiation field,
which can't be described by a Hamiltonian anyway. A inclusion of such a phase shift may seem unphysical for not yielding the identity transformation for $t \rightarrow 0$, but it can't be described by a Schrödinger equation anyway but should be considered as a kind of external condition.
The input coherent state is : $$|\alpha\rangle\otimes|\beta\rangle = \exp\left(-\frac{|\alpha|^2+|\beta|}{2}\right)\exp\left(\alpha \hat a_i^\dagger + \beta \hat b_i^\dagger\right)|0\rangle$$
Then, since $\hat T$ is unitary and $\hat T^\dagger|0\rangle=|0 \rangle $ we have :
\begin{align}
\hat T|\alpha\rangle\otimes|\beta\rangle &= \exp\left(-\frac{|\alpha|^2+|\beta|}{2}\right) \exp\left(\hat T\left(\alpha \hat a_i^\dagger + \beta \hat b_i^\dagger\right)\hat T^\dagger\right)|0\rangle \\
&=\exp\left(-\frac{|\alpha|^2+|\beta|}{2}\right) \exp\left(\alpha \hat a_o^\dagger + \beta \hat b_o^\dagger\right)|0\rangle \\
&=\exp\left(-\frac{|\alpha|^2+|\beta|}{2}\right) \exp\left( (\alpha\cos(\theta)-i\beta\sin(\theta))\hat a_i^\dagger + (\beta\cos(\theta) - i\alpha\sin(\theta)) \hat b_i^\dagger\right)|0\rangle \\
&=|\alpha\cos(\theta)-i\beta\sin(\theta)\rangle\otimes|\beta\cos(\theta) - i\alpha\sin(\theta) \rangle
\end{align}
Best Answer
In general, you apply $r\pi$ pulses by turning on an interaction hamiltonian $H_I$, which couples both states, for long enough (or with a strong enough coupling) to achieve the desired effect.
This builds on the standard representation for the propagator operator under that hamiltonian for a time difference $\Delta t$, which reads $U(\Delta t)=\exp(-i H_I\Delta t/\hbar)$, and which is obviously parallel to the expression $U=e^{-ir\pi X/2}$ you quote. In particular, we use pulses of radiation (lasers or microwaves or whatever is convenient) because they have the hamiltonian $$\hat H_I=\mathbf E\cdot e\hat{\mathbf r},$$ in the dipole approximation and in the length gauge (and, also, applying the rotating-wave approximation), with $\mathbf E$ the electric field strength and $e\hat{\mathbf r}$ the atomic electric dipole operator. Typically, both eigenstates $\left|\mathrm{red}\right\rangle$ and $\left|\mathrm{blue}\right\rangle$ will have zero intrinsic dipole moment, which means that only the off-diagonal elements of $H_I$ are nonzero, and it is therefore of the form $$\hat H_I=F\hat X=F\begin{pmatrix}0&1\\1&0\end{pmatrix}.$$
(Note that I'm setting the off-diagonal elements to be real, which I can do (once) by shifting the phase of the basis states. This is what fixes the axis of the $r\pi$ pulse rotation as the $X$ axis, and it can be changed by changing the phase of the laser (which introduces opposite complex phases on the off-diagonal elements, and moves the rotation axis along the $xy$ plane of the Bloch sphere).)
Given the hamiltonian above, you just simply let it run for a set time $\Delta t$, and it gives you a unitary operator $$ e^{-iF\Delta t X/\hbar} = e^{-ir\pi X/2}, $$ which represents an $r\pi$ pulse with rotation amount $$ r\pi = \frac{2}{\hbar} F\,\Delta t. $$ To tune this rotation amount, you can change $\Delta t$ (run the pulse for longer) or $F$ (use a stronger pulse), and depending on experimental conditions you might choose either of them.