Books say that it is a light particle and sometimes packet of energy. To describe interaction of light with matter it is associated with oscollation electtic and magnetic fields. But how can a particle like photon be associated with electromagnetic waves or oscillating electric and magnetic field?
-
Have you heard Wave-particle duality? Every wave can act as particle (has momentum, etc) and every particle has wave properties (check De Broglie wavelength). It's core principle in quantum mechanics. – Agnius Vasiliauskas Dec 16 '23 at 17:32
-
This part of nature is "bisexual",- sometimes it acts like "men"- particle and sometimes, like woman, (wave). :-) If you try to "logically fit" each and every aspect of nature in your mind,- you will become crazy. Nature doesn't care how we think about it and if it's behavior is rational or not. It is as it is. This especially applies to Quantum Mechanics, that's why it is said that nobody truly understands QM. – Agnius Vasiliauskas Dec 16 '23 at 17:56
-
This may help - How can a red light photon be different from a blue light photon? – mmesser314 Dec 17 '23 at 01:19
2 Answers
It is like this: in classical theory of EM phenomena, the primary objects that exist are the charged particles with mass, and the EM field (or multiple EM fields in some variants of EM theory) which has two parts, electric and magnetic field. These are the objects of the theory, the stuff that exists, and then other stuff (relativistic equations of motion, Maxwell's equations, waves) is mathematics to describe them.
This remains the case even in the most advanced theories of light-matter interaction, including quantum theory of EM field, only in the quantum relativistic variant, matter gets described by operator fields, and EM fields become operators as well, instead of simple number quantities, and working out things in the theory gets mathematically problematic.
Photon is a word with many meanings, but in the modern quantum theory, it is very often mostly a figure of speech used to describe changes between special class of states of quantum EM field (Fock states), or exchange of energy between material systems and EM field, or parts of a drawing (a Feynman diagram) used to calculate some integrals. Quantum EM field itself is not made of photons in any visualizable classical way, a photon is not a point particle that can be found somewhere in space and time. It is used as fiction in our words, graphs and calculations, to make things verbally easier when dealing with mathematics of quantum field theory (but confusing lots of people when popularizing science), when we describe absorption, emission, or scattering of EM radiation.
See also

- 37,229
Here the word particle is tripping you up. All fundamental particles are quantized excitations of quantum fields (QEQF's, no I made that up...particles is better).
There are two common descriptions of photons, one for quantum optics and one for quantum electro dynamics (QED).
In quantum optics, photons are described by Fock states, or number states. So a photons is:
$$ |1\rangle $$
Obviously, that doesn't mean much, and the wikipedia page on Fock states is too technical for non-experts. A good way to get idea of how they are described is the Glauber State (https://en.wikipedia.org/wiki/Coherent_state), also technical, but better.
The Glauber state describes a coherent electromagnetic plane wave (of some polarization) is sum of Fock states, and in the limit the the mean occupation number, $\bar n$, is large, it approaches a classical plane wave.
At small $\bar n$, quantum effects are apparent such as phase an amplitude uncertainty.
There is also a position representation, and all I can say about that it that is not localized.
In QED, photon are "particles", real or virtual. The simplest real photon appears in the Feynman diagram for Compton scattering:
Note that this is a momentum space representation and does not represent the motion of a particle through space.
There is also a diagram for a free propagating photon (and it's 1st self-energy term):
I classified this as "more complicated" because it contains a loop, and is thus a (continuously) infinite number of intermediate states.
So tl;dr: photons are complicated.
Finally, in the classical domain, I want to address the statement that photon is a "packet of energy".
An electron is a packet of energy, and the minimum energy that packet can have is $m_ec^2$, which it had in it's rest frame.
Well, $m_{\gamma}=0$, and photons don't have a rest frames. Energy is not Lorentz invariant, and for any photon, regardless of its source, there exist reference frames in which
$$E_{\gamma} \rightarrow 0 $$ $$E_{\gamma} \rightarrow \infty $$
So while a "particle" and "a packet of energy" are vital terms, they can lead to misunderstandings when the underlying theories aren't considered.
But both quantum optics and QED are graduate level material, are hard, and developers in both of them have been awarded Nobel prizes for their work.

- 33,420