system
Given the following post, respond as if you're commenting on Reddit:
human
When I heat up a metal where do photons come from?

So I heat up any given metal to the point it starts giving off light, just like in a light bulb or foundry/ironworks. Where do photons come from and assuming I do so in a vacuum would such metal lose it's weight after some time?
gpt
A photon is an electromagnetic wave. You make one by "shaking" an electron (any charged particle actually, but electron is most common). When you shake an electron you cause a momentary electrical wave, which then self induces a magnetic component and that's what a photon is.

No nothing is lost from the electron when you make a photon.

In order to shake an electron you need energy, that energy is used to create the photon.

When you heat anything (not just metal!) the atoms vibrate from the heat. This vibration is also shaking the electrons which then emit photons constantly. (Even at low temperatures photons are constantly being created - you just can't see them. See blackbody radiation if you want to know more.)

There are other ways of shaking electrons - a cool one is a free electron laser. You shoot an electron between alternating pairs of magnets. The magnets cause the electron to wriggle back and forth, producing photons. (It's called a free electron laser because the electron is not attached to an atom - it's traveling in the empty space between the magnets.)

You can move electrons in wires - which is how radio transmitters work.

An electron can absorb some energy, this causes it to "jump" to a higher orbit in the atom. When the electron "falls" back down (and it will), the motion causes it to release a photon. This is how chemical light (like from a firefly, florescent lamp, or most lasers) is produced. In a glow in the dark toy, you charge it with light - the light causes the electrons to more to higher orbits. They then take a while to fall back down - when they fall down they emit light. If you've seen white clothing glow in UV light, it works the same way. The electrons absorb the UV light, and then fall down producing their glow (unlike a glow in the dark toy, in this case they fall immediately).

When an electron falls down it always emits a very precise amount of light. This is because it can only obit the atom in very specific levels. So it always falls an exact amount (depending on which level it reached, different atoms have different possible levels, and usually more than one). That's why the glow is always an exact color.