Atom in superposition: is it an atom-photon system, and what is the role of the environment? Let's assume an atom would get from its ground state $|g\rangle$ to its first excited state $|e\rangle$ by absorbing a single photon.
Now, let's assume the atom gets from $|g\rangle$ to $\frac{1}{\sqrt{2}}\left(|g\rangle+|e\rangle\right)$. Does this mean that it had to "steal" 1 photon from the environment? So the superposition state is really an atom-photon system, where the two basis states are:

*

*Atom in $|g\rangle$ with a "free" photon.

*Atom in $|e\rangle$, photon absorbed.

Or can the atom get from $|g\rangle$ to $\frac{1}{\sqrt{2}}\left(|g\rangle+|e\rangle\right)$ just by itself, without the "help" of its environment? I guess that would violate the law of conservation of energy.
(Philosophical sidenote: what I find confusing is that when the atom absorbs/emits a photon, it is still considered the same atom afterwards. On the other hand, I have no problem with accepting that when an atom changes its position, it remains the same atom.)
 A: In most quantum mechanical settings there is a clear separation between the system of interest (say a particle or molecule with some kind of internal structure) and a sort of classical or semi-classical background on which the wave mechanics plays out.  Given a system that is somehow prepared in an initial (coherent) state $\psi$, say with quantum numbers $s, t, x$, etc.,  the starting premise is often that the system evolves unitarily.  This premise is nontrivial, however.
