certik / theoretical-physics Goto Github PK
View Code? Open in Web Editor NEWSource code of the Theoretical Physics Reference online book
Home Page: https://theoretical-physics.com
License: MIT License
Source code of the Theoretical Physics Reference online book
Home Page: https://theoretical-physics.com
License: MIT License
Add things from my master and bachelor theses
Reported by László Oroszlány and Laszlo Szunyogh.
There is a small mistake (or just rather an inconsistency) in the way you define the c-type Gaunt coefficients in the section about Legendre Polynomials. There is a factor 4_k+1 that should be 2_k+1 to make it consistent with the definition trough the wigner 3-j-s. you simplify by (2_k+1)/(4_k+1) at some point..
I've been reading the DFT page, and I'm trying to understand the section on the Total energy. A short bit into that section, it is written that "If one is not careful about the potential associated with the eigenvalues, i.e., confusing V_{in} with V_{out}". However, where is "V_in" and "V_out" defined? It is a bit unclear if the section is trying to explain what would happen if the equations given there are used to evaluated the total energy on each iteration of the KS solution. But why would the energy after an iteration be evaluated using the previous external potential ("V_in"?)? The message of the section is a bit unclear to me.
Furthermore, the section seems to imply that the last equation of the section "Total energy" is somehow not preferable to a direct usage of the total energy expression (first equation of "total energy" section), despite the fact that several review works/text books on DFT indicate that the last expression is used in several DFT codes to calculate the total energy.
It's already there in some form, but it should be made clear, how the weak form of the schroed. eq. looks like
Fix all the cosmetic problems as suggested here:
http://ondrejcertik.blogspot.com/2010/07/theoretical-physics-reference-book.html
figure out how to put the license into the pdf and html somehow so that it looks nice. Also make sure all other things are fixed.
I switched to SVG for math in #76. All math is vectorized and looks good in all resolutions.
@asmeurer, would you mind checking some math heavy page, say this one: https://www.theoretical-physics.net/dev/elmag/elmag.html on your retina and tell me if the equations looks good now?
Also does it load relatively quickly?
Dirac notation is:
http://theoretical-physics.net/dev/src/math/la.html
Mathematically there is no problem at all, we are just using the Riesz representation theorem.
http://en.wikipedia.org/wiki/Riesz_representation_theorem
http://theoretical-physics.net/dev/src/math/other.html#dirac-notation
however, it should be expanded and more examples added. It should be stressed, that |f> is a vector, that can be represented in any basis (|x>, |x'>, |p>, |n>, ...) and Dirac notation provides unified ways of dealing with it.
It is still independent of the scalar product, and so 1) and 2) should be unified somehow.
In particular \int |x><x| dx = 1 only holds if we use the L2 scalar product. For weighted L2 product, we'll get \int w(x) * |x><x| dx = 1, and so on. For H1, it gets more nasty.
We need to put there easy way to derive these formulas and show what follows from what.
John:
DFT ground state does not necessarily have 7s higher in energy than 6d. In fact, my featom code finds the following ground state energies/occupations for LDA (using Fermi-Dirac occupation with 0.001 Ha smear):
Lowest eigenvalues and occupations (index, n, L, value, occupation): 1: 1 0 -3.6889954761E+03 2.0000000000E+00 2: 2 0 -6.3940729181E+02 2.0000000000E+00 3: 2 1 -6.1874016342E+02 6.0000000000E+00 4: 3 0 -1.6073349570E+02 2.0000000000E+00 5: 3 1 -1.5059481296E+02 6.0000000000E+00 6: 3 2 -1.3159427535E+02 1.0000000000E+01 7: 4 0 -4.0152111179E+01 2.0000000000E+00 8: 4 1 -3.5477394577E+01 6.0000000000E+00 9: 4 2 -2.6747107088E+01 1.0000000000E+01 10: 4 3 -1.4649108156E+01 1.4000000000E+01 11: 5 0 -8.4639842362E+00 2.0000000000E+00 12: 5 1 -6.6619644703E+00 6.0000000000E+00 13: 5 2 -3.5226864132E+00 1.0000000000E+01 14: 6 0 -1.1171982594E+00 2.0000000000E+00 15: 6 1 -6.4359982973E-01 6.0000000000E+00 16: 7 0 -9.8198270806E-02 1.2795018030E+00 17: 5 3 -9.6948094138E-02 4.7204981970E+00 18: 6 2 -5.8382915481E-02 0.0000000000E+00 19: 7 1 -3.9951649510E-02 0.0000000000E+00 20: 8 0 -3.2986444516E-03 0.0000000000E+00 21: 8 1 3.3607509599E-03 0.0000000000E+00 22: 9 0 5.0395456503E-03 0.0000000000E+00 23: 7 2 5.7895441443E-03 0.0000000000E+00 Difference of lowest 2 eigenvalues: 3.0495881843E+03 Occupation-weighted eigenvalue sum: -1.5774758217E+04
Perhaps at /dev-mathjax. The png based image math is hard to read on a high resolution (retina) display.
We have the electron-electron (Hartree) and electron-nucleus (external) but not the nucleus-nucleus term in the total energy expression at http://theoretical-physics.net/dev/src/quantum/dft.html#total-energy.
Great table here:
Thank you for this great repo. I noticed that there is no statistical mechanics. Is there a plan for it?
Here is how to do it:
http://www.nyu.edu/classes/tuckerman/stat.mech/lectures/lecture_6/node2.html
I missed the all-important help
line in the following error message:
There are two "art direction" reasons for this:
help
line, even if it's empty! Here is an example of the error messages I see all the time:(lp) ┌─(~/CLionProjects/lpython/lasr/LP-pycharm)─────────────────────────────────────────────────────────────────────────────────────────────────────────(brian@Golf37:s012)─┐
└─(11:39:11 on brian-lasr ✹ ✭)──> ~/CLionProjects/lpython/src/bin/lpython -I. issue2126.py 1 ↵ ──(Sun,Jul09)─┘
semantic error: Type mismatch in comparison operator, the types must be compatible
--> issue2126.py:18:12
|
18 | assert foo.dim == x.dim == y.dim == z.dim
| ^^^^^^^^^^^^^^^^ ^^^^^ type mismatch ('bool' and 'i32')
Note: if any of the above error or warning messages are not clear or are lacking
context please report it to us (we consider that a bug that must be fixed).
In particular:
hydrogen atom + energies, also exact energy from Dirac equation
all the other stuff, see the sympy list
Here are great QM notes:
http://galileo.phys.virginia.edu/classes/751.mf1i.fall02/
We can polish our QM section using it.
Hartree atomic units and so on. Take it from the QFT part and my Bachelor thesis.
theoretical-physics/src/quantum/dft.rst
Line 46 in e5b5382
Missed $
I think so \dots
just appears as "dots" in the text.
I am currently following the Russian (and Czech, Polish, ...) tradition, that when a mathematical formula is broken into multiple lines, the last sign on the line (typically =
or +
) is repeated at the beginning of the next line. The problem with this convention is that many American readers think, that the sign left on the previous line is a typo.
Some references for this convention are e.g. here and here. In the second link, see the "Hyphenation in mathematics". In there, the convention by priority is to prefer breaking at a relational sign (<
, >
, =
, ≈
, ...). If not possible, then at addition/subtraction sign (+
, -
, ±
, ∓
), and if not possible, then finally at a multiplication sign (i.e., at the position where multiplication is assumed since the explicit multiplication sign is usually skipped in mathematical expressions). Signs like *
, .
, /
, (
, [
, etc. prevent formula breaking. There are some more tips there. As far as these rule go, I think the U.S. convention is similar if not identical.
The rule that is different is:
When the mathematical formula (embedded in text or as a separated block)
is broken into two parts and is continued on the next line, tradition requires
that we must repeat the last sign in the broken formula at the end of the first
part and at the beginning of the second part placed on the next line. When
a multiplication is broken, the explicit multiplication sign ‘×’ is inserted, and
this sign is repeated on the next line as well.
I just checked my English edition of Landau & Lifshitz, and indeed, they repeat the +
sign at the end of the line and at the beginning of the next line (but they are not always consistent, sometimes they do not repeat +
). They do not seem to repeat the =
sign. However, Russian books all seem to strictly repeat the sign, including =
, see e.g. this page at Google books (you might need to be logged in to see it).
I was actually even wondering, if the formula breaking cannot be made automatic, just like a paragraph breaking. The reason is that for narrow displays, some of the formulas do not fit the page. For wide displays, they would. Some formulas fit nicely in html, but do not fit nicely in the pdf version of the book.
I think the algorithm would be very simple, it would try to break at relational sign, if impossible, then at addition/subtraction. I would ignore the last multiplication rule, because it's implicit, so it would be hard to implement. Then the algorithm can easily repeat the last sign, or not, depending on user preferences.
Here is a great treatment: http://www.continuummechanics.org/cm/materialderivative.html with a worked out example.
Do this example in 2D.
It would be great if you could try out using https://www.sympy.org/sphinx-math-dollar/ instead of https://github.com/certik/theoretical-physics/blob/master/exts/math_dollar.py, and let me know if you have an issues with it. You'll have to inspect the math manually to make sure it doesn't do anything wrong, although you can also build with MATH_DOLLAR_DEBUG=1
, which will print messages about any $'s that are skipped (e.g., because they are in a code block).
With a simple explanation about each. Some info is here:
http://en.wikipedia.org/wiki/Elementary_particle
but such tables are hard to remember. I think a better approach is to list the particles that are included in the electroweak standard model*, and then particles that arise when we include quarks in it too. That should cover everything I think.
. * by listing their terms in the Lagrangian, as well as their spin (again from the Lagrangian) and so on. It should be clear where each particle comes from in the construction of the standard model
Add colors and CSS styling to the front page.
In particular John's comment:
You have phi for "potential energy" and V for "potential" instead of the other way around.
One way is to use the functional derivatives, another way is:
Actually, the 1/2 accounts for double counting in the electron-electron integral, not present in the electron-nuclear integral since it is not a self energy. Potential energy of a collection of charges q_i in the field of another collection of charges q'_j is \sum_{i,j} q_i q'_j / |r_i-r'_j| Whereas the *self* energy of the charges q_i is \sum_{i,j>i} q_i q_j / |r_i-r_j| = 1/2 \sum_{i,j/=i} q_i q_j / |r_i-r_j| where the j>i in the summation is required to avoid double counting pairs: e.g., includes q_1*q_2 term, omits q_2*q_1, etc. And so in the continuous case, for the electron-electron self energy (Hartree energy) we have the 1/2: E_H = 1/2 \int { rho(x) rho(x') / |x - x'| d^3x d^3x' } = 1/2 \int { rho(x) v_e(x) d^3x } where v_e(x) = \int { rho(x') / |x - x'| d^3x' } while for the electron-nuclear energy we have simply E_en = \int { rho(x) rho_n(x') / |x - x'| d^3x d^3x' } = \int { rho(x) v_n(x) d^3x } where v_n(x) = \int { rho_n(x') / |x - x'| d^3x' } = \int { Z delta(x'-x_n)/ |x - x'| d^3x' } = Z/|x - x_n|; x_n = nuclear position.
Use both. Possibly put this into the functional derivatives section.
Reported by Liguang G. Jiao.
http://theoretical-physics.net/dev/src/quantum/hf.html#two-particle
In the final form of the two-electron potential matrix <l1,l2,L,M|
1/r_12 |l1',l2',L',M'>, I think there is no factor (2L+1).
This factor will be eliminated in constructing the six-J symbols.
I think the first two "=" are correct, but the third one
(the last "=" sign) is not. After summing up over M, there cannot be
any M left in the equation. So I think we are missing a summation over
M in the last equation there.
That way the 2L+1 factor disappears from the final formula for the two electron integral, as it should.
Follow the Theorem 1. in:
http://scorevoting.net/WarrenSmithPages/homepage/gammprox.ps
and the references there. We currently use the log(gamma) concave condition, but that has always been a bit ad hoc -- better is to use the Carlson's theorem.
from math import pi, sin, cos, sqrt, log eV = 1 KeV = 1e3 MeV = 1e6 GeV = 1e9 g = 0.631 theta_W = 28.67 * pi / 180 v = 246.218 * GeV h_e = 2.935 * 1e-6 * eV h_mu = 6.065 * 1e-4 * eV h_tau = 1.021 * 1e-2 * eV alpha = 1/137.035999 m_t = 180 * GeV m_w = g*v/2 m_z = g*v/2/cos(theta_W) s_w = sin(theta_W) # Same as: s_w = sqrt(1-m_w**2/m_z**2) # I think that s_0 and s_w is the same #s_0 = sqrt(0.2307) s_0 = s_w print s_0**2 # from the graph: #s_w = sqrt(0.226) #s_star = sqrt(0.231) #print s_star**2 m_h = 1000 * GeV rhs = -3*alpha/(16*pi*(cos(theta_W)**2 - sin(theta_W)**2)) * m_t**2 / m_z**2 rhs += alpha * (1+9*sin(theta_W)**2)/(48*pi * (cos(theta_W)**2 - sin(theta_W)**2)) * log(m_h**2/m_w**2) s_star = sqrt(s_0**2 + rhs) rhs = -3*alpha/(16*pi*sin(theta_W)**2) * m_t**2 / m_z**2 rhs += alpha * 5./(24*pi) * log(m_h**2/m_w**2) s_w = sqrt(s_star**2 + rhs) print s_star**2 print s_w**2
This prints:
bash-3.2$ python a.py 0.230173648241 0.228245381646 0.222897377383
Which agrees with P & S at least a little bit, page 772, Figure 21.14
Just a suggestion, ReadTheDocs theme and Pydata theme both look nice and have many advanced functions, such as dark mode, sticky TOC, and easily navigation. They are being used by many popular scientific projects like numpy, scipy, pandas, ...
If you guys like, I will create a PR then, with a "dark-mode" toggle button, sticky TOC, wider page, and quickly copy code-block function enabled.
Introduce arg
, Im
, Re
(or maybe im
, re
). So, in particular, write things like:
arg(z) = atan2(im(z), re(z))
and not
arg(x+iy) = atan2(y, x)
because the latter makes things more complicated. It turns out everything can be written using arg
, re
and im
.
Pick a branch cut, at negative x-axis for arg. Everything else follows from it. Few examples valid for all complex values of all variables:
exp(log(z)) = z
log(exp(z)) = z + 2*pi*i*floor( (pi-Im(z))/(2*pi) )
exp(z)^k = exp(k*z) * exp(2*pi*i*k*floor( (pi-Im(z))/(2*pi) ))
log(z1 * z2) = log(z1) + log(z2) + 2*pi*i*floor( (pi-arg(z1)-arg(z2))/(2*pi) )
exp(x+y) = exp(x)*exp(y)
z^(x+y) = z^x * z^y
(x*y)^a = x^a * y^b * exp(2*pi*i*a*floor( (pi-arg(x)-arg(y))/(2*pi) ))
(z^a)^b = z^(a*b) * exp(2*pi*i*b*floor( (pi-Im(a*log(z)))/(2*pi) ))
Then add some worked out examples:
0 = log(1) = log((-1)*(-1)) = log(-1) + log(-1) + 2*pi*i*floor( (pi-pi-pi)/(2*pi) ) = i*pi + i*pi + 2*pi*i*(-1) = 0
One can find more here:
http://functions.wolfram.com/ElementaryFunctions/Log/16/ShowAll.html
Usually one has to be extremely careful and think about all the branches etc. But the above approach provides a robust, simple, algorithmic way to work with complex expressions. That should be stressed.
The sphinx docs should point to theoretical-physics.net somewhere, so that people who find some particular page in google can find their way to the main page.
Incorporate all useful things form kalib1, ... kalib3 pdf files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.