├── docs ├── .nojekyll ├── objects.inv ├── _static │ ├── up.png │ ├── down.png │ ├── file.png │ ├── minus.png │ ├── plus.png │ ├── comment.png │ ├── footerbg.png │ ├── headerbg.png │ ├── middlebg.png │ ├── up-pressed.png │ ├── ajax-loader.gif │ ├── comment-close.png │ ├── dialog-note.png │ ├── dialog-todo.png │ ├── dialog-topic.png │ ├── down-pressed.png │ ├── transparent.gif │ ├── comment-bright.png │ ├── dialog-seealso.png │ ├── dialog-warning.png │ ├── ie6.css │ ├── pygments.css │ ├── epub.css │ ├── pyramid.css │ ├── doctools.js │ ├── water_phase_diagram.svg │ ├── underscore.js │ └── basic.css ├── _sources │ ├── index.txt │ ├── introduction.txt │ └── largenumbers.txt ├── genindex.html ├── search.html ├── introduction.html ├── _images │ ├── oscillator_trajectory.svg │ ├── water_phase_diagram.svg │ └── ising_phase_diagram.svg └── index.html ├── .gitignore ├── source ├── images │ ├── water.pdf │ ├── binomial.pdf │ ├── gaussian.pdf │ ├── ising_model.pdf │ ├── mean_field.pdf │ ├── phase_space.pdf │ ├── ising_phase_diagram.pdf │ ├── water_phase_diagram.pdf │ ├── oscillator_trajectory.pdf │ ├── oscillator_trajectory.svg │ ├── water_phase_diagram.svg │ └── ising_phase_diagram.svg ├── index.rst ├── numsec.py ├── autonumber.py ├── introduction.rst ├── conf.py └── largenumbers.rst ├── LICENSE.md ├── README.md ├── Makefile └── make.bat /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/* 2 | **/__pycache__/* 3 | -------------------------------------------------------------------------------- /docs/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/objects.inv -------------------------------------------------------------------------------- /docs/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/up.png -------------------------------------------------------------------------------- /docs/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/down.png -------------------------------------------------------------------------------- /docs/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/file.png -------------------------------------------------------------------------------- /docs/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/minus.png -------------------------------------------------------------------------------- /docs/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/plus.png -------------------------------------------------------------------------------- /docs/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/comment.png -------------------------------------------------------------------------------- /docs/_static/footerbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/footerbg.png -------------------------------------------------------------------------------- /docs/_static/headerbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/headerbg.png -------------------------------------------------------------------------------- /docs/_static/middlebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/middlebg.png -------------------------------------------------------------------------------- /source/images/water.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/source/images/water.pdf -------------------------------------------------------------------------------- /docs/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/up-pressed.png -------------------------------------------------------------------------------- /source/images/binomial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/source/images/binomial.pdf -------------------------------------------------------------------------------- /source/images/gaussian.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/source/images/gaussian.pdf -------------------------------------------------------------------------------- /docs/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/comment-close.png -------------------------------------------------------------------------------- /docs/_static/dialog-note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/dialog-note.png -------------------------------------------------------------------------------- /docs/_static/dialog-todo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/dialog-todo.png -------------------------------------------------------------------------------- /docs/_static/dialog-topic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/dialog-topic.png -------------------------------------------------------------------------------- /docs/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/down-pressed.png -------------------------------------------------------------------------------- /docs/_static/transparent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/transparent.gif -------------------------------------------------------------------------------- /source/images/ising_model.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/source/images/ising_model.pdf -------------------------------------------------------------------------------- /source/images/mean_field.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/source/images/mean_field.pdf -------------------------------------------------------------------------------- /source/images/phase_space.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/source/images/phase_space.pdf -------------------------------------------------------------------------------- /docs/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/_static/dialog-seealso.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/dialog-seealso.png -------------------------------------------------------------------------------- /docs/_static/dialog-warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/docs/_static/dialog-warning.png -------------------------------------------------------------------------------- /source/images/ising_phase_diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/source/images/ising_phase_diagram.pdf -------------------------------------------------------------------------------- /source/images/water_phase_diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/source/images/water_phase_diagram.pdf -------------------------------------------------------------------------------- /source/images/oscillator_trajectory.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peastman/statmech/HEAD/source/images/oscillator_trajectory.pdf -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | This work may be freely distributed under the terms of the 2 | [Creative Commons Attribution-NoDerivatives 4.0 International License](http://creativecommons.org/licenses/by-nd/4.0). 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Introduction to Statistical Mechanics 2 | ===================================== 3 | 4 | This is an introductory textbook on statistical mechanics. It is suitable for an undergraduate physics major studying 5 | the subject for the first time. The only required prerequisites are multivariable calculus and classical mechanics. 6 | You can read it online at https://peastman.github.io/statmech/. 7 | 8 | It is written in [Sphinx](http://sphinx-doc.org) format. To build it as HTML, type 9 | 10 | make html 11 | 12 | To build it as a PDF, type 13 | 14 | make latexpdf 15 | 16 | The generated content will be in build/html or build/latex, respectively. 17 | -------------------------------------------------------------------------------- /source/index.rst: -------------------------------------------------------------------------------- 1 | ##################################### 2 | Introduction to Statistical Mechanics 3 | ##################################### 4 | 5 | Copyright © 2014-2015 by Peter Eastman 6 | 7 | This work may be freely distributed under the terms of the 8 | `Creative Commons Attribution-NoDerivatives 4.0 International License `_. 9 | The source can be found at https://github.com/peastman/statmech. 10 | 11 | .. toctree:: 12 | :numbered: 13 | :maxdepth: 2 14 | 15 | introduction.rst 16 | statisticaldescription.rst 17 | largenumbers.rst 18 | interpretation.rst 19 | thermodynamics.rst 20 | phasetransitions.rst 21 | friction.rst 22 | phasespace.rst 23 | -------------------------------------------------------------------------------- /docs/_sources/index.txt: -------------------------------------------------------------------------------- 1 | ##################################### 2 | Introduction to Statistical Mechanics 3 | ##################################### 4 | 5 | Copyright © 2014-2015 by Peter Eastman 6 | 7 | This work may be freely distributed under the terms of the 8 | `Creative Commons Attribution-NoDerivatives 4.0 International License `_. 9 | The source can be found at https://github.com/peastman/statmech. 10 | 11 | .. toctree:: 12 | :numbered: 13 | :maxdepth: 2 14 | 15 | introduction.rst 16 | statisticaldescription.rst 17 | largenumbers.rst 18 | interpretation.rst 19 | thermodynamics.rst 20 | phasetransitions.rst 21 | friction.rst 22 | phasespace.rst 23 | -------------------------------------------------------------------------------- /docs/_static/ie6.css: -------------------------------------------------------------------------------- 1 | * html img, 2 | * html .png{position:relative;behavior:expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none", 3 | this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "',sizingMethod='image')", 4 | this.src = "_static/transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''), 5 | this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "',sizingMethod='crop')", 6 | this.runtimeStyle.backgroundImage = "none")),this.pngSet=true) 7 | );} 8 | -------------------------------------------------------------------------------- /source/numsec.py: -------------------------------------------------------------------------------- 1 | """ 2 | Changes section references to be the section number 3 | instead of the title of the section. 4 | """ 5 | 6 | from docutils import nodes 7 | import sphinx.domains.std 8 | 9 | class CustomStandardDomain(sphinx.domains.std.StandardDomain): 10 | 11 | def __init__(self, env): 12 | env.settings['footnote_references'] = 'superscript' 13 | sphinx.domains.std.StandardDomain.__init__(self, env) 14 | 15 | def resolve_xref(self, env, fromdocname, builder, 16 | typ, target, node, contnode): 17 | res = super(CustomStandardDomain, self).resolve_xref(env, fromdocname, builder, 18 | typ, target, node, contnode) 19 | 20 | if res is None: 21 | return res 22 | 23 | if typ == 'ref' and not node['refexplicit']: 24 | docname, labelid, sectname = self.data['labels'].get(target, ('','','')) 25 | res['refdocname'] = docname 26 | 27 | return res 28 | 29 | def doctree_resolved(app, doctree, docname): 30 | secnums = app.builder.env.toc_secnumbers 31 | for node in doctree.traverse(nodes.reference): 32 | if 'refdocname' in node: 33 | refdocname = node['refdocname'] 34 | if refdocname in secnums: 35 | secnum = secnums[refdocname] 36 | emphnode = node.children[0] 37 | textnode = emphnode.children[0] 38 | 39 | toclist = app.builder.env.tocs[refdocname] 40 | anchorname = None 41 | for refnode in toclist.traverse(nodes.reference): 42 | if refnode.astext() == textnode.astext(): 43 | anchorname = refnode['anchorname'] 44 | if anchorname is None: 45 | continue 46 | linktext = '.'.join(map(str, secnum[anchorname])) 47 | node.replace(emphnode, nodes.Text(linktext)) 48 | 49 | def setup(app): 50 | app.override_domain(CustomStandardDomain) 51 | app.connect('doctree-resolved', doctree_resolved) 52 | 53 | -------------------------------------------------------------------------------- /source/autonumber.py: -------------------------------------------------------------------------------- 1 | from docutils.parsers.rst import roles 2 | from docutils.nodes import Text, reference, section, label 3 | from sphinx.roles import XRefRole 4 | 5 | class autonumber(label): 6 | pass 7 | 8 | class autonumber_ref(reference): 9 | pass 10 | 11 | def autonumber_role(name, rawtext, text, lineno, inliner, options={}, content=[]): 12 | return ([autonumber(text=text)], []) 13 | 14 | def doctree_resolved(app, doctree, docname): 15 | index = {}; 16 | refTable = {} 17 | if app.config.autonumber_by_chapter: 18 | # Record the number of each chapter 19 | 20 | env = app.builder.env 21 | sectionNumbers = {} 22 | for doc in env.toc_secnumbers: 23 | sections = env.toc_secnumbers[doc] 24 | for sectionId in sections: 25 | sectionNumbers[sectionId[1:]] = sections[sectionId] 26 | lastChapter = -1 27 | 28 | # Assign numbers to all the autonumbered objects. 29 | 30 | for node in doctree.traverse(autonumber): 31 | category = node.astext().split(',')[0] 32 | if category in index: 33 | nextNumber = index[category]+1 34 | else: 35 | nextNumber = 1 36 | if app.config.autonumber_by_chapter: 37 | parent = node.parent 38 | chapter = None 39 | while chapter is None: 40 | if isinstance(parent, section): 41 | chapter = parent 42 | parent = parent.parent 43 | chapter = sectionNumbers[chapter.attributes['ids'][0]][0] 44 | if chapter != lastChapter: 45 | index = {} 46 | nextNumber = 1 47 | newNode = Text('%s %d-%d' % (category, chapter, nextNumber)) 48 | lastChapter = chapter 49 | else: 50 | newNode = Text('%s %d' % (category, nextNumber)) 51 | index[category] = nextNumber 52 | refTable[node.astext()] = newNode 53 | node.parent.replace(node, newNode) 54 | 55 | # Replace references with the name of the referenced object 56 | 57 | for ref_info in doctree.traverse(autonumber_ref): 58 | target = ref_info['reftarget'] 59 | if target not in refTable: 60 | raise ValueError('Unknown target for autonumber reference: '+target) 61 | ref_info.replace_self(Text(refTable[target].astext())) 62 | 63 | def setup(app): 64 | app.add_config_value('autonumber_by_chapter', True, False) 65 | roles.register_local_role('autonumber', autonumber_role) 66 | app.add_node(autonumber) 67 | app.add_node(autonumber_ref) 68 | app.add_role('autonumref', XRefRole(nodeclass=autonumber_ref)) 69 | app.connect('doctree-resolved', doctree_resolved) 70 | 71 | -------------------------------------------------------------------------------- /source/introduction.rst: -------------------------------------------------------------------------------- 1 | Introduction 2 | ############ 3 | 4 | Depending on how you look at it, statistical mechanics is either the least fundamental or most fundamental of all fields 5 | of physics. That is because it is not really science at all. It is pure mathematics. 6 | 7 | In other subjects, you learn about "natural laws": Newton's second law, Maxwell's equations, Schrödinger's equation, 8 | etc. These laws are not derived from anything else. They were discovered experimentally and then assumed to reflect 9 | fundamental aspects of reality. But statistical mechanics does not involve any natural laws of this sort. Instead, it 10 | is a set of techniques that can be applied to nearly any physical system, no matter what laws that system obeys. That 11 | is why I call it the most fundamental field of physics. New theories may replace old ones, and natural laws may turn 12 | out to be merely approximations to deeper laws. But statistical mechanics remains valid through it all, and whatever 13 | new laws are discovered, it will almost certainly work just as well with them as it did with the old ones. 14 | 15 | Statistical mechanics was developed in the second half of the 19th century. It was primarily the work of Ludwig 16 | Boltzmann, who personally published more than a hundred papers on the subject during his lifetime. Other scientists 17 | also contributed to it, of course, especially James Clerk Maxwell (the same one Maxwell's equations are named after) and 18 | Josiah Willard Gibbs. 19 | 20 | It grew out of thermodynamics, an earlier theory that described the behavior of a mysterious substance called "heat" or 21 | "caloric". Thermodynamics was a physical theory of the more conventional sort. It involved natural laws discovered by 22 | experiment, and made no claims about why those laws happened to hold. Caloric was supposed to be a substance much like 23 | other forms of matter. But this view turned out to be incorrect. Heat is actually an emergent phenomenon: a 24 | mathematical quantity defined in terms of a more detailed theory (the movement of individual atoms). The "laws" of 25 | thermodynamics can be derived from that deeper theory by applying statistical techniques. If you ignore the details of 26 | how each atom is moving, you find they collectively behave in a way that resembles a continuous fluid. That is what 27 | statistical mechanics is all about: deriving high level descriptions by starting from lower level ones and then 28 | averaging out lots of details. 29 | 30 | Is it possible other theories could be explained in the same way? That is an open question, and a fascinating one. 31 | Many physicists suspect gravity is an emergent phenomenon, that it arises from the collective behavior of some deeper 32 | degrees of freedom. Statistical interpretations have also been proposed for quantum mechanics. These are all very 33 | speculative, of course, and they could easily turn out to be wrong. But they also could easily turn out to be right. 34 | Based on what we know today, it is entirely possible that the very structure of spacetime is a consequence of 35 | statistical mechanics. 36 | -------------------------------------------------------------------------------- /docs/_sources/introduction.txt: -------------------------------------------------------------------------------- 1 | Introduction 2 | ############ 3 | 4 | Depending on how you look at it, statistical mechanics is either the least fundamental or most fundamental of all fields 5 | of physics. That is because it is not really science at all. It is pure mathematics. 6 | 7 | In other subjects, you learn about "natural laws": Newton's second law, Maxwell's equations, Schrödinger's equation, 8 | etc. These laws are not derived from anything else. They were discovered experimentally and then assumed to reflect 9 | fundamental aspects of reality. But statistical mechanics does not involve any natural laws of this sort. Instead, it 10 | is a set of techniques that can be applied to nearly any physical system, no matter what laws that system obeys. That 11 | is why I call it the most fundamental field of physics. New theories may replace old ones, and natural laws may turn 12 | out to be merely approximations to deeper laws. But statistical mechanics remains valid through it all, and whatever 13 | new laws are discovered, it will almost certainly work just as well with them as it did with the old ones. 14 | 15 | Statistical mechanics was developed in the second half of the 19th century. It was primarily the work of Ludwig 16 | Boltzmann, who personally published more than a hundred papers on the subject during his lifetime. Other scientists 17 | also contributed to it, of course, especially James Clerk Maxwell (the same one Maxwell's equations are named after) and 18 | Josiah Willard Gibbs. 19 | 20 | It grew out of thermodynamics, an earlier theory that described the behavior of a mysterious substance called "heat" or 21 | "caloric". Thermodynamics was a physical theory of the more conventional sort. It involved natural laws discovered by 22 | experiment, and made no claims about why those laws happened to hold. Caloric was supposed to be a substance much like 23 | other forms of matter. But this view turned out to be incorrect. Heat is actually an emergent phenomenon: a 24 | mathematical quantity defined in terms of a more detailed theory (the movement of individual atoms). The "laws" of 25 | thermodynamics can be derived from that deeper theory by applying statistical techniques. If you ignore the details of 26 | how each atom is moving, you find they collectively behave in a way that resembles a continuous fluid. That is what 27 | statistical mechanics is all about: deriving high level descriptions by starting from lower level ones and then 28 | averaging out lots of details. 29 | 30 | Is it possible other theories could be explained in the same way? That is an open question, and a fascinating one. 31 | Many physicists suspect gravity is an emergent phenomenon, that it arises from the collective behavior of some deeper 32 | degrees of freedom. Statistical interpretations have also been proposed for quantum mechanics. These are all very 33 | speculative, of course, and they could easily turn out to be wrong. But they also could easily turn out to be right. 34 | Based on what we know today, it is entirely possible that the very structure of spacetime is a consequence of 35 | statistical mechanics. 36 | -------------------------------------------------------------------------------- /docs/genindex.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Index — Introduction to Statistical Mechanics 11 | 12 | 13 | 14 | 15 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 47 | 48 |
49 |
50 |
51 |
52 | 53 | 54 |

Index

55 | 56 |
57 | 58 |
59 | 60 | 61 |
62 |
63 |
64 | 84 |
85 |
86 | 95 | 99 | 100 | -------------------------------------------------------------------------------- /docs/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #eeffcc; } 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 8 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 9 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 10 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 11 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 12 | .highlight .ge { font-style: italic } /* Generic.Emph */ 13 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 14 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 15 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 16 | .highlight .go { color: #333333 } /* Generic.Output */ 17 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 18 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 19 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 20 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 21 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 22 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 23 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 24 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 25 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 26 | .highlight .kt { color: #902000 } /* Keyword.Type */ 27 | .highlight .m { color: #208050 } /* Literal.Number */ 28 | .highlight .s { color: #4070a0 } /* Literal.String */ 29 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 30 | .highlight .nb { color: #007020 } /* Name.Builtin */ 31 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 32 | .highlight .no { color: #60add5 } /* Name.Constant */ 33 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 34 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 35 | .highlight .ne { color: #007020 } /* Name.Exception */ 36 | .highlight .nf { color: #06287e } /* Name.Function */ 37 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 38 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 39 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 40 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 41 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 42 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 43 | .highlight .mb { color: #208050 } /* Literal.Number.Bin */ 44 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 45 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 46 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 47 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 48 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 49 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 50 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 51 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 52 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 53 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 54 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 55 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 56 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 57 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 58 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 59 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 60 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 61 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 62 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 63 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/search.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Search — Introduction to Statistical Mechanics 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | 40 | 41 | 42 | 43 | 44 | 45 | 54 | 55 |
56 |
57 |
58 |
59 | 60 |

Search

61 |
62 | 63 |

64 | Please activate JavaScript to enable the search 65 | functionality. 66 |

67 |
68 |

69 | From here you can search these documents. Enter your search 70 | words into the box below and click "search". Note that the search 71 | function will automatically search for all of the words. Pages 72 | containing fewer words won't appear in the result list. 73 |

74 |
75 | 76 | 77 | 78 |
79 | 80 |
81 | 82 |
83 | 84 |
85 |
86 |
87 | 91 |
92 |
93 | 102 | 106 | 107 | -------------------------------------------------------------------------------- /docs/_static/epub.css: -------------------------------------------------------------------------------- 1 | /* 2 | * default.css_t 3 | * ~~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- default theme. 6 | * 7 | * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | @import url("basic.css"); 13 | 14 | /* -- page layout ----------------------------------------------------------- */ 15 | 16 | body { 17 | font-family: {{ theme_bodyfont }}; 18 | font-size: 100%; 19 | background-color: {{ theme_footerbgcolor }}; 20 | color: #000; 21 | margin: 0; 22 | padding: 0; 23 | } 24 | 25 | div.document { 26 | background-color: {{ theme_sidebarbgcolor }}; 27 | } 28 | 29 | div.documentwrapper { 30 | float: left; 31 | width: 100%; 32 | } 33 | 34 | div.bodywrapper { 35 | margin: 0 0 0 230px; 36 | } 37 | 38 | div.body { 39 | background-color: {{ theme_bgcolor }}; 40 | color: {{ theme_textcolor }}; 41 | padding: 0 20px 30px 20px; 42 | } 43 | 44 | {%- if theme_rightsidebar|tobool %} 45 | div.bodywrapper { 46 | margin: 0 230px 0 0; 47 | } 48 | {%- endif %} 49 | 50 | div.footer { 51 | color: {{ theme_footertextcolor }}; 52 | width: 100%; 53 | padding: 9px 0 9px 0; 54 | text-align: center; 55 | font-size: 75%; 56 | } 57 | 58 | div.footer a { 59 | color: {{ theme_footertextcolor }}; 60 | text-decoration: underline; 61 | } 62 | 63 | div.related { 64 | background-color: {{ theme_relbarbgcolor }}; 65 | line-height: 30px; 66 | color: {{ theme_relbartextcolor }}; 67 | } 68 | 69 | div.related a { 70 | color: {{ theme_relbarlinkcolor }}; 71 | } 72 | 73 | div.sphinxsidebar { 74 | {%- if theme_stickysidebar|tobool %} 75 | top: 30px; 76 | bottom: 0; 77 | margin: 0; 78 | position: fixed; 79 | overflow: auto; 80 | height: auto; 81 | {%- endif %} 82 | {%- if theme_rightsidebar|tobool %} 83 | float: right; 84 | {%- if theme_stickysidebar|tobool %} 85 | right: 0; 86 | {%- endif %} 87 | {%- endif %} 88 | } 89 | 90 | {%- if theme_stickysidebar|tobool %} 91 | /* this is nice, but it it leads to hidden headings when jumping 92 | to an anchor */ 93 | /* 94 | div.related { 95 | position: fixed; 96 | } 97 | 98 | div.documentwrapper { 99 | margin-top: 30px; 100 | } 101 | */ 102 | {%- endif %} 103 | 104 | div.sphinxsidebar h3 { 105 | font-family: {{ theme_headfont }}; 106 | color: {{ theme_sidebartextcolor }}; 107 | font-size: 1.4em; 108 | font-weight: normal; 109 | margin: 0; 110 | padding: 0; 111 | } 112 | 113 | div.sphinxsidebar h3 a { 114 | color: {{ theme_sidebartextcolor }}; 115 | } 116 | 117 | div.sphinxsidebar h4 { 118 | font-family: {{ theme_headfont }}; 119 | color: {{ theme_sidebartextcolor }}; 120 | font-size: 1.3em; 121 | font-weight: normal; 122 | margin: 5px 0 0 0; 123 | padding: 0; 124 | } 125 | 126 | div.sphinxsidebar p { 127 | color: {{ theme_sidebartextcolor }}; 128 | } 129 | 130 | div.sphinxsidebar p.topless { 131 | margin: 5px 10px 10px 10px; 132 | } 133 | 134 | div.sphinxsidebar ul { 135 | margin: 10px; 136 | padding: 0; 137 | color: {{ theme_sidebartextcolor }}; 138 | } 139 | 140 | div.sphinxsidebar a { 141 | color: {{ theme_sidebarlinkcolor }}; 142 | } 143 | 144 | div.sphinxsidebar input { 145 | border: 1px solid {{ theme_sidebarlinkcolor }}; 146 | font-family: sans-serif; 147 | font-size: 1em; 148 | } 149 | 150 | {% if theme_collapsiblesidebar|tobool %} 151 | /* for collapsible sidebar */ 152 | div#sidebarbutton { 153 | background-color: {{ theme_sidebarbtncolor }}; 154 | } 155 | {% endif %} 156 | 157 | /* -- hyperlink styles ------------------------------------------------------ */ 158 | 159 | a { 160 | color: {{ theme_linkcolor }}; 161 | text-decoration: none; 162 | } 163 | 164 | a:visited { 165 | color: {{ theme_visitedlinkcolor }}; 166 | text-decoration: none; 167 | } 168 | 169 | a:hover { 170 | text-decoration: underline; 171 | } 172 | 173 | {% if theme_externalrefs|tobool %} 174 | a.external { 175 | text-decoration: none; 176 | border-bottom: 1px dashed {{ theme_linkcolor }}; 177 | } 178 | 179 | a.external:hover { 180 | text-decoration: none; 181 | border-bottom: none; 182 | } 183 | 184 | a.external:visited { 185 | text-decoration: none; 186 | border-bottom: 1px dashed {{ theme_visitedlinkcolor }}; 187 | } 188 | {% endif %} 189 | 190 | /* -- body styles ----------------------------------------------------------- */ 191 | 192 | div.body h1, 193 | div.body h2, 194 | div.body h3, 195 | div.body h4, 196 | div.body h5, 197 | div.body h6 { 198 | font-family: {{ theme_headfont }}; 199 | background-color: {{ theme_headbgcolor }}; 200 | font-weight: normal; 201 | color: {{ theme_headtextcolor }}; 202 | border-bottom: 1px solid #ccc; 203 | margin: 20px -20px 10px -20px; 204 | padding: 3px 0 3px 10px; 205 | } 206 | 207 | div.body h1 { margin-top: 0; font-size: 200%; } 208 | div.body h2 { font-size: 160%; } 209 | div.body h3 { font-size: 140%; } 210 | div.body h4 { font-size: 120%; } 211 | div.body h5 { font-size: 110%; } 212 | div.body h6 { font-size: 100%; } 213 | 214 | a.headerlink { 215 | color: {{ theme_headlinkcolor }}; 216 | font-size: 0.8em; 217 | padding: 0 4px 0 4px; 218 | text-decoration: none; 219 | } 220 | 221 | a.headerlink:hover { 222 | background-color: {{ theme_headlinkcolor }}; 223 | color: white; 224 | } 225 | 226 | div.body p, div.body dd, div.body li { 227 | text-align: justify; 228 | line-height: 130%; 229 | } 230 | 231 | div.admonition p.admonition-title + p { 232 | display: inline; 233 | } 234 | 235 | div.admonition p { 236 | margin-bottom: 5px; 237 | } 238 | 239 | div.admonition pre { 240 | margin-bottom: 5px; 241 | } 242 | 243 | div.admonition ul, div.admonition ol { 244 | margin-bottom: 5px; 245 | } 246 | 247 | div.note { 248 | background-color: #eee; 249 | border: 1px solid #ccc; 250 | } 251 | 252 | div.seealso { 253 | background-color: #ffc; 254 | border: 1px solid #ff6; 255 | } 256 | 257 | div.topic { 258 | background-color: #eee; 259 | } 260 | 261 | div.warning { 262 | background-color: #ffe4e4; 263 | border: 1px solid #f66; 264 | } 265 | 266 | p.admonition-title { 267 | display: inline; 268 | } 269 | 270 | p.admonition-title:after { 271 | content: ":"; 272 | } 273 | 274 | pre { 275 | padding: 5px; 276 | background-color: {{ theme_codebgcolor }}; 277 | color: {{ theme_codetextcolor }}; 278 | line-height: 120%; 279 | border: 1px solid #ac9; 280 | border-left: none; 281 | border-right: none; 282 | } 283 | 284 | code { 285 | background-color: #ecf0f3; 286 | padding: 0 1px 0 1px; 287 | font-size: 0.95em; 288 | } 289 | 290 | th { 291 | background-color: #ede; 292 | } 293 | 294 | .warning code { 295 | background: #efc2c2; 296 | } 297 | 298 | .note code { 299 | background: #d6d6d6; 300 | } 301 | 302 | .viewcode-back { 303 | font-family: {{ theme_bodyfont }}; 304 | } 305 | 306 | div.viewcode-block:target { 307 | background-color: #f4debf; 308 | border-top: 1px solid #ac9; 309 | border-bottom: 1px solid #ac9; 310 | } 311 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 21 | 22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext 23 | 24 | help: 25 | @echo "Please use \`make ' where is one of" 26 | @echo " html to make standalone HTML files" 27 | @echo " dirhtml to make HTML files named index.html in directories" 28 | @echo " singlehtml to make a single large HTML file" 29 | @echo " pickle to make pickle files" 30 | @echo " json to make JSON files" 31 | @echo " htmlhelp to make HTML files and a HTML help project" 32 | @echo " qthelp to make HTML files and a qthelp project" 33 | @echo " devhelp to make HTML files and a Devhelp project" 34 | @echo " epub to make an epub" 35 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 36 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 37 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 38 | @echo " text to make text files" 39 | @echo " man to make manual pages" 40 | @echo " texinfo to make Texinfo files" 41 | @echo " info to make Texinfo files and run them through makeinfo" 42 | @echo " gettext to make PO message catalogs" 43 | @echo " changes to make an overview of all changed/added/deprecated items" 44 | @echo " xml to make Docutils-native XML files" 45 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 46 | @echo " linkcheck to check all external links for integrity" 47 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 48 | 49 | clean: 50 | rm -rf $(BUILDDIR)/* 51 | 52 | html: 53 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 54 | @echo 55 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 56 | 57 | dirhtml: 58 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 59 | @echo 60 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 61 | 62 | singlehtml: 63 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 64 | @echo 65 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 66 | 67 | pickle: 68 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 69 | @echo 70 | @echo "Build finished; now you can process the pickle files." 71 | 72 | json: 73 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 74 | @echo 75 | @echo "Build finished; now you can process the JSON files." 76 | 77 | htmlhelp: 78 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 79 | @echo 80 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 81 | ".hhp project file in $(BUILDDIR)/htmlhelp." 82 | 83 | qthelp: 84 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 85 | @echo 86 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 87 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 88 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/StatisticalMechanics.qhcp" 89 | @echo "To view the help file:" 90 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/StatisticalMechanics.qhc" 91 | 92 | devhelp: 93 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 94 | @echo 95 | @echo "Build finished." 96 | @echo "To view the help file:" 97 | @echo "# mkdir -p $$HOME/.local/share/devhelp/StatisticalMechanics" 98 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/StatisticalMechanics" 99 | @echo "# devhelp" 100 | 101 | epub: 102 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 103 | @echo 104 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 105 | 106 | latex: 107 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 108 | @echo 109 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 110 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 111 | "(use \`make latexpdf' here to do that automatically)." 112 | 113 | latexpdf: 114 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 115 | @echo "Running LaTeX files through pdflatex..." 116 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 117 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 118 | 119 | latexpdfja: 120 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 121 | @echo "Running LaTeX files through platex and dvipdfmx..." 122 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 123 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 124 | 125 | text: 126 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 127 | @echo 128 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 129 | 130 | man: 131 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 132 | @echo 133 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 134 | 135 | texinfo: 136 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 137 | @echo 138 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 139 | @echo "Run \`make' in that directory to run these through makeinfo" \ 140 | "(use \`make info' here to do that automatically)." 141 | 142 | info: 143 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 144 | @echo "Running Texinfo files through makeinfo..." 145 | make -C $(BUILDDIR)/texinfo info 146 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 147 | 148 | gettext: 149 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 150 | @echo 151 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 152 | 153 | changes: 154 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 155 | @echo 156 | @echo "The overview file is in $(BUILDDIR)/changes." 157 | 158 | linkcheck: 159 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 160 | @echo 161 | @echo "Link check complete; look for any errors in the above output " \ 162 | "or in $(BUILDDIR)/linkcheck/output.txt." 163 | 164 | doctest: 165 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 166 | @echo "Testing of doctests in the sources finished, look at the " \ 167 | "results in $(BUILDDIR)/doctest/output.txt." 168 | 169 | xml: 170 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 171 | @echo 172 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 173 | 174 | pseudoxml: 175 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 176 | @echo 177 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 178 | -------------------------------------------------------------------------------- /make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source 10 | set I18NSPHINXOPTS=%SPHINXOPTS% source 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 31 | echo. text to make text files 32 | echo. man to make manual pages 33 | echo. texinfo to make Texinfo files 34 | echo. gettext to make PO message catalogs 35 | echo. changes to make an overview over all changed/added/deprecated items 36 | echo. xml to make Docutils-native XML files 37 | echo. pseudoxml to make pseudoxml-XML files for display purposes 38 | echo. linkcheck to check all external links for integrity 39 | echo. doctest to run all doctests embedded in the documentation if enabled 40 | goto end 41 | ) 42 | 43 | if "%1" == "clean" ( 44 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 45 | del /q /s %BUILDDIR%\* 46 | goto end 47 | ) 48 | 49 | 50 | %SPHINXBUILD% 2> nul 51 | if errorlevel 9009 ( 52 | echo. 53 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 54 | echo.installed, then set the SPHINXBUILD environment variable to point 55 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 56 | echo.may add the Sphinx directory to PATH. 57 | echo. 58 | echo.If you don't have Sphinx installed, grab it from 59 | echo.http://sphinx-doc.org/ 60 | exit /b 1 61 | ) 62 | 63 | if "%1" == "html" ( 64 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 65 | if errorlevel 1 exit /b 1 66 | echo. 67 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 68 | goto end 69 | ) 70 | 71 | if "%1" == "dirhtml" ( 72 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 73 | if errorlevel 1 exit /b 1 74 | echo. 75 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 76 | goto end 77 | ) 78 | 79 | if "%1" == "singlehtml" ( 80 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 81 | if errorlevel 1 exit /b 1 82 | echo. 83 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 84 | goto end 85 | ) 86 | 87 | if "%1" == "pickle" ( 88 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 89 | if errorlevel 1 exit /b 1 90 | echo. 91 | echo.Build finished; now you can process the pickle files. 92 | goto end 93 | ) 94 | 95 | if "%1" == "json" ( 96 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 97 | if errorlevel 1 exit /b 1 98 | echo. 99 | echo.Build finished; now you can process the JSON files. 100 | goto end 101 | ) 102 | 103 | if "%1" == "htmlhelp" ( 104 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 105 | if errorlevel 1 exit /b 1 106 | echo. 107 | echo.Build finished; now you can run HTML Help Workshop with the ^ 108 | .hhp project file in %BUILDDIR%/htmlhelp. 109 | goto end 110 | ) 111 | 112 | if "%1" == "qthelp" ( 113 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 114 | if errorlevel 1 exit /b 1 115 | echo. 116 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 117 | .qhcp project file in %BUILDDIR%/qthelp, like this: 118 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\StatisticalMechanics.qhcp 119 | echo.To view the help file: 120 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\StatisticalMechanics.ghc 121 | goto end 122 | ) 123 | 124 | if "%1" == "devhelp" ( 125 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 126 | if errorlevel 1 exit /b 1 127 | echo. 128 | echo.Build finished. 129 | goto end 130 | ) 131 | 132 | if "%1" == "epub" ( 133 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 134 | if errorlevel 1 exit /b 1 135 | echo. 136 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 137 | goto end 138 | ) 139 | 140 | if "%1" == "latex" ( 141 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 142 | if errorlevel 1 exit /b 1 143 | echo. 144 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 145 | goto end 146 | ) 147 | 148 | if "%1" == "latexpdf" ( 149 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 150 | cd %BUILDDIR%/latex 151 | make all-pdf 152 | cd %BUILDDIR%/.. 153 | echo. 154 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 155 | goto end 156 | ) 157 | 158 | if "%1" == "latexpdfja" ( 159 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 160 | cd %BUILDDIR%/latex 161 | make all-pdf-ja 162 | cd %BUILDDIR%/.. 163 | echo. 164 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 165 | goto end 166 | ) 167 | 168 | if "%1" == "text" ( 169 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 170 | if errorlevel 1 exit /b 1 171 | echo. 172 | echo.Build finished. The text files are in %BUILDDIR%/text. 173 | goto end 174 | ) 175 | 176 | if "%1" == "man" ( 177 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 178 | if errorlevel 1 exit /b 1 179 | echo. 180 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 181 | goto end 182 | ) 183 | 184 | if "%1" == "texinfo" ( 185 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 186 | if errorlevel 1 exit /b 1 187 | echo. 188 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 189 | goto end 190 | ) 191 | 192 | if "%1" == "gettext" ( 193 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 194 | if errorlevel 1 exit /b 1 195 | echo. 196 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 197 | goto end 198 | ) 199 | 200 | if "%1" == "changes" ( 201 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 202 | if errorlevel 1 exit /b 1 203 | echo. 204 | echo.The overview file is in %BUILDDIR%/changes. 205 | goto end 206 | ) 207 | 208 | if "%1" == "linkcheck" ( 209 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 210 | if errorlevel 1 exit /b 1 211 | echo. 212 | echo.Link check complete; look for any errors in the above output ^ 213 | or in %BUILDDIR%/linkcheck/output.txt. 214 | goto end 215 | ) 216 | 217 | if "%1" == "doctest" ( 218 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 219 | if errorlevel 1 exit /b 1 220 | echo. 221 | echo.Testing of doctests in the sources finished, look at the ^ 222 | results in %BUILDDIR%/doctest/output.txt. 223 | goto end 224 | ) 225 | 226 | if "%1" == "xml" ( 227 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml 228 | if errorlevel 1 exit /b 1 229 | echo. 230 | echo.Build finished. The XML files are in %BUILDDIR%/xml. 231 | goto end 232 | ) 233 | 234 | if "%1" == "pseudoxml" ( 235 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml 236 | if errorlevel 1 exit /b 1 237 | echo. 238 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. 239 | goto end 240 | ) 241 | 242 | :end 243 | -------------------------------------------------------------------------------- /docs/_static/pyramid.css: -------------------------------------------------------------------------------- 1 | /* 2 | * pyramid.css_t 3 | * ~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- pylons theme. 6 | * 7 | * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | @import url("basic.css"); 13 | 14 | /* -- page layout ----------------------------------------------------------- */ 15 | 16 | body { 17 | font-family: "Nobile", sans-serif; 18 | font-size: 100%; 19 | background-color: #393939; 20 | color: #ffffff; 21 | margin: 0; 22 | padding: 0; 23 | } 24 | 25 | div.documentwrapper { 26 | float: left; 27 | width: 100%; 28 | } 29 | 30 | div.bodywrapper { 31 | margin: 0 0 0 230px; 32 | } 33 | 34 | hr { 35 | border: 1px solid #B1B4B6; 36 | } 37 | 38 | div.document { 39 | background-color: #eee; 40 | } 41 | 42 | div.header { 43 | width:100%; 44 | background: #f4ad32 url(headerbg.png) repeat-x 0 top; 45 | border-bottom: 2px solid #ffffff; 46 | } 47 | 48 | div.logo { 49 | text-align: center; 50 | padding-top: 10px; 51 | } 52 | 53 | div.body { 54 | background-color: #ffffff; 55 | color: #3E4349; 56 | padding: 0 30px 30px 30px; 57 | font-size: 1em; 58 | border: 2px solid #ddd; 59 | border-right-style: none; 60 | overflow: auto; 61 | } 62 | 63 | div.footer { 64 | color: #ffffff; 65 | width: 100%; 66 | padding: 13px 0; 67 | text-align: center; 68 | font-size: 75%; 69 | background: transparent; 70 | clear:both; 71 | } 72 | 73 | div.footer a { 74 | color: #ffffff; 75 | text-decoration: none; 76 | } 77 | 78 | div.footer a:hover { 79 | color: #e88f00; 80 | text-decoration: underline; 81 | } 82 | 83 | div.related { 84 | line-height: 30px; 85 | color: #373839; 86 | font-size: 0.8em; 87 | background-color: #eee; 88 | } 89 | 90 | div.related a { 91 | color: #1b61d6; 92 | } 93 | 94 | div.related ul { 95 | padding-left: 240px; 96 | } 97 | 98 | div.sphinxsidebar { 99 | font-size: 0.75em; 100 | line-height: 1.5em; 101 | } 102 | 103 | div.sphinxsidebarwrapper{ 104 | padding: 10px 0; 105 | } 106 | 107 | div.sphinxsidebar h3, 108 | div.sphinxsidebar h4 { 109 | font-family: "Neuton", sans-serif; 110 | color: #373839; 111 | font-size: 1.4em; 112 | font-weight: normal; 113 | margin: 0; 114 | padding: 5px 10px; 115 | border-bottom: 2px solid #ddd; 116 | } 117 | 118 | div.sphinxsidebar h4{ 119 | font-size: 1.3em; 120 | } 121 | 122 | div.sphinxsidebar h3 a { 123 | color: #000000; 124 | } 125 | 126 | 127 | div.sphinxsidebar p { 128 | color: #888; 129 | padding: 5px 20px; 130 | } 131 | 132 | div.sphinxsidebar p.topless { 133 | } 134 | 135 | div.sphinxsidebar ul { 136 | margin: 10px 20px; 137 | padding: 0; 138 | color: #373839; 139 | } 140 | 141 | div.sphinxsidebar a { 142 | color: #444; 143 | } 144 | 145 | div.sphinxsidebar input { 146 | border: 1px solid #ccc; 147 | font-family: sans-serif; 148 | font-size: 1em; 149 | } 150 | 151 | div.sphinxsidebar input[type=text]{ 152 | margin-left: 20px; 153 | } 154 | 155 | /* -- sidebars -------------------------------------------------------------- */ 156 | 157 | div.sidebar { 158 | margin: 0 0 0.5em 1em; 159 | border: 2px solid #c6d880; 160 | background-color: #e6efc2; 161 | width: 40%; 162 | float: right; 163 | border-right-style: none; 164 | border-left-style: none; 165 | padding: 10px 20px; 166 | } 167 | 168 | p.sidebar-title { 169 | font-weight: bold; 170 | } 171 | 172 | /* -- body styles ----------------------------------------------------------- */ 173 | 174 | a, a .pre { 175 | color: #1b61d6; 176 | text-decoration: none; 177 | } 178 | 179 | a:hover, a:hover .pre { 180 | text-decoration: underline; 181 | } 182 | 183 | div.body h1, 184 | div.body h2, 185 | div.body h3, 186 | div.body h4, 187 | div.body h5, 188 | div.body h6 { 189 | font-family: "Neuton", sans-serif; 190 | background-color: #ffffff; 191 | font-weight: normal; 192 | color: #373839; 193 | margin: 30px 0px 10px 0px; 194 | padding: 5px 0; 195 | } 196 | 197 | div.body h1 { border-top: 20px solid white; margin-top: 0; font-size: 200%; } 198 | div.body h2 { font-size: 150%; background-color: #ffffff; } 199 | div.body h3 { font-size: 120%; background-color: #ffffff; } 200 | div.body h4 { font-size: 110%; background-color: #ffffff; } 201 | div.body h5 { font-size: 100%; background-color: #ffffff; } 202 | div.body h6 { font-size: 100%; background-color: #ffffff; } 203 | 204 | a.headerlink { 205 | color: #1b61d6; 206 | font-size: 0.8em; 207 | padding: 0 4px 0 4px; 208 | text-decoration: none; 209 | } 210 | 211 | a.headerlink:hover { 212 | text-decoration: underline; 213 | } 214 | 215 | div.body p, div.body dd, div.body li { 216 | line-height: 1.5em; 217 | } 218 | 219 | div.admonition p.admonition-title + p { 220 | display: inline; 221 | } 222 | 223 | div.admonition { 224 | background: #eeeeec; 225 | border: 2px solid #babdb6; 226 | border-right-style: none; 227 | border-left-style: none; 228 | padding: 10px 20px 10px 60px; 229 | } 230 | 231 | div.highlight{ 232 | background-color: white; 233 | } 234 | 235 | div.note { 236 | border: 2px solid #7a9eec; 237 | border-right-style: none; 238 | border-left-style: none; 239 | padding: 10px 20px 10px 60px; 240 | background: #e1ecfe url(dialog-note.png) no-repeat 10px 8px; 241 | } 242 | 243 | div.seealso { 244 | background: #fff6bf url(dialog-seealso.png) no-repeat 10px 8px; 245 | border: 2px solid #ffd324; 246 | border-left-style: none; 247 | border-right-style: none; 248 | padding: 10px 20px 10px 60px; 249 | } 250 | 251 | div.topic { 252 | background: #eeeeee; 253 | border: 2px solid #C6C9CB; 254 | padding: 10px 20px; 255 | border-right-style: none; 256 | border-left-style: none; 257 | } 258 | 259 | div.warning { 260 | background: #fbe3e4 url(dialog-warning.png) no-repeat 10px 8px; 261 | border: 2px solid #fbc2c4; 262 | border-right-style: none; 263 | border-left-style: none; 264 | padding: 10px 20px 10px 60px; 265 | } 266 | 267 | div.admonition-todo { 268 | background: #f2d9b4 url(dialog-todo.png) no-repeat 10px 8px; 269 | border: 2px solid #e9b96e; 270 | border-right-style: none; 271 | border-left-style: none; 272 | padding: 10px 20px 10px 60px; 273 | } 274 | 275 | div.note p.admonition-title, 276 | div.warning p.admonition-title, 277 | div.seealso p.admonition-title, 278 | div.admonition-todo p.admonition-title { 279 | display: none; 280 | } 281 | 282 | p.admonition-title:after { 283 | content: ":"; 284 | } 285 | 286 | pre { 287 | padding: 10px; 288 | background-color: #fafafa; 289 | color: #222; 290 | line-height: 1.2em; 291 | border: 2px solid #C6C9CB; 292 | font-size: 1.1em; 293 | margin: 1.5em 0 1.5em 0; 294 | border-right-style: none; 295 | border-left-style: none; 296 | } 297 | 298 | code { 299 | background-color: transparent; 300 | color: #222; 301 | font-size: 1.1em; 302 | font-family: monospace; 303 | } 304 | 305 | .viewcode-back { 306 | font-family: "Nobile", sans-serif; 307 | } 308 | 309 | div.viewcode-block:target { 310 | background-color: #fff6bf; 311 | border: 2px solid #ffd324; 312 | border-left-style: none; 313 | border-right-style: none; 314 | padding: 10px 20px; 315 | } 316 | 317 | table.highlighttable { 318 | width: 100%; 319 | } 320 | 321 | table.highlighttable td { 322 | padding: 0; 323 | } 324 | 325 | a em.std-term { 326 | color: #007f00; 327 | } 328 | 329 | a:hover em.std-term { 330 | text-decoration: underline; 331 | } 332 | 333 | .download { 334 | font-family: "Nobile", sans-serif; 335 | font-weight: normal; 336 | font-style: normal; 337 | } 338 | 339 | code.xref { 340 | font-weight: normal; 341 | font-style: normal; 342 | } 343 | 344 | div.code-block-caption { 345 | background-color: #ddd; 346 | color: #222; 347 | } -------------------------------------------------------------------------------- /docs/introduction.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1. Introduction — Introduction to Statistical Mechanics 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 39 | 54 | 55 |
56 |
57 |
58 |
59 | 60 |
61 |

1. Introduction

62 |

Depending on how you look at it, statistical mechanics is either the least fundamental or most fundamental of all fields 63 | of physics. That is because it is not really science at all. It is pure mathematics.

64 |

In other subjects, you learn about “natural laws”: Newton’s second law, Maxwell’s equations, Schrödinger’s equation, 65 | etc. These laws are not derived from anything else. They were discovered experimentally and then assumed to reflect 66 | fundamental aspects of reality. But statistical mechanics does not involve any natural laws of this sort. Instead, it 67 | is a set of techniques that can be applied to nearly any physical system, no matter what laws that system obeys. That 68 | is why I call it the most fundamental field of physics. New theories may replace old ones, and natural laws may turn 69 | out to be merely approximations to deeper laws. But statistical mechanics remains valid through it all, and whatever 70 | new laws are discovered, it will almost certainly work just as well with them as it did with the old ones.

71 |

Statistical mechanics was developed in the second half of the 19th century. It was primarily the work of Ludwig 72 | Boltzmann, who personally published more than a hundred papers on the subject during his lifetime. Other scientists 73 | also contributed to it, of course, especially James Clerk Maxwell (the same one Maxwell’s equations are named after) and 74 | Josiah Willard Gibbs.

75 |

It grew out of thermodynamics, an earlier theory that described the behavior of a mysterious substance called “heat” or 76 | “caloric”. Thermodynamics was a physical theory of the more conventional sort. It involved natural laws discovered by 77 | experiment, and made no claims about why those laws happened to hold. Caloric was supposed to be a substance much like 78 | other forms of matter. But this view turned out to be incorrect. Heat is actually an emergent phenomenon: a 79 | mathematical quantity defined in terms of a more detailed theory (the movement of individual atoms). The “laws” of 80 | thermodynamics can be derived from that deeper theory by applying statistical techniques. If you ignore the details of 81 | how each atom is moving, you find they collectively behave in a way that resembles a continuous fluid. That is what 82 | statistical mechanics is all about: deriving high level descriptions by starting from lower level ones and then 83 | averaging out lots of details.

84 |

Is it possible other theories could be explained in the same way? That is an open question, and a fascinating one. 85 | Many physicists suspect gravity is an emergent phenomenon, that it arises from the collective behavior of some deeper 86 | degrees of freedom. Statistical interpretations have also been proposed for quantum mechanics. These are all very 87 | speculative, of course, and they could easily turn out to be wrong. But they also could easily turn out to be right. 88 | Based on what we know today, it is entirely possible that the very structure of spacetime is a consequence of 89 | statistical mechanics.

90 |
91 | 92 | 93 |
94 |
95 |
96 | 119 |
120 |
121 | 136 | 140 | 141 | -------------------------------------------------------------------------------- /docs/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function(x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function(s) { 48 | if (typeof s == 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function(text, className) { 69 | function highlight(node) { 70 | if (node.nodeType == 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { 74 | var span = document.createElement("span"); 75 | span.className = className; 76 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 77 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 78 | document.createTextNode(val.substr(pos + text.length)), 79 | node.nextSibling)); 80 | node.nodeValue = val.substr(0, pos); 81 | } 82 | } 83 | else if (!jQuery(node).is("button, select, textarea")) { 84 | jQuery.each(node.childNodes, function() { 85 | highlight(this); 86 | }); 87 | } 88 | } 89 | return this.each(function() { 90 | highlight(this); 91 | }); 92 | }; 93 | 94 | /* 95 | * backward compatibility for jQuery.browser 96 | * This will be supported until firefox bug is fixed. 97 | */ 98 | if (!jQuery.browser) { 99 | jQuery.uaMatch = function(ua) { 100 | ua = ua.toLowerCase(); 101 | 102 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 103 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 104 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 105 | /(msie) ([\w.]+)/.exec(ua) || 106 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 107 | []; 108 | 109 | return { 110 | browser: match[ 1 ] || "", 111 | version: match[ 2 ] || "0" 112 | }; 113 | }; 114 | jQuery.browser = {}; 115 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 116 | } 117 | 118 | /** 119 | * Small JavaScript module for the documentation. 120 | */ 121 | var Documentation = { 122 | 123 | init : function() { 124 | this.fixFirefoxAnchorBug(); 125 | this.highlightSearchWords(); 126 | this.initIndexTable(); 127 | }, 128 | 129 | /** 130 | * i18n support 131 | */ 132 | TRANSLATIONS : {}, 133 | PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, 134 | LOCALE : 'unknown', 135 | 136 | // gettext and ngettext don't access this so that the functions 137 | // can safely bound to a different name (_ = Documentation.gettext) 138 | gettext : function(string) { 139 | var translated = Documentation.TRANSLATIONS[string]; 140 | if (typeof translated == 'undefined') 141 | return string; 142 | return (typeof translated == 'string') ? translated : translated[0]; 143 | }, 144 | 145 | ngettext : function(singular, plural, n) { 146 | var translated = Documentation.TRANSLATIONS[singular]; 147 | if (typeof translated == 'undefined') 148 | return (n == 1) ? singular : plural; 149 | return translated[Documentation.PLURALEXPR(n)]; 150 | }, 151 | 152 | addTranslations : function(catalog) { 153 | for (var key in catalog.messages) 154 | this.TRANSLATIONS[key] = catalog.messages[key]; 155 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 156 | this.LOCALE = catalog.locale; 157 | }, 158 | 159 | /** 160 | * add context elements like header anchor links 161 | */ 162 | addContextElements : function() { 163 | $('div[id] > :header:first').each(function() { 164 | $('\u00B6'). 165 | attr('href', '#' + this.id). 166 | attr('title', _('Permalink to this headline')). 167 | appendTo(this); 168 | }); 169 | $('dt[id]').each(function() { 170 | $('\u00B6'). 171 | attr('href', '#' + this.id). 172 | attr('title', _('Permalink to this definition')). 173 | appendTo(this); 174 | }); 175 | }, 176 | 177 | /** 178 | * workaround a firefox stupidity 179 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 180 | */ 181 | fixFirefoxAnchorBug : function() { 182 | if (document.location.hash) 183 | window.setTimeout(function() { 184 | document.location.href += ''; 185 | }, 10); 186 | }, 187 | 188 | /** 189 | * highlight the search words provided in the url in the text 190 | */ 191 | highlightSearchWords : function() { 192 | var params = $.getQueryParameters(); 193 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 194 | if (terms.length) { 195 | var body = $('div.body'); 196 | if (!body.length) { 197 | body = $('body'); 198 | } 199 | window.setTimeout(function() { 200 | $.each(terms, function() { 201 | body.highlightText(this.toLowerCase(), 'highlighted'); 202 | }); 203 | }, 10); 204 | $('') 206 | .appendTo($('#searchbox')); 207 | } 208 | }, 209 | 210 | /** 211 | * init the domain index toggle buttons 212 | */ 213 | initIndexTable : function() { 214 | var togglers = $('img.toggler').click(function() { 215 | var src = $(this).attr('src'); 216 | var idnum = $(this).attr('id').substr(7); 217 | $('tr.cg-' + idnum).toggle(); 218 | if (src.substr(-9) == 'minus.png') 219 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 220 | else 221 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 222 | }).css('display', ''); 223 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 224 | togglers.click(); 225 | } 226 | }, 227 | 228 | /** 229 | * helper function to hide the search marks again 230 | */ 231 | hideSearchWords : function() { 232 | $('#searchbox .highlight-link').fadeOut(300); 233 | $('span.highlighted').removeClass('highlighted'); 234 | }, 235 | 236 | /** 237 | * make the url absolute 238 | */ 239 | makeURL : function(relativeURL) { 240 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 241 | }, 242 | 243 | /** 244 | * get the current relative url 245 | */ 246 | getCurrentURL : function() { 247 | var path = document.location.pathname; 248 | var parts = path.split(/\//); 249 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 250 | if (this == '..') 251 | parts.pop(); 252 | }); 253 | var url = parts.join('/'); 254 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 255 | } 256 | }; 257 | 258 | // quick alias for translations 259 | _ = Documentation.gettext; 260 | 261 | $(document).ready(function() { 262 | Documentation.init(); 263 | }); 264 | -------------------------------------------------------------------------------- /docs/_images/oscillator_trajectory.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 27 | 32 | 33 | 40 | 45 | 46 | 53 | 58 | 59 | 66 | 71 | 72 | 79 | 84 | 85 | 92 | 97 | 98 | 105 | 110 | 111 | 118 | 125 | 126 | 148 | 155 | 156 | 158 | 159 | 161 | image/svg+xml 162 | 164 | 165 | 166 | 167 | 168 | 173 | 177 | 181 | x 191 | p 201 | 211 | 215 | 219 | 223 | 227 | 228 | 229 | -------------------------------------------------------------------------------- /source/images/oscillator_trajectory.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 27 | 32 | 33 | 40 | 45 | 46 | 53 | 58 | 59 | 66 | 71 | 72 | 79 | 84 | 85 | 92 | 97 | 98 | 105 | 110 | 111 | 118 | 125 | 126 | 148 | 155 | 156 | 158 | 159 | 161 | image/svg+xml 162 | 164 | 165 | 166 | 167 | 168 | 173 | 177 | 181 | x 191 | p 201 | 211 | 215 | 219 | 223 | 227 | 228 | 229 | -------------------------------------------------------------------------------- /docs/_images/water_phase_diagram.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 27 | 32 | 33 | 40 | 45 | 46 | 53 | 58 | 59 | 66 | 71 | 72 | 79 | 84 | 85 | 89 | 96 | 101 | 102 | 109 | 114 | 115 | 122 | 123 | 143 | 147 | 151 | 155 | 159 | 166 | 167 | 169 | 170 | 172 | image/svg+xml 173 | 175 | 176 | 177 | 178 | 179 | 184 | 188 | 192 | 197 | Temperature 207 | Pressure 218 | Solid 228 | Gas 238 | Liquid 248 | 249 | 250 | -------------------------------------------------------------------------------- /source/images/water_phase_diagram.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 27 | 32 | 33 | 40 | 45 | 46 | 53 | 58 | 59 | 66 | 71 | 72 | 79 | 84 | 85 | 89 | 96 | 101 | 102 | 109 | 114 | 115 | 122 | 123 | 143 | 147 | 151 | 155 | 159 | 166 | 167 | 169 | 170 | 172 | image/svg+xml 173 | 175 | 176 | 177 | 178 | 179 | 184 | 188 | 192 | 197 | Temperature 207 | Pressure 218 | Solid 228 | Gas 238 | Liquid 248 | 249 | 250 | -------------------------------------------------------------------------------- /docs/_static/water_phase_diagram.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 27 | 32 | 33 | 40 | 45 | 46 | 53 | 58 | 59 | 66 | 71 | 72 | 79 | 84 | 85 | 89 | 96 | 101 | 102 | 109 | 114 | 115 | 122 | 123 | 143 | 147 | 151 | 155 | 159 | 162 | 163 | 165 | 166 | 168 | image/svg+xml 169 | 171 | 172 | 173 | 174 | 175 | 179 | 183 | 187 | 191 | Temperature 201 | Pressure 212 | Solid 222 | Gas 232 | Liquid 242 | 243 | 244 | -------------------------------------------------------------------------------- /docs/_images/ising_phase_diagram.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 27 | 32 | 33 | 40 | 45 | 46 | 53 | 58 | 59 | 66 | 71 | 72 | 79 | 84 | 85 | 89 | 96 | 101 | 102 | 109 | 114 | 115 | 122 | 123 | 144 | 148 | 152 | 156 | 160 | 167 | 168 | 170 | 171 | 173 | image/svg+xml 174 | 176 | 177 | 178 | 179 | 180 | 185 | 190 | Temperature 200 | Magnetic Field 215 | 220 | 225 | M > 0 235 | M < 0 245 | 250 | Ferromagnetic 260 | Paramagnetic 270 | 271 | 272 | -------------------------------------------------------------------------------- /source/images/ising_phase_diagram.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 27 | 32 | 33 | 40 | 45 | 46 | 53 | 58 | 59 | 66 | 71 | 72 | 79 | 84 | 85 | 89 | 96 | 101 | 102 | 109 | 114 | 115 | 122 | 123 | 144 | 148 | 152 | 156 | 160 | 167 | 168 | 170 | 171 | 173 | image/svg+xml 174 | 176 | 177 | 178 | 179 | 180 | 185 | 190 | Temperature 200 | Magnetic Field 215 | 220 | 225 | M > 0 235 | M < 0 245 | 250 | Ferromagnetic 260 | Paramagnetic 270 | 271 | 272 | -------------------------------------------------------------------------------- /docs/_static/underscore.js: -------------------------------------------------------------------------------- 1 | // Underscore.js 1.3.1 2 | // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. 3 | // Underscore is freely distributable under the MIT license. 4 | // Portions of Underscore are inspired or borrowed from Prototype, 5 | // Oliver Steele's Functional, and John Resig's Micro-Templating. 6 | // For all details and documentation: 7 | // http://documentcloud.github.com/underscore 8 | (function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== 9 | c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, 10 | h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= 11 | b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a== 12 | null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= 13 | function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= 14 | e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= 15 | function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, 17 | c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; 24 | b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, 25 | 1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; 26 | b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; 27 | b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), 28 | function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ 29 | u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= 30 | function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= 31 | true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); 32 | -------------------------------------------------------------------------------- /source/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Statistical Mechanics documentation build configuration file, created by 4 | # sphinx-quickstart on Sun Jun 22 14:04:24 2014. 5 | # 6 | # This file is execfile()d with the current directory set to its 7 | # containing dir. 8 | # 9 | # Note that not all possible configuration values are present in this 10 | # autogenerated file. 11 | # 12 | # All configuration values have a default; values that are commented out 13 | # serve to show the default. 14 | 15 | import sys 16 | import os 17 | 18 | # If extensions (or modules to document with autodoc) are in another directory, 19 | # add these directories to sys.path here. If the directory is relative to the 20 | # documentation root, use os.path.abspath to make it absolute, like shown here. 21 | #sys.path.insert(0, os.path.abspath('.')) 22 | 23 | sys.path.insert(0, os.path.abspath('.')) 24 | 25 | # -- General configuration ------------------------------------------------ 26 | 27 | # If your documentation needs a minimal Sphinx version, state it here. 28 | #needs_sphinx = '1.0' 29 | 30 | # Add any Sphinx extension module names here, as strings. They can be 31 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 32 | # ones. 33 | extensions = [ 34 | 'sphinx.ext.todo', 35 | 'sphinx.ext.mathjax', 36 | 'numsec', 37 | 'autonumber' 38 | ] 39 | 40 | # Add any paths that contain templates here, relative to this directory. 41 | templates_path = ['_templates'] 42 | 43 | # The suffix of source filenames. 44 | source_suffix = '.rst' 45 | 46 | # The encoding of source files. 47 | #source_encoding = 'utf-8-sig' 48 | 49 | # The master toctree document. 50 | master_doc = 'index' 51 | 52 | # General information about the project. 53 | project = u'Introduction to Statistical Mechanics' 54 | copyright = u'2014-2015, Peter Eastman' 55 | 56 | # The version info for the project you're documenting, acts as replacement for 57 | # |version| and |release|, also used in various other places throughout the 58 | # built documents. 59 | # 60 | # The short X.Y version. 61 | version = '' 62 | # The full version, including alpha/beta/rc tags. 63 | release = '' 64 | 65 | # The language for content autogenerated by Sphinx. Refer to documentation 66 | # for a list of supported languages. 67 | #language = None 68 | 69 | # There are two options for replacing |today|: either, you set today to some 70 | # non-false value, then it is used: 71 | #today = '' 72 | # Else, today_fmt is used as the format for a strftime call. 73 | #today_fmt = '%B %d, %Y' 74 | 75 | # List of patterns, relative to source directory, that match files and 76 | # directories to ignore when looking for source files. 77 | exclude_patterns = [] 78 | 79 | # The reST default role (used for this markup: `text`) to use for all 80 | # documents. 81 | #default_role = None 82 | 83 | # If true, '()' will be appended to :func: etc. cross-reference text. 84 | #add_function_parentheses = True 85 | 86 | # If true, the current module name will be prepended to all description 87 | # unit titles (such as .. function::). 88 | #add_module_names = True 89 | 90 | # If true, sectionauthor and moduleauthor directives will be shown in the 91 | # output. They are ignored by default. 92 | #show_authors = False 93 | 94 | # The name of the Pygments (syntax highlighting) style to use. 95 | pygments_style = 'sphinx' 96 | 97 | # A list of ignored prefixes for module index sorting. 98 | #modindex_common_prefix = [] 99 | 100 | # If true, keep warnings as "system message" paragraphs in the built documents. 101 | #keep_warnings = False 102 | 103 | 104 | # -- Options for HTML output ---------------------------------------------- 105 | 106 | # The theme to use for HTML and HTML Help pages. See the documentation for 107 | # a list of builtin themes. 108 | html_theme = 'pyramid' 109 | 110 | # Theme options are theme-specific and customize the look and feel of a theme 111 | # further. For a list of options available for each theme, see the 112 | # documentation. 113 | #html_theme_options = {} 114 | 115 | # Add any paths that contain custom themes here, relative to this directory. 116 | #html_theme_path = [] 117 | 118 | # The name for this set of Sphinx documents. If None, it defaults to 119 | # " v documentation". 120 | html_title = project 121 | 122 | # A shorter title for the navigation bar. Default is the same as html_title. 123 | #html_short_title = None 124 | 125 | # The name of an image file (relative to this directory) to place at the top 126 | # of the sidebar. 127 | #html_logo = None 128 | 129 | # The name of an image file (within the static path) to use as favicon of the 130 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 131 | # pixels large. 132 | #html_favicon = None 133 | 134 | # Add any paths that contain custom static files (such as style sheets) here, 135 | # relative to this directory. They are copied after the builtin static files, 136 | # so a file named "default.css" will overwrite the builtin "default.css". 137 | html_static_path = ['_static'] 138 | 139 | # Add any extra paths that contain custom files (such as robots.txt or 140 | # .htaccess) here, relative to this directory. These files are copied 141 | # directly to the root of the documentation. 142 | #html_extra_path = [] 143 | 144 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 145 | # using the given strftime format. 146 | #html_last_updated_fmt = '%b %d, %Y' 147 | 148 | # If true, SmartyPants will be used to convert quotes and dashes to 149 | # typographically correct entities. 150 | #html_use_smartypants = True 151 | 152 | # Custom sidebar templates, maps document names to template names. 153 | #html_sidebars = {} 154 | 155 | # Additional templates that should be rendered to pages, maps page names to 156 | # template names. 157 | #html_additional_pages = {} 158 | 159 | # If false, no module index is generated. 160 | #html_domain_indices = True 161 | 162 | # If false, no index is generated. 163 | #html_use_index = True 164 | 165 | # If true, the index is split into individual pages for each letter. 166 | #html_split_index = False 167 | 168 | # If true, links to the reST sources are added to the pages. 169 | #html_show_sourcelink = True 170 | 171 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 172 | #html_show_sphinx = True 173 | 174 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 175 | #html_show_copyright = True 176 | 177 | # If true, an OpenSearch description file will be output, and all pages will 178 | # contain a tag referring to it. The value of this option must be the 179 | # base URL from which the finished HTML is served. 180 | #html_use_opensearch = '' 181 | 182 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 183 | #html_file_suffix = None 184 | 185 | # Output file base name for HTML help builder. 186 | htmlhelp_basename = 'StatisticalMechanics' 187 | 188 | 189 | # -- Options for LaTeX output --------------------------------------------- 190 | 191 | latex_elements = { 192 | 'releasename': '' 193 | 194 | # The paper size ('letterpaper' or 'a4paper'). 195 | #'papersize': 'letterpaper', 196 | 197 | # The font size ('10pt', '11pt' or '12pt'). 198 | #'pointsize': '10pt', 199 | 200 | # Additional stuff for the LaTeX preamble. 201 | #'preamble': '', 202 | } 203 | 204 | # Grouping the document tree into LaTeX files. List of tuples 205 | # (source start file, target name, title, 206 | # author, documentclass [howto, manual, or own class]). 207 | latex_documents = [ 208 | ('index', 'StatisticalMechanics.tex', u'Introduction to Statistical Mechanics', 209 | u'Peter Eastman', 'manual'), 210 | ] 211 | 212 | # The name of an image file (relative to this directory) to place at the top of 213 | # the title page. 214 | #latex_logo = None 215 | 216 | # For "manual" documents, if this is true, then toplevel headings are parts, 217 | # not chapters. 218 | #latex_use_parts = False 219 | 220 | # If true, show page references after internal links. 221 | #latex_show_pagerefs = False 222 | 223 | # If true, show URL addresses after external links. 224 | #latex_show_urls = False 225 | 226 | # Documents to append as an appendix to all manuals. 227 | #latex_appendices = [] 228 | 229 | # If false, no module index is generated. 230 | #latex_domain_indices = True 231 | 232 | 233 | # -- Options for manual page output --------------------------------------- 234 | 235 | # One entry per manual page. List of tuples 236 | # (source start file, name, description, authors, manual section). 237 | man_pages = [ 238 | ('index', 'statisticalmechanics', u'Introduction to Statistical Mechanics', 239 | [u'Peter Eastman'], 1) 240 | ] 241 | 242 | # If true, show URL addresses after external links. 243 | #man_show_urls = False 244 | 245 | 246 | # -- Options for Texinfo output ------------------------------------------- 247 | 248 | # Grouping the document tree into Texinfo files. List of tuples 249 | # (source start file, target name, title, author, 250 | # dir menu entry, description, category) 251 | texinfo_documents = [ 252 | ('index', 'StatisticalMechanics', u'Introduction to Statistical Mechanics', 253 | u'Peter Eastman', 'StatisticalMechanics', 'One line description of project.', 254 | 'Miscellaneous'), 255 | ] 256 | 257 | # Documents to append as an appendix to all manuals. 258 | #texinfo_appendices = [] 259 | 260 | # If false, no module index is generated. 261 | #texinfo_domain_indices = True 262 | 263 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 264 | #texinfo_show_urls = 'footnote' 265 | 266 | # If true, do not generate a @detailmenu in the "Top" node's menu. 267 | #texinfo_no_detailmenu = False 268 | 269 | 270 | # -- Options for Epub output ---------------------------------------------- 271 | 272 | # Bibliographic Dublin Core info. 273 | epub_title = u'Introduction to Statistical Mechanics' 274 | epub_author = u'Peter Eastman' 275 | epub_publisher = u'Peter Eastman' 276 | epub_copyright = u'2014, Peter Eastman' 277 | 278 | # The basename for the epub file. It defaults to the project name. 279 | #epub_basename = u'Statistical Mechanics' 280 | 281 | # The HTML theme for the epub output. Since the default themes are not optimized 282 | # for small screen space, using the same theme for HTML and epub output is 283 | # usually not wise. This defaults to 'epub', a theme designed to save visual 284 | # space. 285 | #epub_theme = 'epub' 286 | 287 | # The language of the text. It defaults to the language option 288 | # or en if the language is not set. 289 | #epub_language = '' 290 | 291 | # The scheme of the identifier. Typical schemes are ISBN or URL. 292 | #epub_scheme = '' 293 | 294 | # The unique identifier of the text. This can be a ISBN number 295 | # or the project homepage. 296 | #epub_identifier = '' 297 | 298 | # A unique identification for the text. 299 | #epub_uid = '' 300 | 301 | # A tuple containing the cover image and cover page html template filenames. 302 | #epub_cover = () 303 | 304 | # A sequence of (type, uri, title) tuples for the guide element of content.opf. 305 | #epub_guide = () 306 | 307 | # HTML files that should be inserted before the pages created by sphinx. 308 | # The format is a list of tuples containing the path and title. 309 | #epub_pre_files = [] 310 | 311 | # HTML files shat should be inserted after the pages created by sphinx. 312 | # The format is a list of tuples containing the path and title. 313 | #epub_post_files = [] 314 | 315 | # A list of files that should not be packed into the epub file. 316 | epub_exclude_files = ['search.html'] 317 | 318 | # The depth of the table of contents in toc.ncx. 319 | #epub_tocdepth = 3 320 | 321 | # Allow duplicate toc entries. 322 | #epub_tocdup = True 323 | 324 | # Choose between 'default' and 'includehidden'. 325 | #epub_tocscope = 'default' 326 | 327 | # Fix unsupported image types using the PIL. 328 | #epub_fix_images = False 329 | 330 | # Scale large images. 331 | #epub_max_image_width = 0 332 | 333 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 334 | #epub_show_urls = 'inline' 335 | 336 | # If false, no index is generated. 337 | #epub_use_index = True 338 | -------------------------------------------------------------------------------- /docs/_static/basic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * basic.css 3 | * ~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- basic theme. 6 | * 7 | * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /* -- main layout ----------------------------------------------------------- */ 13 | 14 | div.clearer { 15 | clear: both; 16 | } 17 | 18 | /* -- relbar ---------------------------------------------------------------- */ 19 | 20 | div.related { 21 | width: 100%; 22 | font-size: 90%; 23 | } 24 | 25 | div.related h3 { 26 | display: none; 27 | } 28 | 29 | div.related ul { 30 | margin: 0; 31 | padding: 0 0 0 10px; 32 | list-style: none; 33 | } 34 | 35 | div.related li { 36 | display: inline; 37 | } 38 | 39 | div.related li.right { 40 | float: right; 41 | margin-right: 5px; 42 | } 43 | 44 | /* -- sidebar --------------------------------------------------------------- */ 45 | 46 | div.sphinxsidebarwrapper { 47 | padding: 10px 5px 0 10px; 48 | } 49 | 50 | div.sphinxsidebar { 51 | float: left; 52 | width: 230px; 53 | margin-left: -100%; 54 | font-size: 90%; 55 | } 56 | 57 | div.sphinxsidebar ul { 58 | list-style: none; 59 | } 60 | 61 | div.sphinxsidebar ul ul, 62 | div.sphinxsidebar ul.want-points { 63 | margin-left: 20px; 64 | list-style: square; 65 | } 66 | 67 | div.sphinxsidebar ul ul { 68 | margin-top: 0; 69 | margin-bottom: 0; 70 | } 71 | 72 | div.sphinxsidebar form { 73 | margin-top: 10px; 74 | } 75 | 76 | div.sphinxsidebar input { 77 | border: 1px solid #98dbcc; 78 | font-family: sans-serif; 79 | font-size: 1em; 80 | } 81 | 82 | div.sphinxsidebar #searchbox input[type="text"] { 83 | width: 170px; 84 | } 85 | 86 | div.sphinxsidebar #searchbox input[type="submit"] { 87 | width: 30px; 88 | } 89 | 90 | img { 91 | border: 0; 92 | max-width: 100%; 93 | } 94 | 95 | /* -- search page ----------------------------------------------------------- */ 96 | 97 | ul.search { 98 | margin: 10px 0 0 20px; 99 | padding: 0; 100 | } 101 | 102 | ul.search li { 103 | padding: 5px 0 5px 20px; 104 | background-image: url(file.png); 105 | background-repeat: no-repeat; 106 | background-position: 0 7px; 107 | } 108 | 109 | ul.search li a { 110 | font-weight: bold; 111 | } 112 | 113 | ul.search li div.context { 114 | color: #888; 115 | margin: 2px 0 0 30px; 116 | text-align: left; 117 | } 118 | 119 | ul.keywordmatches li.goodmatch a { 120 | font-weight: bold; 121 | } 122 | 123 | /* -- index page ------------------------------------------------------------ */ 124 | 125 | table.contentstable { 126 | width: 90%; 127 | } 128 | 129 | table.contentstable p.biglink { 130 | line-height: 150%; 131 | } 132 | 133 | a.biglink { 134 | font-size: 1.3em; 135 | } 136 | 137 | span.linkdescr { 138 | font-style: italic; 139 | padding-top: 5px; 140 | font-size: 90%; 141 | } 142 | 143 | /* -- general index --------------------------------------------------------- */ 144 | 145 | table.indextable { 146 | width: 100%; 147 | } 148 | 149 | table.indextable td { 150 | text-align: left; 151 | vertical-align: top; 152 | } 153 | 154 | table.indextable dl, table.indextable dd { 155 | margin-top: 0; 156 | margin-bottom: 0; 157 | } 158 | 159 | table.indextable tr.pcap { 160 | height: 10px; 161 | } 162 | 163 | table.indextable tr.cap { 164 | margin-top: 10px; 165 | background-color: #f2f2f2; 166 | } 167 | 168 | img.toggler { 169 | margin-right: 3px; 170 | margin-top: 3px; 171 | cursor: pointer; 172 | } 173 | 174 | div.modindex-jumpbox { 175 | border-top: 1px solid #ddd; 176 | border-bottom: 1px solid #ddd; 177 | margin: 1em 0 1em 0; 178 | padding: 0.4em; 179 | } 180 | 181 | div.genindex-jumpbox { 182 | border-top: 1px solid #ddd; 183 | border-bottom: 1px solid #ddd; 184 | margin: 1em 0 1em 0; 185 | padding: 0.4em; 186 | } 187 | 188 | /* -- general body styles --------------------------------------------------- */ 189 | 190 | a.headerlink { 191 | visibility: hidden; 192 | } 193 | 194 | h1:hover > a.headerlink, 195 | h2:hover > a.headerlink, 196 | h3:hover > a.headerlink, 197 | h4:hover > a.headerlink, 198 | h5:hover > a.headerlink, 199 | h6:hover > a.headerlink, 200 | dt:hover > a.headerlink, 201 | caption:hover > a.headerlink, 202 | p.caption:hover > a.headerlink, 203 | div.code-block-caption:hover > a.headerlink { 204 | visibility: visible; 205 | } 206 | 207 | div.body p.caption { 208 | text-align: inherit; 209 | } 210 | 211 | div.body td { 212 | text-align: left; 213 | } 214 | 215 | .field-list ul { 216 | padding-left: 1em; 217 | } 218 | 219 | .first { 220 | margin-top: 0 !important; 221 | } 222 | 223 | p.rubric { 224 | margin-top: 30px; 225 | font-weight: bold; 226 | } 227 | 228 | img.align-left, .figure.align-left, object.align-left { 229 | clear: left; 230 | float: left; 231 | margin-right: 1em; 232 | } 233 | 234 | img.align-right, .figure.align-right, object.align-right { 235 | clear: right; 236 | float: right; 237 | margin-left: 1em; 238 | } 239 | 240 | img.align-center, .figure.align-center, object.align-center { 241 | display: block; 242 | margin-left: auto; 243 | margin-right: auto; 244 | } 245 | 246 | .align-left { 247 | text-align: left; 248 | } 249 | 250 | .align-center { 251 | text-align: center; 252 | } 253 | 254 | .align-right { 255 | text-align: right; 256 | } 257 | 258 | /* -- sidebars -------------------------------------------------------------- */ 259 | 260 | div.sidebar { 261 | margin: 0 0 0.5em 1em; 262 | border: 1px solid #ddb; 263 | padding: 7px 7px 0 7px; 264 | background-color: #ffe; 265 | width: 40%; 266 | float: right; 267 | } 268 | 269 | p.sidebar-title { 270 | font-weight: bold; 271 | } 272 | 273 | /* -- topics ---------------------------------------------------------------- */ 274 | 275 | div.topic { 276 | border: 1px solid #ccc; 277 | padding: 7px 7px 0 7px; 278 | margin: 10px 0 10px 0; 279 | } 280 | 281 | p.topic-title { 282 | font-size: 1.1em; 283 | font-weight: bold; 284 | margin-top: 10px; 285 | } 286 | 287 | /* -- admonitions ----------------------------------------------------------- */ 288 | 289 | div.admonition { 290 | margin-top: 10px; 291 | margin-bottom: 10px; 292 | padding: 7px; 293 | } 294 | 295 | div.admonition dt { 296 | font-weight: bold; 297 | } 298 | 299 | div.admonition dl { 300 | margin-bottom: 0; 301 | } 302 | 303 | p.admonition-title { 304 | margin: 0px 10px 5px 0px; 305 | font-weight: bold; 306 | } 307 | 308 | div.body p.centered { 309 | text-align: center; 310 | margin-top: 25px; 311 | } 312 | 313 | /* -- tables ---------------------------------------------------------------- */ 314 | 315 | table.docutils { 316 | border: 0; 317 | border-collapse: collapse; 318 | } 319 | 320 | table caption span.caption-number { 321 | font-style: italic; 322 | } 323 | 324 | table caption span.caption-text { 325 | } 326 | 327 | table.docutils td, table.docutils th { 328 | padding: 1px 8px 1px 5px; 329 | border-top: 0; 330 | border-left: 0; 331 | border-right: 0; 332 | border-bottom: 1px solid #aaa; 333 | } 334 | 335 | table.field-list td, table.field-list th { 336 | border: 0 !important; 337 | } 338 | 339 | table.footnote td, table.footnote th { 340 | border: 0 !important; 341 | } 342 | 343 | th { 344 | text-align: left; 345 | padding-right: 5px; 346 | } 347 | 348 | table.citation { 349 | border-left: solid 1px gray; 350 | margin-left: 1px; 351 | } 352 | 353 | table.citation td { 354 | border-bottom: none; 355 | } 356 | 357 | /* -- figures --------------------------------------------------------------- */ 358 | 359 | div.figure { 360 | margin: 0.5em; 361 | padding: 0.5em; 362 | } 363 | 364 | div.figure p.caption { 365 | padding: 0.3em; 366 | } 367 | 368 | div.figure p.caption span.caption-number { 369 | font-style: italic; 370 | } 371 | 372 | div.figure p.caption span.caption-text { 373 | } 374 | 375 | 376 | /* -- other body styles ----------------------------------------------------- */ 377 | 378 | ol.arabic { 379 | list-style: decimal; 380 | } 381 | 382 | ol.loweralpha { 383 | list-style: lower-alpha; 384 | } 385 | 386 | ol.upperalpha { 387 | list-style: upper-alpha; 388 | } 389 | 390 | ol.lowerroman { 391 | list-style: lower-roman; 392 | } 393 | 394 | ol.upperroman { 395 | list-style: upper-roman; 396 | } 397 | 398 | dl { 399 | margin-bottom: 15px; 400 | } 401 | 402 | dd p { 403 | margin-top: 0px; 404 | } 405 | 406 | dd ul, dd table { 407 | margin-bottom: 10px; 408 | } 409 | 410 | dd { 411 | margin-top: 3px; 412 | margin-bottom: 10px; 413 | margin-left: 30px; 414 | } 415 | 416 | dt:target, .highlighted { 417 | background-color: #fbe54e; 418 | } 419 | 420 | dl.glossary dt { 421 | font-weight: bold; 422 | font-size: 1.1em; 423 | } 424 | 425 | .field-list ul { 426 | margin: 0; 427 | padding-left: 1em; 428 | } 429 | 430 | .field-list p { 431 | margin: 0; 432 | } 433 | 434 | .optional { 435 | font-size: 1.3em; 436 | } 437 | 438 | .sig-paren { 439 | font-size: larger; 440 | } 441 | 442 | .versionmodified { 443 | font-style: italic; 444 | } 445 | 446 | .system-message { 447 | background-color: #fda; 448 | padding: 5px; 449 | border: 3px solid red; 450 | } 451 | 452 | .footnote:target { 453 | background-color: #ffa; 454 | } 455 | 456 | .line-block { 457 | display: block; 458 | margin-top: 1em; 459 | margin-bottom: 1em; 460 | } 461 | 462 | .line-block .line-block { 463 | margin-top: 0; 464 | margin-bottom: 0; 465 | margin-left: 1.5em; 466 | } 467 | 468 | .guilabel, .menuselection { 469 | font-family: sans-serif; 470 | } 471 | 472 | .accelerator { 473 | text-decoration: underline; 474 | } 475 | 476 | .classifier { 477 | font-style: oblique; 478 | } 479 | 480 | abbr, acronym { 481 | border-bottom: dotted 1px; 482 | cursor: help; 483 | } 484 | 485 | /* -- code displays --------------------------------------------------------- */ 486 | 487 | pre { 488 | overflow: auto; 489 | overflow-y: hidden; /* fixes display issues on Chrome browsers */ 490 | } 491 | 492 | td.linenos pre { 493 | padding: 5px 0px; 494 | border: 0; 495 | background-color: transparent; 496 | color: #aaa; 497 | } 498 | 499 | table.highlighttable { 500 | margin-left: 0.5em; 501 | } 502 | 503 | table.highlighttable td { 504 | padding: 0 0.5em 0 0.5em; 505 | } 506 | 507 | div.code-block-caption { 508 | padding: 2px 5px; 509 | font-size: small; 510 | } 511 | 512 | div.code-block-caption code { 513 | background-color: transparent; 514 | } 515 | 516 | div.code-block-caption + div > div.highlight > pre { 517 | margin-top: 0; 518 | } 519 | 520 | div.code-block-caption span.caption-number { 521 | padding: 0.1em 0.3em; 522 | font-style: italic; 523 | } 524 | 525 | div.code-block-caption span.caption-text { 526 | } 527 | 528 | div.literal-block-wrapper { 529 | padding: 1em 1em 0; 530 | } 531 | 532 | div.literal-block-wrapper div.highlight { 533 | margin: 0; 534 | } 535 | 536 | code.descname { 537 | background-color: transparent; 538 | font-weight: bold; 539 | font-size: 1.2em; 540 | } 541 | 542 | code.descclassname { 543 | background-color: transparent; 544 | } 545 | 546 | code.xref, a code { 547 | background-color: transparent; 548 | font-weight: bold; 549 | } 550 | 551 | h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { 552 | background-color: transparent; 553 | } 554 | 555 | .viewcode-link { 556 | float: right; 557 | } 558 | 559 | .viewcode-back { 560 | float: right; 561 | font-family: sans-serif; 562 | } 563 | 564 | div.viewcode-block:target { 565 | margin: -1px -10px; 566 | padding: 0 10px; 567 | } 568 | 569 | /* -- math display ---------------------------------------------------------- */ 570 | 571 | img.math { 572 | vertical-align: middle; 573 | } 574 | 575 | div.body div.math p { 576 | text-align: center; 577 | } 578 | 579 | span.eqno { 580 | float: right; 581 | } 582 | 583 | /* -- printout stylesheet --------------------------------------------------- */ 584 | 585 | @media print { 586 | div.document, 587 | div.documentwrapper, 588 | div.bodywrapper { 589 | margin: 0 !important; 590 | width: 100%; 591 | } 592 | 593 | div.sphinxsidebar, 594 | div.related, 595 | div.footer, 596 | #top-link { 597 | display: none; 598 | } 599 | } -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Introduction to Statistical Mechanics — Introduction to Statistical Mechanics 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 50 | 51 |
52 |
53 |
54 |
55 | 56 |
57 |

Introduction to Statistical Mechanics

58 |

Copyright © 2014-2015 by Peter Eastman

59 |

This work may be freely distributed under the terms of the 60 | Creative Commons Attribution-NoDerivatives 4.0 International License. 61 | The source can be found at https://github.com/peastman/statmech.

62 |
63 | 131 |
132 |
133 | 134 | 135 |
136 |
137 |
138 | 158 |
159 |
160 | 172 | 176 | 177 | -------------------------------------------------------------------------------- /source/largenumbers.rst: -------------------------------------------------------------------------------- 1 | .. _very-large-numbers: 2 | 3 | Mathematical Interlude: Very Large Numbers 4 | ########################################## 5 | 6 | Problems in statistical mechanics tend to involve large numbers. Very *very* large numbers. For example, we often 7 | need to average over all the atoms or molecules in a system. For any macroscopic system, that will be on the order of 8 | Avogadro's number: 10\ :sup:`23`, plus or minus a few orders of magnitude. In other cases we average over microstates, 9 | the number of which usually grows *exponentially* in the number of atoms. These are really astronomically large 10 | numbers. 11 | 12 | This has an interesting result. In many cases, we can simply treat averages as exact numbers. Any variation about the 13 | average value is so small, we can completely ignore it. This is a great simplification, and is one of the reasons 14 | statistical mechanics is so successful. 15 | 16 | It also is the reason that, despite its name, statistical mechanics involves very little real statistics. A large part 17 | of the field of statistics deals with the variations about averages: computing the probability of a distribution 18 | producing values in a certain range, determining whether a measured value might plausibly have come from a certain 19 | distribution, etc. But in statistical mechanics, we can usually ignore these questions. The chance of measuring any 20 | value *except* the average one is negligible. 21 | 22 | The main goal of this chapter is to demonstrate this fact. We will do that first through a simple example, and then 23 | through a very general theorem. 24 | 25 | 26 | .. _the-binomial-distribution: 27 | 28 | The Binomial Distribution 29 | ========================= 30 | 31 | Do you ever worry that all the oxygen molecules in the air around you might spontaneously migrate to the other side of 32 | the room, leaving you unable to breathe? It could happen. Each molecule diffuses independently, so there is a small 33 | but finite probability that just by chance, they will all end up in the same half of the room at the same time. 34 | 35 | I hope I am not worrying you. While this is theoretically possible, it is so absurdly improbable that you really can 36 | ignore it. We will first compute just how improbable it is, and then study the statistics of this problem in more 37 | detail. 38 | 39 | Let :math:`N` be the number of oxygen molecules in the room. We will describe the position of each one simply by 40 | whether it is in the left or right half of the room. That gives :math:`2^N` possible arrangements of molecules, every 41 | one of which is equally probable. Of all those arrangements, only one has all the oxygen in the opposite half of the 42 | room from you, so the probability is :math:`1/2^N`. 43 | 44 | Depending on the size of the room you are in, it probably has somewhere in the vicinity of 10\ :sup:`26` oxygen 45 | molecules in it. So the probability of all the oxygen being on the same side of the room at any given moment is 46 | 47 | .. math:: 48 | \frac{1}{2^{10^{26}}} \approx \frac{1}{10^{10000000000000000000000000}} 49 | 50 | That is a very, very large denominator. For comparison here are some much smaller numbers: 51 | 52 | * The age of the universe is on the order of 10\ :sup:`17` seconds. 53 | 54 | * There are somewhere around 10\ :sup:`80` atoms in the visible universe. 55 | 56 | In short, you really do not need to worry about this happening. You would be much better off worrying about more likely 57 | events. For example, that you will be struck by lightning and then, as you try to pick yourself back up, hit by 58 | a meteor falling from space. And then immediately be struck by lightning a second time just for good measure. That is 59 | the sort of thing that is far more likely to happen to you. 60 | 61 | Perhaps you are still not reassured. You may have realized that even if only 90% of the oxygen moved to the other side 62 | of the room, that would still leave you in a rather awkward position. We really want to work out the entire probability 63 | distribution. Let :math:`m` be the number of oxygen molecules in the left half of the room and :math:`N-m` the number 64 | in the right half. Assuming the energy of each molecule is independent of which side of the room it is on, and that the 65 | oxygen molecules are far enough apart that we can ignore their interactions (both reasonable assumptions), the 66 | probability is simply proportional to :math:`\Omega(m)`. Let us consider how that varies with :math:`m`. 67 | 68 | * There is precisely one arrangement of molecules that has all of them on the left side of the room, so 69 | :math:`\Omega(0)=1`. 70 | 71 | * There are :math:`N` possible ways to have exactly one molecule on the left side of the room (any of the :math:`N` 72 | molecules could be the one), so :math:`\Omega(1)=N`. 73 | 74 | * To get two molecules on the left side of the room, we have :math:`N` choices for the first molecule and :math:`N-1` 75 | for the second molecule. But now we have counted each state twice: for any pair of molecules, it does not matter which 76 | order we choose them in. So :math:`\Omega(2)=N(N-1)/2`. 77 | 78 | Continuing like this, we find the general form: 79 | 80 | .. math:: 81 | \Omega(m) = \frac{N!}{m!(N-m)!} 82 | :label: binomialomega 83 | 84 | The probability is then 85 | 86 | .. math:: 87 | p(m) = \frac{1}{2^N} \frac{N!}{m!(N-m)!} 88 | :label: binomialprobability 89 | 90 | This is a special case of the *binomial distribution*. (In the general case, the probability for a particle to be on 91 | the left side of the room could be different from its probability to be on the right side, but for this example we can 92 | ignore that.) It is shown in :autonumref:`Figure,binomial` for several values of :math:`N`. Notice how, as :math:`N` 93 | increases, the probability becomes steadily more concentrated around its midpoint. 94 | 95 | .. figure:: images/binomial.* 96 | :align: center 97 | :scale: 80 98 | 99 | :autonumber:`Figure,binomial`. The binomial distribution for several values of :math:`N`. To make them easier to 100 | compare, all the curves have been normalized to go from 0 to 1 along each axis. 101 | 102 | The name comes from the fact that it has the same form as the terms in the *binomial series*: 103 | 104 | .. math:: 105 | (a+b)^N = \sum_{m=0}^N \frac{N!}{m!(N-m)!}a^Nb^{N-m} 106 | :label: binomialseries 107 | 108 | If we let :math:`a=b=1/2`, this simplifies to 109 | 110 | .. math:: 111 | \left(\frac{1}{2}+\frac{1}{2}\right)^N = \sum_{m=0}^N \frac{N!}{m!(N-m)!} \frac{1}{2^N} 112 | 113 | so that 114 | 115 | .. math:: 116 | \sum_{m=0}^N \frac{N!}{m!(N-m)!} = 2^N 117 | :label: binomialsum 118 | 119 | Let us examine this probability distribution a bit further. We can roughly characterize it by calculating its mean and 120 | standard deviation. The mean is easy: every particle has an equal chance to be on each side of the room, so 121 | :math:`\langle m \rangle = N/2`. Another way to think about this is that the distribution is symmetric: for any value 122 | of :math:`m`, :math:`p(m)=p(N-m)`, from which it directly follows that the mean must be :math:`N/2`. 123 | 124 | The standard deviation is a bit more complicated to derive. As a first step, let us first calculate 125 | 126 | .. math:: 127 | \langle m(m-1) \rangle = \frac{1}{2^N} \sum_{m=0}^N m(m-1) \frac{N!}{m!(N-m)!} 128 | 129 | Notice that the first two terms of the sum are both zero, so we can increase the lower bound to begin from 2. This 130 | allows us to then cancel out the factors of :math:`m(m-1)` that appear in both numerator and denominator: 131 | 132 | .. math:: 133 | \langle m(m-1) \rangle &= \frac{1}{2^N} \sum_{m=2}^N \frac{N!}{(m-2)!(N-m)!} \\ 134 | &= \frac{N(N-1)}{2^N} \sum_{m=2}^N \frac{(N-2)!}{(m-2)!(N-m)!} 135 | 136 | Now make two substitutions: define :math:`X=N-2` and :math:`y=m-2`. This simplifies it to: 137 | 138 | .. math:: 139 | \langle m(m-1) \rangle = \frac{N(N-1)}{2^N} \sum_{y=0}^X \frac{X!}{y!(X-y)!} 140 | 141 | We immediately recognize the sum as being the same one that appeared in equation :eq:`binomialsum`. Replacing it by 142 | :math:`2^X=2^{N-2}`, 143 | 144 | .. math:: 145 | \langle m(m-1) \rangle = \frac{N(N-1)2^{N-2}}{2^N} = \frac{N(N-1)}{4} 146 | 147 | We now have all the pieces we need. Recall that 148 | 149 | .. math:: 150 | Var(m) &= \langle m^2 \rangle - \langle m \rangle^2 \\ 151 | &= \langle m(m-1) \rangle + \langle m \rangle- \langle m \rangle^2 \\ 152 | &= \frac{N(N-1)}{4} + \frac{N}{2} - \frac{N^2}{4} \\ 153 | &= \frac{N}{4} 154 | :label: binomialvariance 155 | 156 | The standard deviation is then 157 | 158 | .. math:: 159 | \sigma \equiv \sqrt{Var(m)} = \frac{\sqrt{N}}{2} 160 | :label: binomialstddev 161 | 162 | Let us take a moment to consider these results. The average value is proportional to :math:`N`, while the standard 163 | deviation is proportional to :math:`\sqrt{N}`. In most cases, what we really care about is the ratio of the two. You 164 | want to know what *fraction* of the oxygen is likely to be on one side of the room, not the specific number of 165 | molecules. A number that would be huge in a broom closet would be negligible in an auditorium. Taking the ratio gives 166 | 167 | .. math:: 168 | \frac{\sigma}{\langle m \rangle} = \frac{1}{\sqrt{N}} 169 | :label: binomialfractionaldeviation 170 | 171 | For an average sized room with 10\ :sup:`26` oxygen molecules, that equals 10\ :sup:`-13`. This is the 172 | magnitude of the typical fluctuations, measured as a fraction of the total number of molecules. There are very few 173 | physical quantities that can actually be measured to a precision of 13 significant digits, and this is not one of them. 174 | The random fluctuations in the number of molecules on each side of the room are simply too small to measure. 175 | 176 | 177 | The Central Limit Theorem 178 | ========================= 179 | 180 | Having worked through one example in detail, you might wonder how general our conclusions are. Do other types of 181 | statistical problems behave roughly the same way? The answer is yes. There is a very general theorem which guarantees 182 | that a wide range of quantities will scale in essentially the same way. 183 | 184 | Before presenting that theorem, I first need to introduce one other very important probability distribution, known as 185 | the *Gaussian* or *normal* distribution: 186 | 187 | .. math:: 188 | p(x) = \frac{1}{\sigma \sqrt{2 \pi}} e^{\frac{-(x-\mu)^2}{2 \sigma^2}} 189 | :label: gaussianprobability 190 | 191 | It is shown in :autonumref:`Figure,gaussian`. It is not really as complicated as it looks. The basic form is just :math:`e^{-x^2}`. 192 | Replacing :math:`x` by :math:`x-\mu` shifts the mean of the distribution to :math:`\mu`, and then the exponent is scaled 193 | to make the standard deviation equal :math:`\sigma`. The factor in front is just a normalization, to ensure that 194 | 195 | .. math:: 196 | \int_{-\infty}^{\infty} p(x) dx = 1 197 | 198 | .. figure:: images/gaussian.* 199 | :align: center 200 | :scale: 80 201 | 202 | :autonumber:`Figure,gaussian`. A normal distribution with mean of 0 and standard deviation of 1. 203 | 204 | The name "normal distribution" gives a sense of just how important this distribution is in statistics. It comes up 205 | constantly. We will see the reason for this in just a moment. 206 | 207 | In the last section, we considered the number of oxygen molecules :math:`m` in the left half of the room. You can think 208 | of this quantity as a sum of random values: 209 | 210 | .. math:: 211 | m = \sum_{i=1}^{N} x_i 212 | 213 | Each value :math:`x_i` is either 0 or 1 (depending on which half of the room the molecule is in) with equal probability. 214 | Now we will generalize this to let the values be drawn from an arbitrary distribution. That distribution could be 215 | either discrete or continuous. The only thing we will assume about it is that it has a known mean and standard 216 | deviation. There is a remarkable result called the *Central Limit Theorem*: 217 | 218 | .. admonition:: The Central Limit Theorem 219 | 220 | Consider the sum 221 | 222 | .. math:: 223 | S = \sum_{i=1}^N x_i 224 | 225 | where the values :math:`x_i` are independently drawn from a distribution with mean :math:`\mu_x` and standard 226 | deviation :math:`\sigma_x`. In the limit :math:`N \to \infty`, the sum :math:`S` is distributed according to a 227 | normal distribution with mean :math:`\mu = N \mu_x` and standard deviation :math:`\sigma = \sqrt{N} \sigma_x`. 228 | 229 | This theorem dates back to 1718, when Abraham de Moivre presented a proof of a special case of it in his book 230 | *The Doctrine of Chances*. This book was not, as you might guess, an academic treatise for mathematicians. It was a 231 | book for gamblers, discussing how to win at various games of chance. Don't ever let anyone tell you that mathematics 232 | is not useful! 233 | 234 | This is the reason that normal distributions are so important. No matter what distribution you start out with, once 235 | you add enough values together the result will always be normally distributed. How large :math:`N` needs to be varies, 236 | of course, depending on the initial distribution, but it often does not need to be very large. In many cases, summing 237 | over 10 values is already enough to give quite a good approximation to a normal distribution. 238 | 239 | Notice that our main conclusions from the previous section apply just as well to the general case as they did for our 240 | specific example. The standard deviation is proportional to :math:`\sqrt{N}`, the mean is proportional to :math:`N`, 241 | and their ratio scales as :math:`1/\sqrt{N}`. No matter what distribution the individual values come from, once you add 242 | up a macroscopic number of them the fluctuations will be negligibly small. 243 | -------------------------------------------------------------------------------- /docs/_sources/largenumbers.txt: -------------------------------------------------------------------------------- 1 | .. _very-large-numbers: 2 | 3 | Mathematical Interlude: Very Large Numbers 4 | ########################################## 5 | 6 | Problems in statistical mechanics tend to involve large numbers. Very *very* large numbers. For example, we often 7 | need to average over all the atoms or molecules in a system. For any macroscopic system, that will be on the order of 8 | Avogadro's number: 10\ :sup:`23`, plus or minus a few orders of magnitude. In other cases we average over microstates, 9 | the number of which usually grows *exponentially* in the number of atoms. These are really astronomically large 10 | numbers. 11 | 12 | This has an interesting result. In many cases, we can simply treat averages as exact numbers. Any variation about the 13 | average value is so small, we can completely ignore it. This is a great simplification, and is one of the reasons 14 | statistical mechanics is so successful. 15 | 16 | It also is the reason that, despite its name, statistical mechanics involves very little real statistics. A large part 17 | of the field of statistics deals with the variations about averages: computing the probability of a distribution 18 | producing values in a certain range, determining whether a measured value might plausibly have come from a certain 19 | distribution, etc. But in statistical mechanics, we can usually ignore these questions. The chance of measuring any 20 | value *except* the average one is negligible. 21 | 22 | The main goal of this chapter is to demonstrate this fact. We will do that first through a simple example, and then 23 | through a very general theorem. 24 | 25 | 26 | .. _the-binomial-distribution: 27 | 28 | The Binomial Distribution 29 | ========================= 30 | 31 | Do you ever worry that all the oxygen molecules in the air around you might spontaneously migrate to the other side of 32 | the room, leaving you unable to breathe? It could happen. Each molecule diffuses independently, so there is a small 33 | but finite probability that just by chance, they will all end up in the same half of the room at the same time. 34 | 35 | I hope I am not worrying you. While this is theoretically possible, it is so absurdly improbable that you really can 36 | ignore it. We will first compute just how improbable it is, and then study the statistics of this problem in more 37 | detail. 38 | 39 | Let :math:`N` be the number of oxygen molecules in the room. We will describe the position of each one simply by 40 | whether it is in the left or right half of the room. That gives :math:`2^N` possible arrangements of molecules, every 41 | one of which is equally probable. Of all those arrangements, only one has all the oxygen in the opposite half of the 42 | room from you, so the probability is :math:`1/2^N`. 43 | 44 | Depending on the size of the room you are in, it probably has somewhere in the vicinity of 10\ :sup:`26` oxygen 45 | molecules in it. So the probability of all the oxygen being on the same side of the room at any given moment is 46 | 47 | .. math:: 48 | \frac{1}{2^{10^{26}}} \approx \frac{1}{10^{10000000000000000000000000}} 49 | 50 | That is a very, very large denominator. For comparison here are some much smaller numbers: 51 | 52 | * The age of the universe is on the order of 10\ :sup:`17` seconds. 53 | 54 | * There are somewhere around 10\ :sup:`80` atoms in the visible universe. 55 | 56 | In short, you really do not need to worry about this happening. You would be much better off worrying about more likely 57 | events. For example, that you will be struck by lightning and then, as you try to pick yourself back up, hit by 58 | a meteor falling from space. And then immediately be struck by lightning a second time just for good measure. That is 59 | the sort of thing that is far more likely to happen to you. 60 | 61 | Perhaps you are still not reassured. You may have realized that even if only 90% of the oxygen moved to the other side 62 | of the room, that would still leave you in a rather awkward position. We really want to work out the entire probability 63 | distribution. Let :math:`m` be the number of oxygen molecules in the left half of the room and :math:`N-m` the number 64 | in the right half. Assuming the energy of each molecule is independent of which side of the room it is on, and that the 65 | oxygen molecules are far enough apart that we can ignore their interactions (both reasonable assumptions), the 66 | probability is simply proportional to :math:`\Omega(m)`. Let us consider how that varies with :math:`m`. 67 | 68 | * There is precisely one arrangement of molecules that has all of them on the left side of the room, so 69 | :math:`\Omega(0)=1`. 70 | 71 | * There are :math:`N` possible ways to have exactly one molecule on the left side of the room (any of the :math:`N` 72 | molecules could be the one), so :math:`\Omega(1)=N`. 73 | 74 | * To get two molecules on the left side of the room, we have :math:`N` choices for the first molecule and :math:`N-1` 75 | for the second molecule. But now we have counted each state twice: for any pair of molecules, it does not matter which 76 | order we choose them in. So :math:`\Omega(2)=N(N-1)/2`. 77 | 78 | Continuing like this, we find the general form: 79 | 80 | .. math:: 81 | \Omega(m) = \frac{N!}{m!(N-m)!} 82 | :label: binomialomega 83 | 84 | The probability is then 85 | 86 | .. math:: 87 | p(m) = \frac{1}{2^N} \frac{N!}{m!(N-m)!} 88 | :label: binomialprobability 89 | 90 | This is a special case of the *binomial distribution*. (In the general case, the probability for a particle to be on 91 | the left side of the room could be different from its probability to be on the right side, but for this example we can 92 | ignore that.) It is shown in :autonumref:`Figure,binomial` for several values of :math:`N`. Notice how, as :math:`N` 93 | increases, the probability becomes steadily more concentrated around its midpoint. 94 | 95 | .. figure:: images/binomial.* 96 | :align: center 97 | :scale: 80 98 | 99 | :autonumber:`Figure,binomial`. The binomial distribution for several values of :math:`N`. To make them easier to 100 | compare, all the curves have been normalized to go from 0 to 1 along each axis. 101 | 102 | The name comes from the fact that it has the same form as the terms in the *binomial series*: 103 | 104 | .. math:: 105 | (a+b)^N = \sum_{m=0}^N \frac{N!}{m!(N-m)!}a^Nb^{N-m} 106 | :label: binomialseries 107 | 108 | If we let :math:`a=b=1/2`, this simplifies to 109 | 110 | .. math:: 111 | \left(\frac{1}{2}+\frac{1}{2}\right)^N = \sum_{m=0}^N \frac{N!}{m!(N-m)!} \frac{1}{2^N} 112 | 113 | so that 114 | 115 | .. math:: 116 | \sum_{m=0}^N \frac{N!}{m!(N-m)!} = 2^N 117 | :label: binomialsum 118 | 119 | Let us examine this probability distribution a bit further. We can roughly characterize it by calculating its mean and 120 | standard deviation. The mean is easy: every particle has an equal chance to be on each side of the room, so 121 | :math:`\langle m \rangle = N/2`. Another way to think about this is that the distribution is symmetric: for any value 122 | of :math:`m`, :math:`p(m)=p(N-m)`, from which it directly follows that the mean must be :math:`N/2`. 123 | 124 | The standard deviation is a bit more complicated to derive. As a first step, let us first calculate 125 | 126 | .. math:: 127 | \langle m(m-1) \rangle = \frac{1}{2^N} \sum_{m=0}^N m(m-1) \frac{N!}{m!(N-m)!} 128 | 129 | Notice that the first two terms of the sum are both zero, so we can increase the lower bound to begin from 2. This 130 | allows us to then cancel out the factors of :math:`m(m-1)` that appear in both numerator and denominator: 131 | 132 | .. math:: 133 | \langle m(m-1) \rangle &= \frac{1}{2^N} \sum_{m=2}^N \frac{N!}{(m-2)!(N-m)!} \\ 134 | &= \frac{N(N-1)}{2^N} \sum_{m=2}^N \frac{(N-2)!}{(m-2)!(N-m)!} 135 | 136 | Now make two substitutions: define :math:`X=N-2` and :math:`y=m-2`. This simplifies it to: 137 | 138 | .. math:: 139 | \langle m(m-1) \rangle = \frac{N(N-1)}{2^N} \sum_{y=0}^X \frac{X!}{y!(X-y)!} 140 | 141 | We immediately recognize the sum as being the same one that appeared in equation :eq:`binomialsum`. Replacing it by 142 | :math:`2^X=2^{N-2}`, 143 | 144 | .. math:: 145 | \langle m(m-1) \rangle = \frac{N(N-1)2^{N-2}}{2^N} = \frac{N(N-1)}{4} 146 | 147 | We now have all the pieces we need. Recall that 148 | 149 | .. math:: 150 | Var(m) &= \langle m^2 \rangle - \langle m \rangle^2 \\ 151 | &= \langle m(m-1) \rangle + \langle m \rangle- \langle m \rangle^2 \\ 152 | &= \frac{N(N-1)}{4} + \frac{N}{2} - \frac{N^2}{4} \\ 153 | &= \frac{N}{4} 154 | :label: binomialvariance 155 | 156 | The standard deviation is then 157 | 158 | .. math:: 159 | \sigma \equiv \sqrt{Var(m)} = \frac{\sqrt{N}}{2} 160 | :label: binomialstddev 161 | 162 | Let us take a moment to consider these results. The average value is proportional to :math:`N`, while the standard 163 | deviation is proportional to :math:`\sqrt{N}`. In most cases, what we really care about is the ratio of the two. You 164 | want to know what *fraction* of the oxygen is likely to be on one side of the room, not the specific number of 165 | molecules. A number that would be huge in a broom closet would be negligible in an auditorium. Taking the ratio gives 166 | 167 | .. math:: 168 | \frac{\sigma}{\langle m \rangle} = \frac{1}{\sqrt{N}} 169 | :label: binomialfractionaldeviation 170 | 171 | For an average sized room with 10\ :sup:`26` oxygen molecules, that equals 10\ :sup:`-13`. This is the 172 | magnitude of the typical fluctuations, measured as a fraction of the total number of molecules. There are very few 173 | physical quantities that can actually be measured to a precision of 13 significant digits, and this is not one of them. 174 | The random fluctuations in the number of molecules on each side of the room are simply too small to measure. 175 | 176 | 177 | The Central Limit Theorem 178 | ========================= 179 | 180 | Having worked through one example in detail, you might wonder how general our conclusions are. Do other types of 181 | statistical problems behave roughly the same way? The answer is yes. There is a very general theorem which guarantees 182 | that a wide range of quantities will scale in essentially the same way. 183 | 184 | Before presenting that theorem, I first need to introduce one other very important probability distribution, known as 185 | the *Gaussian* or *normal* distribution: 186 | 187 | .. math:: 188 | p(x) = \frac{1}{\sigma \sqrt{2 \pi}} e^{\frac{-(x-\mu)^2}{2 \sigma^2}} 189 | :label: gaussianprobability 190 | 191 | It is shown in :autonumref:`Figure,gaussian`. It is not really as complicated as it looks. The basic form is just :math:`e^{-x^2}`. 192 | Replacing :math:`x` by :math:`x-\mu` shifts the mean of the distribution to :math:`\mu`, and then the exponent is scaled 193 | to make the standard deviation equal :math:`\sigma`. The factor in front is just a normalization, to ensure that 194 | 195 | .. math:: 196 | \int_{-\infty}^{\infty} p(x) dx = 1 197 | 198 | .. figure:: images/gaussian.* 199 | :align: center 200 | :scale: 80 201 | 202 | :autonumber:`Figure,gaussian`. A normal distribution with mean of 0 and standard deviation of 1. 203 | 204 | The name "normal distribution" gives a sense of just how important this distribution is in statistics. It comes up 205 | constantly. We will see the reason for this in just a moment. 206 | 207 | In the last section, we considered the number of oxygen molecules :math:`m` in the left half of the room. You can think 208 | of this quantity as a sum of random values: 209 | 210 | .. math:: 211 | m = \sum_{i=1}^{N} x_i 212 | 213 | Each value :math:`x_i` is either 0 or 1 (depending on which half of the room the molecule is in) with equal probability. 214 | Now we will generalize this to let the values be drawn from an arbitrary distribution. That distribution could be 215 | either discrete or continuous. The only thing we will assume about it is that it has a known mean and standard 216 | deviation. There is a remarkable result called the *Central Limit Theorem*: 217 | 218 | .. admonition:: The Central Limit Theorem 219 | 220 | Consider the sum 221 | 222 | .. math:: 223 | S = \sum_{i=1}^N x_i 224 | 225 | where the values :math:`x_i` are independently drawn from a distribution with mean :math:`\mu_x` and standard 226 | deviation :math:`\sigma_x`. In the limit :math:`N \to \infty`, the sum :math:`S` is distributed according to a 227 | normal distribution with mean :math:`\mu = N \mu_x` and standard deviation :math:`\sigma = \sqrt{N} \sigma_x`. 228 | 229 | This theorem dates back to 1718, when Abraham de Moivre presented a proof of a special case of it in his book 230 | *The Doctrine of Chances*. This book was not, as you might guess, an academic treatise for mathematicians. It was a 231 | book for gamblers, discussing how to win at various games of chance. Don't ever let anyone tell you that mathematics 232 | is not useful! 233 | 234 | This is the reason that normal distributions are so important. No matter what distribution you start out with, once 235 | you add enough values together the result will always be normally distributed. How large :math:`N` needs to be varies, 236 | of course, depending on the initial distribution, but it often does not need to be very large. In many cases, summing 237 | over 10 values is already enough to give quite a good approximation to a normal distribution. 238 | 239 | Notice that our main conclusions from the previous section apply just as well to the general case as they did for our 240 | specific example. The standard deviation is proportional to :math:`\sqrt{N}`, the mean is proportional to :math:`N`, 241 | and their ratio scales as :math:`1/\sqrt{N}`. No matter what distribution the individual values come from, once you add 242 | up a macroscopic number of them the fluctuations will be negligibly small. 243 | --------------------------------------------------------------------------------