# Photons inside a box

One of my friends told me that the definition of mass is the amount of matter. I told him that mass is not the amount of matter, because when we heat an object, the mass of the object increases.

I gave an example: Photons moving around inside a closed massless box having walls of perfectly reflecting mirrors gives mass to the box, because the definition of mass is $\sqrt{E^2-p^2}$ .

Inside the box, when we consider the photons as a whole they don't have momentum, thus mass becomes $m=E$ when $c=1$.

But I'm really confused what happens when the box starts moving, because in that case the momentum as a whole of the photons is not zero? What will be the mass of the box then?

• Think about it in terms of momentum of the photons. What happens to their momentum when the box starts moving? – CuriousOne Sep 26 '14 at 4:59
• If there are many photons inside the box then momentum on the average of all the photons is zero , just like the average velocity of the molecules in a container is zero in kinetic theory of gases? but what happen when there is only one photon inside the box? – Paul Sep 26 '14 at 9:36
• What would happen if it wasn't a single photon but a (perfect) tennis ball? What makes you think that a single photon would behave qualitatively differently from the scenario of a perfect ball? – CuriousOne Sep 27 '14 at 1:05

Don't worry too much about the word "matter": the modern view afforded by GTR, quantum field theory and much more means that the word "matter" has become very vague. If you look up the "matter" Wikipedia page, this seems to agree that the word "matter" is very vague now indeed, so as a useful concept in physics, the word seems clearly to have passed its use-by date. I actually got to the age of 45 before one day I realised ashamedly that I couldn't define the word "matter" anymore, a situation I thought was disgraceful for a physicist, but a quick sweep of the web shows that there was good reason for my plight.

Your reasoning is quite correct and you are definitely on the right track. The rest mass of the sealed, reflecting box most definitely increases, by dint of the equation $E^2 = p^2 c^2 + m_0^2 c^4$ you cite. You simply need to think in a bit more detail about what happens when you shove the box: for simplicity, simply assume a one-dimensional cavity with motion only along the cavity's optical axis. The mirror at one end will begin to blue shift the light whose motion is in the opposite direction to the motion and at the other end there will be a red shift back. Whether you analyse this situation classically (messy and hard) or as photons (easy) as done in my answer here, you get the same answer: there is a difference between the impulses imparted to the mirrors at either end by dint of the different light wavelengths, and when you do the calculation it shows that you need to impart an impulse $E \Delta\,v/c^2$ (owing to the presence of the light with energy $E$ alone) to the box to change its speed by $\Delta\,v$. A slightly different method of getting to this conclusion is method 2 in my answer here. Either way, one can see that a great deal of the "rest mass" in the World indeed arises from the confinement of massless objects, as discussed further in my answer here and here.

• Hi,this is really offtopic,but I need a help as you are a physicist,which will be the best programming language for physics?(c,c++,or fortran?) – Paul Mar 13 '15 at 15:01
• @Paul Depending on your field I'd also definitely look into some of the packages available for Mathematica and Maple - if there isn't one, maybe think about writing your own. These environments have extremely wide and powerful algorithm support and for packages - see for example the differential geometry package Atlas for both Mathematica and Maple. digi-area.com/Mathematica/atlas Of the languages you suggest, definitely either c++ or fortran - the later versions after 2000 of fortran. c - no way. I use mainly c++ but I also use C Sharp and Java for interfaces to GUI ... – Selene Routley Mar 13 '15 at 22:09
• @Paul ... I have also been looking fairly heavily lately into Haskell. Many algorithms are fairly trivial in their overall architecture (that doesn't make them easy to build and debug BTW) - what I mean here is that their control flow is a simple loop and so forth and you can kind of kid yourself that you don't need "more modern" paradigms like OO, but my experience is that my numerical programming went to a new level when I did learn some of these paradigms: they help manage complexity and you can spend more time thinking about your application rather than how to code it. – Selene Routley Mar 13 '15 at 22:13
• @Paul I should also add both C++ and modern Fortran have excellent support for multithreading and multiprocessor code, which is becoming important even on a desktop if you want to take advantage of parallel processing. Both have thread and support classes (mutex, semaphore and all the rest of it in C++, for example) but also their compilers both have automatic compilation of single threaded code into parallel tasks. Visual C++ does this from version 11 onwards. They don't fully substitute for manually multithreading something, but they work admirably nonetheless. – Selene Routley Mar 13 '15 at 23:08