More generally, the state of a quantum system is described by a density matrix, $\hat \rho$, which allows the possibility that the system is entangled with unobserved (or even undiscovered) degrees of freedom that also exhibit quantum correlations.
In this context, the density matrix of a system $A$ is thought of by positing the existence of a sort of dual system $B$ that sort of completes system $A$, in the sense that the joint system $AB$ is described perfectly by a pure wave function $\psi_{AB}$ and undergoes unitary dynamics according to some joint Hamiltonian, $H_{AB}$. Given $\psi_{AB}$ and $H_{AB}$, one first introduces a sort of trivial density matrix $\hat\rho_{AB}$ for the $AB$ system, defined as the outer product of $\psi_{AB}$ with its hermitian conjugate, $\psi_{AB}^*$: you can think of it as a projection from the Hilbert space of the $AB$ system onto the one-dimensional span of $\psi_{AB}$. Next, one evaluates the partial trace of $\hat\rho_{AB}$ by summing over the quantum numbers of the $B$ system.  The result is an object $\hat\rho_A$ that describes the statistics of measuring the $A$ system following an (unknown or forgotten) measurement of the $B$ system.
In the system that you describe, it sounds as though the photon (or electromagnetic field) in question might not be an entirely classical coordinate.  Hence, in order to actually describe the full quantum state, it might be necessary to include an additional quantum number to the state space describing the state of the photon: whether it is absorbed (i.e. 'null') or emitted ('observable'), and perhaps an 'energy' or harmonic index associated with it (unless this is known implicitly: it is analogous in some ways to the pitch of a musical note.)  If you prepared the system/photon ensemble in the completely absorbed state, and allowed it to undergo unitary time evolution according to some appropriate Hamiltonian, you might see the system periodically or quasi-periodically emit and reabsorb the photon (i.e. undergo the transition you describe.)  You might also "observe" the $|g\rangle\rightarrow \frac{1}{\sqrt 2}(|g\rangle + |e\rangle)$ transition (in a somewhat philosophically convoluted sense) by somehow measuring the state of the photon and triggering a kind of partial wave function collapse of the system, and happening to fall into the $\frac{1}{\sqrt 2}(|g\rangle + |e\rangle)$ branch of reality, or by observing the system in its $|g\rangle$ state at one moment and later somehow choosing a new measurement basis (perhaps via clever interferometry) so that the system's new post-measurement states are $\frac{1}{\sqrt 2}(|g\rangle \pm |e\rangle)$.
Note that it is also possible to produce the transition you describe with a classical electromagnetic/photon field, which would simply add a perturbation to the Hamiltonian of the system by itself (without any auxiliary variables or photons.) However, one could not reproduce the full set of quantum mechanically achievable and potentially desirable dynamics of the system plus photon with the system alone.
A: One possible model to describe what you want is the Jaynes-Cumming interaction. It describes the interaction of a two level system (your atom) with a single electromagnetic mode.
I assume the field and atom are resonant so that the total Hamiltonian is written in the Schrodingër picture:
$$H=-\frac{\hbar \omega}{2} \sigma_z + \hbar \omega a^{\dagger} a + \frac{\hbar \Omega_0}{2}\left( a \sigma_+ + a^{\dagger} \sigma_- \right)$$
But I will consider working in the interaction picture with respect to $-\frac{\hbar \omega}{2} \sigma_z + \hbar \omega a^{\dagger} a$ to make discussion easier, in this case the Hamiltonian is more simply:
$$H_{JC}=\frac{\hbar \Omega_0}{2}\left( a \sigma_+ + a^{\dagger} \sigma_- \right)$$
Where the operator $a$ is the annihilation operator which destoys one photon in the field:
$$a|n\rangle = \sqrt{n} |n-1 \rangle$$
And $a^{\dagger}$ creates an excitation:
$$a^{\dagger}|n\rangle = \sqrt{n+1} |n+1 \rangle$$
From now on I will assume this Hamiltonian $H_{J.C}$ to describe the dynamic. When you go into interaction picture it is equivalent to reason in the lab in a rotating frame, so you can see it as a change a frame.
Knowing the evolution of the states $|e,n\rangle$ and $|g,n\rangle$ in principle we can deduce the evolution of any initial atom state for any field state.
It is possible to show that, with $\Omega_n \equiv \Omega_0 \sqrt{n+1} $, and where I take by convention for $n<0$: $|n\rangle=0$
$$e^{-\frac{i H_{JC} t}{\hbar}}|e,n\rangle=\cos(\frac{\Omega_n t}{2}) |e,n \rangle - \sin(\frac{\Omega_n t}{2}) |g,n+1 \rangle$$
And:
$$e^{-\frac{i H_{JC} t}{\hbar}}|g,n\rangle=\sin(\frac{\Omega_{n-1} t}{2}) |e,n-1 \rangle + \cos(\frac{\Omega_{n-1} t}{2}) |g,n \rangle$$
Now, to answer your question, if you have a given fixed number of photons in your field, you will see that an initial atom state will get entangled with the field:
$$|g,n \rangle \to  \sin(\frac{\Omega_{n-1} t}{2}) |e,n-1 \rangle + \cos(\frac{\Omega_{n-1} t}{2}) |g,n \rangle    $$
Now to answer your question precisely: it is not possible to do the transformation you want with fixed photons number in the field (if by photon you mean a fock state). One physical reason why is that it would violate the measurement postulate of Q.M. Indeed it would mean that by measuring if the field absorbed or relaxed photons, you would be able to deduce what state is the atom after interaction wihout perturbing the atom. For instance here if I measure the number of photon in my field, if I find $n$, it projects my atom in $|g \rangle$. If I find $n-1$ it projects it in $|e\rangle$. The fact we do not violate measurement postulate is precisely because of the entanglement: the atom gets in a mixed state after interacting.
What you have to do to perform the transformation you want is to consider the field in a coherent state, i.e a field:
$$|\alpha \rangle = \sum_n c_n |n \rangle$$
With $c_n = e^{-|\alpha|^2} \alpha^n / \sqrt{n!}$
The average number of photon in this state is $\overline{n}=|\alpha|^2$. Calculating the evolution of: $\left(a|0\rangle + b|1\rangle \right) |\alpha\rangle$ for a time of interaction $t=\theta/(\Omega_0 \sqrt{\overline{n}})$ in the limit $\overline{n} \to +\infty$ it is possible to show that the final atom state obtained will correspond
$$|g,\alpha\rangle \to \frac{1}{\sqrt{2}}(|g\rangle + |e \rangle) \otimes |\alpha\rangle $$
This is one of the reasons why coherent states are considered as classical states: in the limit of large photons they reproduce the expected dynamic of an electromagnetic field modelled as classical: i.e they reproduce a classical Rabi oscillation (the atom remains in a pure state).
And here as you see it doesn't violate the measurement postulate as the field is in the same state before and after the interaction. Note that this doesn't really violate the energy conservation because here it is what happen in a limit of $\alpha \to \infty$. For any fixed (but big) value of $\alpha$ you would still have some slight entanglement between atom and field. By measuring the number of photon in the field you would have access to information about the atom state and make it "collapse" in an analog way as before.
And the sum of the energy in the obtained field state and in the state where the atom has collapsed will correspond to the initial energy you had at the beginning (it is an analog situation as the one described with fock state).
The thing is that the more energy you put in the field and the less entanglement there will have. You have absolutely $0$ entanglement only in the theoretical infinite number of photon limit.
