Thursday, June 8, 2017
Announcing GooFit 2.0
Thursday, June 1, 2017
Announcing CLI11 Version 1.0
<regex> support not required). It works on Mac, Linux, and Windows, and has 100% test coverage on all three systems. You can simply drop in a single header file (CLI11.hpp available in releases) to use CLI11 in your own application. Other ways to integrate it into a build system are listed in the README.Friday, October 30, 2015
Feynman Diagrams in Tikz
There is a package for making Feynman diagrams in LaTeX. Unfortunately, it is old and dvi latex only. If you are using pdflatex or lualatex, as you should be, it does not work. Even in regular LaTeX, it's a bit of a pain. Why is there not a new package for pdflatex? Turns out, you don't need one. Due to the powerful drawing library Tikz, you can create any diagram easily, and can customize it completely. For example:
Monday, October 19, 2015
Including CRY cosmic ray generator in CMake
Sunday, July 12, 2015
University of Texas Doctoral Thesis Template
Since I use Bitbucket for all my private repositories (like my thesis itself), the code is in a Bitbucket repository rather than GitHub. Here is the link if you want to create a pull request or want to compile the class and documentation from the source .dtx file.
If all you want is a download of a working version, and if you don't want to compile the code but just want the class file, here are downloadable packages including the class file.
Tuesday, July 7, 2015
Simple Overloading in Python
This is intended as an example to demonstrate the use of overloading in object oriented programming. This was written as a Jupyter notebook (aka IPython) in Python 3. To run in Python 2, simply rename the variables that have unicode names, and replace truediv with div.
While there are several nice Python libraries that support uncertainty (for example, the powerful uncertainties package and the related units and uncertainties package pint), they usually use standard error combination rules. For a beginning physics class, often 'maximum error' combination is used. Here, instead of using a standard deviation based error and using combination rules based on uncorrelated statistical distributions, we assume a simple maximum error and simply add errors.
To implement this, let's build a Python class and use overloading to implement algebraic operations.
import unittest
import math
The main rules are listed below.
If $C=A+B$ or $C=A-B$, then $$ \delta C = \delta A + \delta B. \tag{1} $$
If $C=AB$ or $C=A/B$, then $$ \delta C = C_0 \left( \frac{\delta A}{A_0} + \frac{\delta B}{B_0} \right). \tag{2} $$
Following from that, if $C=A^n$ then $$ \delta C = A_0^n \left( n \frac{\delta A}{A_0} \right). \tag{3} $$
