~jzck/physics-notes

9242517d2b1b0b8f55214a872e2a8eff82278577 — Jack Halford 1 year, 3 months ago 1a061c9
modifications
12 files changed, 123 insertions(+), 53 deletions(-)

M .gitignore
M Makefile
A md/density-matrix.md
M md/hamiltonian-operator.md
M md/lexicon.md
A md/matrix-mechanics.md
M md/quantum-operator.md
D tools/colors
D tools/generate-bg-css.sh
M tools/generate-graph.sh
A tools/get
M tools/latex-includes.yaml
M .gitignore => .gitignore +1 -1
@@ 1,3 1,3 @@
graph
html
external_refs
see_also

M Makefile => Makefile +15 -18
@@ 4,14 4,13 @@ SHELL := bash
.RECIPEPREFIX = >

MD	=	$(shell ls -1 md/*.md)
GRAPH	=	$(subst md/,graph/,$(MD))
REFS	=	$(subst md/,external_refs/,$(MD))
GRAPH	=	$(subst md/,graph/,$(MD:.md=))
SEEALSO	=	$(subst md/,see_also/,$(MD))
HTML	=	$(subst md/,html/,$(MD:.md=.html))

all: $(HTML) html/colors.css html/graph.svg $(REFS)
all: $(HTML) html/graph.svg $(SEEALSO)

html/%.html: md/%.md external_refs/%.md
> @mkdir -p html
html/%.html: md/%.md see_also/%.md | html/colors.css html
> @pandoc	--filter tools/pf-filter.py \
		-H tools/header.html \
		--template tools/template.html \


@@ 19,24 18,22 @@ html/%.html: md/%.md external_refs/%.md
		tools/latex-includes.yaml \
		$^ -o $@ &
> @printf '$@\n'
html/graph.svg: $(GRAPH) | html
> dot -Tsvg -o $@ <(./tools/generate-graph.sh)
html/colors.css: | html
> ./tools/get bg_css >$@

external_refs/%.md: graph/%.md
> @mkdir -p external_refs
> @[ -s $^ ] && echo '## See also' > $@
> @awk '{printf "- [%s](%s)\n", $$1, $$1;}' $^>>$@

graph/%.md: md/%.md
> @mkdir -p graph
> @grep $(notdir $@) md/*.md | awk -F: '{print $$1}' | uniq | sed s:md/::g | grep -v lexicon > $@ || true
see_also/%.md: graph/% | see_also
> @tools/get see_also $(^F)>$@

html/graph.svg: $(GRAPH)
> dot -Tsvg -o $@ <(./tools/generate-graph.sh)
graph/%: md/%.md | graph
> @tools/get graph $(^F)>$@

html/colors.css: tools/colors
> ./tools/generate-bg-css.sh >$@
html see_also graph:
> @mkdir -p $@

clean:
> rm -rf html graph external_refs
> rm -rf html graph see_also

re: clean all


A md/density-matrix.md => md/density-matrix.md +6 -0
@@ 0,0 1,6 @@
---
title: density matrix
type: object
---

paragraph 14

M md/hamiltonian-operator.md => md/hamiltonian-operator.md +27 -1
@@ 7,6 7,32 @@ The [wave function](wave-function.md) completely determines the system, and also

$$ i\partial\Psi/\partial t=\qop{L}\Psi $$

TODO blablabla
We can derive some properties for $\qop{L}$, since the integral $\int\Psi^*\Psi\dd{q}$ is a constant independant of time we have

$$ \frac{\dd{}}{\dd{t}}\int|\Psi|^2\dd{q}=
\int\Psi\frac{\partial\Psi^*}{\partial t}\dd{q}+
\int\frac{\partial\Psi}{\partial t}\Psi^*\dd{q}=0 $$

Substituting $\partial\Psi/\partial t=-i\qop{L}\Psi$ and $\partial\Psi^*/\partial t=i\qop[*]{L}\Psi^*$ and using

$$ \int\Psi\qop[*]{L}\Psi^*\dd{q}-\int\Psi^*\qop{L}\Psi\dd{q}=\int\Psi^*(\qop[t*]{L}-\qop{L})\Psi\dd{q}=0 $$

Since this must hold for an arbitrary $\Psi$, we find that $\qop{L}$ must be Hermitian

$$ \qop[t]{L}=\qop[*]{L} $$

Let us find the classical quantity to which $\qop{L}$ corresponds, we differentiate $(6.1)$

$$ \frac{\partial\Psi}{\partial t}=\frac{i}{\hbar}\frac{\partial S}{\partial t}\Psi $$

the slowly varying amplitude $a$ need not be differentiated.

Comparing this to the definition $\partial\Psi/\partial t=-i\qop{L}\Psi$ we have $\qop{L}=-(1/\hbar)\partial S/\partial t$.

As we know from classical mechanics, the derivative $-\partial S/\partial t$ is just Hamilton's function $H$ for a mechanical system. In quantum mechanics we call this the Hamiltonian [operator](quantum-operator.md), or the Hamiltonian of a system.

$$ \lltag{3}{8.1} i\hbar\partial\Psi/\partial t=\qop{H}\Psi $$

If the form of the Hamiltonian is known, equatio $(8.1)$ determines the wave function of the physical system concerned. This fundamental equation of quantum mechanics is called the wave equation.



M md/lexicon.md => md/lexicon.md +1 -1
@@ 1,5 1,5 @@
---
title: Lexicon
title: lexicon
---

degrees of freedom: the number of co-ordinates needed to _completely_ define the position of a system.  

A md/matrix-mechanics.md => md/matrix-mechanics.md +6 -0
@@ 0,0 1,6 @@
---
title: matrix mechanics
type: object
---

paragraph 11

M md/quantum-operator.md => md/quantum-operator.md +28 -1
@@ 200,5 200,32 @@ The classical definition of a time derivative doesn't hold in quantum mechanics.

$$ \lltag{3}{9.1} \overline{\dot{f}}=\dot{\overline{f}} $$

by definition we have the mean as $\overline{f}
by definition we have the mean as $\overline{f}=\int\Psi^*\qop{f}\Psi\dd{q}$,

$$ \overline{\dot{f}}=\dot{\overline{f}}=\frac{\dd{}}{\dd{t}}\int\Psi^*\qop{f}\Psi\dd{q}=
\int\Psi^*\frac{\partial\qop{f}}{\partial t}\Psi\dd{q}+
\int\frac{\partial\Psi^*}{\partial t}\qop{f}\Psi\dd{q}+
\int\Psi\qop{f}\frac{\partial\Psi}{\partial t}\dd{q}
$$

Substituting in $(8.1)$, the time derivative is simply the [Hamiltonian operator](hamiltonian-operator.md)
$$ \overline{\dot{f}}=
\int\Psi^*\frac{\partial\qop{f}}{\partial t}\Psi\dd{q}+
\frac{i}{\hbar}\int(\qop[*]{H}\Psi^*)\qop{f}\Psi\dd{q}-
\frac{i}{\hbar}\int\Psi^*\qop{f}(\qop{H}\Psi)\dd{q}
$$

since $\qop{H}$ is Hermitian we have
$$ \overline{\dot{f}}=
\int\Psi^*
\left(\frac{\partial\qop{f}}{\partial t}+
\frac{i}{\hbar}\qop[]{H}\qop{f}-
\frac{i}{\hbar}\qop{f}\qop{H}\right)
\Psi\dd{q}
$$

Since, by definition of the mean value, the operator inside the parenthesis must be the derivative operator of the quantity $f$

$$ \lltag{3}{9.2} \qop{\dot{f}}=\frac{\partial\qop{f}}{\partial t}+\frac{i}{\hbar}\left(\qop[]{H}\qop{f}-\qop{f}\qop{H}\right) $$

We notice that if $f$ does not depend explicitly on time, then the derivative $\qop{\dot{f}}$ is, apart from a constant factor, just a commutation of $f$ with the Hamiltonian $\qop{H}$.

D tools/colors => tools/colors +0 -5
@@ 1,5 0,0 @@
#!/bin/bash
declare -A colors
colors[model]="#abffab"		#greeen
colors[object]="#a8deff"	#blue
colors[problem]="#faf884"	#yellow

D tools/generate-bg-css.sh => tools/generate-bg-css.sh +0 -6
@@ 1,6 0,0 @@
#!/bin/bash

. tools/colors
for type in ${!colors[@]}; do
	echo ".$type{ background-color: ${colors[$type]}; }"
done

M tools/generate-graph.sh => tools/generate-graph.sh +15 -20
@@ 1,27 1,22 @@
#!/bin/bash

. tools/colors
GET=tools/get

title_of() { awk -F': ' '/title/ {print $2}' md/$1; }
type_of() { awk -F': ' '/type/ {print $2}' md/$1; }
color_of() {
    type=$(type_of $1)
    type=${type:-DEFAULT}
    echo ${colors[$type]}
}

echo 'digraph {'
echo 'node  [style="rounded,filled", shape=box]'
echo 'rankdir=LR'
for node in md/*.md; do
    node=$(basename $node)
generate_one_node() {
    node=$(basename ${1%.md})
    
    [ "$(type_of $node)" == "problem" ] && continue
    title=$(title_of $node)
    color=$(color_of $node)
    echo "    \"$title\"[href=\"../html/$(basename ${node/.md/.html} | tr -d '_')\", fillcolor=\"$color\"]"
    [ "$($GET type $node)" == "problem" ] && return
    $GET link_to $node
    title=$($GET title $node)
    [ -f graph/$node ] && for line in $(cat graph/$node); do
    echo "    \"$(title_of $line)\" -> \"$title\""
	printf  '    "%s" -> "%s"' "$($GET title $line)" "$title"
    done
done
}

echo 'digraph {'
echo '    node  [style="rounded,filled", shape=box]'
echo '    rankdir=LR'

for node in md/*.md; do generate_one_node $node& done; wait

echo "}"

A tools/get => tools/get +22 -0
@@ 0,0 1,22 @@
#!/bin/bash

declare -A colors
colors[model]="#abffab"		#greeen
colors[object]="#a8deff"	#blue
colors[problem]="#faf884"	#yellow
colors[DEFAULT]="#ffd1dc"	#pink

_or_default() { grep ^ || echo DEFAULT; }
title() { awk -F': ' '/title: / {print $2}' md/$1.md | _or_default; }
type() { awk -F': ' '/type: / {print $2}' md/$1.md | _or_default; }
color() { printf "${colors[$(type $1)]}"; }
link_to() { printf '    "%s"[href="../html/%s.html", fillcolor="%s"]\n' "$(title $1)" "$1" "$(color $1)"; }
graph() { grep $1.md md/*.md | awk -F: '{print $1}' | uniq | sed s:md/::g | sed s:.md::g | grep -v lexicon || true; }
see_also() { [ -s graph/$1 ] && echo '## See also'; awk '{printf "- [%s](%s.html)\n", $1, $1;}' graph/$1; }
bg_css() {
    for type in ${!colors[@]}; do
	    echo ".$type{ background-color: ${colors[$type]}; }"
    done
}

$1 $(basename ${2%.md})

M tools/latex-includes.yaml => tools/latex-includes.yaml +2 -0
@@ 1,10 1,12 @@
---
header-includes: |
  \usepackage{bm}

  \newcommand{\dd}[1]{\mathrm{d}#1}
  \newcommand{\qop}[2][]{\hat{#2}\vphantom{#2}^{#1}}
  \newcommand{\lltag}[2]{\tag*{LL#1 (#2)}}
  \newcommand{\mfrac}[2]{\textstyle\frac{#1}{#2}}

  \newenvironment{nalign}{
      \begin{equation}
      \begin{aligned}