Your thesis is a research report. The report concerns a problem or series of problems in your area of research and it should describe what was known about it previously, what you did towards solving it, what you think your results mean, and where or how further progress in the field can be made. Do not carry over your ideas from undergraduate assessment: a thesis is not an answer to an assignment question. One important difference is this: the reader of an assignment is usually the one who has set it. S/he already knows the answer (or one of the answers), not to mention the background, the literature, the assumptions and theories and the strengths and weaknesses of them. The readers of a thesis do not know what the “answer” is. If the thesis is for a PhD, the university requires that it make an original contribution to human knowledge: your research must discover something hitherto unknown.
Obviously your examiners will read the thesis. They will be experts in the general field of your thesis but, on the exact topic of your thesis, you are the world expert. Keep this in mind: you should write to make the topic clear to a reader who has not spent most of the last three years thinking about it.
Your thesis will also be used as a scientific report and consulted by future workers in your laboratory who will want to know, in detail, what you did. Theses are occasionally consulted by people from other institutions, and the library sends microfilm versions if requested (yes, still). More commonly theses are now stored in an entirely digital form. These may be stored as .pdf files on a server at your university. The advantage is that your thesis can be consulted much more easily by researchers around the world. (See e.g. Australian digital thesis project for the digital availability of research theses.) Write with these possibilities in mind.
It is often helpful to have someone other than your adviser(s) read some sections of the thesis, particularly the introduction and conclusion chapters. It may also be appropriate to ask other members of staff to read some sections of the thesis which they may find relevant or of interest, as they may be able to make valuable contributions. In either case, only give them revised versions, so that they do not waste time correcting your grammar, spelling, poor construction or presentation.
How much detail?
The short answer is: rather more than for a scientific paper. Once your thesis has been assessed and your friends have read the first three pages, the only further readers are likely to be people who are seriously doing research in just that area. For example, a future research student might be pursuing the same research and be interested to find out exactly what you did. (“Why doesn’t the widget that Bloggs built for her project work any more? Where’s the circuit diagram? I’ll look up her thesis.” “Blow’s subroutine doesn’t converge in my parameter space! I’ll have to look up his thesis.” “How did that group in Sydney manage to get that technique to work? I’ll order a microfilm of that thesis they cited in their paper.”) For important parts of apparatus, you should include workshop drawings, circuit diagrams and computer programs, usually as appendices. (By the way, the intelligible annotation of programs is about as frequent as porcine aviation, but it is far more desirable. You wrote that line of code for a reason: at the end of the line explain what the reason is.) You have probably read the theses of previous students in the lab where you are now working, so you probably know the advantages of a clearly explained, explicit thesis and/or the disadvantages of a vague one.
Make it clear what is yours
If you use a result, observation or generalisation that is not your own, you must usually state where in the scientific literature that result is reported. The only exceptions are cases where every researcher in the field already knows it: dynamics equations need not be followed by a citation of Newton, circuit analysis does not need a reference to Kirchoff. The importance of this practice in science is that it allows the reader to verify your starting position. Physics in particular is said to be a vertical science: results are built upon results which in turn are built upon results etc. Good referencing allows us to check the foundations of your additions to the structure of knowledge in the discipline, or at least to trace them back to a level which we judge to be reliable. Good referencing also tells the reader which parts of the thesis are descriptions of previous knowledge and which parts are your additions to that knowledge. In a thesis, written for the general reader who has little familiarity with the literature of the field, this should be especially clear. It may seem tempting to leave out a reference in the hope that a reader will think that a nice idea or an nice bit of analysis is yours. I advise against this gamble. The reader will probably think: “What a nice idea—I wonder if it’s original?”. The reader can probably find out via the net or the library.
If you are writing in the passive voice, you must be more careful about attribution than if you are writing in the active voice. “The sample was prepared by heating yttrium…” does not make it clear whether you did this or whether Acme Yttrium did it. “I prepared the sample…” is clear.