# How to use operators on tensor products

This problem is from physics, but I have trouble understanding the math. I have some problem understanding how to use tensors. Let's say in Quantum Optics if I have the state in mode $$b$$ (where I can have two possible modes $$a$$ and $$b$$) $$|1_b\rangle = |0_a\rangle \otimes|1_b\rangle$$

And I want to obtain $$\langle1_b|\hat{a}^\dagger \hat{b}|1_b\rangle$$ do I proceed as follows?

$$\langle1_b|\hat{a}^\dagger \hat{b}|1_b\rangle = \langle1_b|\hat{b} \hat{a}^\dagger |1_b\rangle = \langle 0_a|\langle1_b|\hat{a}^\dagger \hat{b} |0_a\rangle |1_b\rangle = \sqrt{2} \langle0_a| \langle2_b| \hat{a}^\dagger |1_a\rangle |0_b \rangle$$

$$= 2 \langle 0_a| \langle 2_b|2_a \rangle | 0_b \rangle$$

And then what? Do I just do

$$= 2 \langle0_a|2_a\rangle \langle2_b|0_b\rangle = 2 \cdot 0 \cdot 0 = 0$$

As I see it $$\hat b$$ should rather be $$\operatorname{id}_a\otimes \hat b$$ (does nothing on $$a$$ and acts like $$\hat b$$ on the $$b$$ side) and similar for $$\hat a$$ (?)
Let us not think about tensor products of a bounded and an unbounded operator for now and just formally evaluate this expectation value--to see what is going on here I will not use bra-ket notation but rather the "usual" scalar product: $$\langle 1_b|\hat a^\dagger \hat b|1_b\rangle=\langle (0_a\otimes 1_b),(\hat a^\dagger\otimes\operatorname{id}_b)(\operatorname{id}_a\otimes \hat b)(0_a\otimes 1_b)\rangle\,.$$ Now operators on tensor products act as $$(A\otimes B)(x\otimes y)=(Ax)\otimes (By)$$ so $$\langle 0_a\otimes 1_b,(\hat a^\dagger\otimes\operatorname{id}_b)(\operatorname{id}_a\otimes \hat b)(0_a\otimes 1_b)\rangle=\langle 0_a\otimes 1_b,(\hat a^\dagger 0_a\otimes \hat b 1_b)\rangle=\langle 0_a\otimes 1_b,1_a\otimes 0_b\rangle\,.$$ Finally, the scalar product on the tensor product of two Hilbert spaces $$\mathcal H_1,\mathcal H_2$$ has the property $$\langle a\otimes b,c\otimes d\rangle_{\mathcal H_1\otimes\mathcal H_2}=\langle a,c\rangle_{\mathcal H_1}\langle b,d\rangle_{\mathcal H_2}$$. In total $$\langle 1_b|\hat a^\dagger \hat b|1_b\rangle=\langle 0_a\otimes 1_b|1_a\otimes 0_b\rangle=\langle 0_a|1_a\rangle\langle 1_b|0_b\rangle=0\cdot 0=0\,.$$ Of course we could also use the last property right from the start to get $$\langle 1_b|\hat a^\dagger \hat b|1_b\rangle=\langle (0_a\otimes 1_b),(\hat a^\dagger\otimes\operatorname{id}_b)(\operatorname{id}_a\otimes \hat b)(0_a\otimes 1_b)\rangle=\langle 0_a|\hat a^\dagger| 0_a\rangle\langle 1_b|\hat b|1_b \rangle=0\,.$$