From Heisenberg to Schrodinger picture in second quantization formalism I'm a bit confused about the QM representations: I know that in the shrodinger picture, the operators stay the same, and the quantum state rotates in the hilbert space. In the heisenberg picture it's the operators that change, and the states stay always the same. Suppose the following
In the context of quantum optics, suppose you have  an input fields, in some state generated by $f(a, a^\dagger)$, that is, the input state is: $f(a, a^\dagger)|0\rangle=|\psi\rangle$. Now, the field will undergo a series of linear transformations such as beamsplitters, phase rotations, and squeezing stuff. Let's boil it all down to an operator $U$. Then I know that in the shrodinger picture, the final state is given by $|\psi_{out}\rangle=Uf(a, a^\dagger)|0\rangle$. If I were to talk about the Heisenberg picture then I would say that every field operator will be transformed as $U^\dagger a U$, therefore I would be able to write $f(U^\dagger a U, U^\dagger a^\dagger U)=f^\prime $.
The questionable argument:
Now, suppose I want to find the output state $| \psi_{out}\rangle$. Since the vaccum state is the same in any representation, then the vacuum is the same before and after the transformations $U$. Since doing $U^\dagger a U$ is merely a change of basis, then $|\psi_{out}\rangle=f(U^\dagger a U, U^\dagger a^\dagger U) |0\rangle$
Is this correct reasoning?
 A: Let $f'(a, a^\dagger) := f(U\,a\,U^\dagger, U\,a^\dagger\,U^\dagger)$. We expect $f'(a, a^\dagger) = U\,f(a, a^\dagger)\,U^\dagger$. Taylor expanding $f$ would give us terms in the form $K_n = x_1\,x_2\,x_3 \cdots x_n$ where $x_i \in \{a,a^\dagger\}$. Let $a \mapsto U\,a\,U^\dagger,\ a^\dagger \mapsto U\,a^\dagger\,U^\dagger$. This means all $x_i \mapsto U\,x_i\,U^\dagger$ as well. Letting all $x_i$ to transform we get $K_n' = U\,x_1\,U^\dagger\,U\,x_2\,U^\dagger\cdots U\,x_n\,U^\dagger = U\,K_n\,U^\dagger$. As such, all terms in the Taylor expansion will end up transforming the same way as the operator arguments, that is, functions of operators transform exactly the same way as their arguments for unitary transformations, that is, $f'(a,a^\dagger) = U\,f(a,a^\dagger)\,U^\dagger$. This means that your reasoning is indeed correct.
In Heisenberg picture, we would expect that if $|\psi\rangle = O |\phi\rangle$, transforming $|\psi\rangle \mapsto |\psi\rangle' = U\,|\psi\rangle$, $|\phi\rangle \mapsto |\phi\rangle' = U\,|\phi\rangle$, and $O \mapsto O' = U\,O\,U^\dagger$ would keep the equation form the same: $|\psi\rangle' = O'\,|\phi\rangle'$. Let $|\phi\rangle := |0\rangle$ and $O := f(a, a^\dagger)$. This means that the state being transformed is the original input state $|\psi\rangle$. You transform it via a unitary operator $U$ to $|\psi_{out}\rangle = U\,|\psi\rangle = |\psi\rangle'$. So the Heisenberg picture would dictate:
$$
|\psi_{out}\rangle = |\psi\rangle' = f'(a,a^\dagger)\,|\phi\rangle' = U\,f(a,a^\dagger)\,U^\dagger\,U\,|\phi\rangle = U\,f(a, a^\dagger)\,|\phi\rangle
$$
where we recovered your main equation. Putting the definition of $f'$ back and noting $U\,|0\rangle = |0\rangle$,
$$
|\psi_{out}\rangle = f'(a,a^\dagger)\,|\phi\rangle' = f(U\,a\,U^\dagger,U\,a^\dagger\,U^\dagger)\,U\,|0\rangle = f(U\,a\,U^\dagger,U\,a^\dagger\,U^\dagger)\,|0\rangle
$$
