<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Physics on ISciNumPy.dev</title><link>https://iscinumpy.dev/tags/physics/</link><description>Recent content in Physics on ISciNumPy.dev</description><generator>Hugo</generator><language>en-us</language><managingEditor>henryfs@princeton.edu (Henry Schreiner)</managingEditor><webMaster>henryfs@princeton.edu (Henry Schreiner)</webMaster><lastBuildDate>Fri, 22 May 2026 10:02:17 -0400</lastBuildDate><atom:link href="https://iscinumpy.dev/tags/physics/index.xml" rel="self" type="application/rss+xml"/><item><title>ROOT on Conda Forge</title><link>https://iscinumpy.dev/post/root-conda/</link><pubDate>Wed, 13 Feb 2019 10:18:37 +0100</pubDate><author>henryfs@princeton.edu (Henry Schreiner)</author><guid>https://iscinumpy.dev/post/root-conda/</guid><description>&lt;p&gt;For High Energy Physics, the go-to framework for big data analysis has been
CERN&amp;rsquo;s &lt;a href="https://root.cern"&gt;ROOT&lt;/a&gt; framework. ROOT is a massive C++ library that even predates the
STL in some areas. It is&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; &lt;em&gt;also&lt;/em&gt; a JIT C++ interpreter called Cling, probably
the best in the business. If you have
&lt;a href="https://andersy005.github.io/blog/2018/01/20/play-interactively-with-cpp-getting-started-with-xeus-cling/"&gt;heard of&lt;/a&gt;
the &lt;a href="https://github.com/QuantStack/xeus-cling"&gt;Xeus&lt;/a&gt; C++ Kernel for Jupyter, that is built on top of Cling. ROOT has
everything a HEP physicist could want: math, plotting, histograms, tuple and
tree structures, a very powerful file format for IO, machine learning, Python
bindings, and more. It also does things like dictionary generation and arbitrary
class serialization (other large frameworks like &lt;a href="https://qt.io"&gt;Qt&lt;/a&gt; have similar generation
tools).&lt;/p&gt;
&lt;p&gt;You may already be guessing one of the most common problems for ROOT. It is huge
and difficult to install &amp;ndash; if you build from source, that&amp;rsquo;s a several hour task
on a single core. It has gotten &lt;a href="https://root.cern/install/"&gt;much better&lt;/a&gt; in the
last 6 years, and there are several places you can find ROOT, but there are
still areas where it is challenging. This is especially true for Python; ROOT is
linked to your distro&amp;rsquo;s Python (both python2 and python3 if your distro supports
it, as of ROOT 6.22); but the common rule for using Python is &amp;ldquo;don&amp;rsquo;t touch your
system Python&amp;rdquo; - so modern Python users should be in a virtual environment, and
for that ROOT requires the system site-packages option be enabled, which is not
always ideal. And, if you use the &lt;a href="https://www.anaconda.com/distribution/"&gt;Anaconda Python distribution&lt;/a&gt;,
which is the most popular scientific distribution of Python and massively
successful for ML frameworks, the general rule even for people who build ROOT
themselves has been: don&amp;rsquo;t. But now, you can get a fully featured ROOT binary
package for macOS or Linux, Python 2.7, 3.6, 3.7, or 3.8 from &lt;a href="https://conda-forge.org"&gt;Conda-Forge&lt;/a&gt;,
the most popular Anaconda community channel! Many more HEP recipes have now been
added to Conda-Forge, as well! ROOT now also provides a &lt;a href="https://root.cern/new-docker-images/"&gt;conda docker image&lt;/a&gt;,
too!&lt;/p&gt;</description></item><item><title>ROOT Install Options</title><link>https://iscinumpy.dev/post/root-install/</link><pubDate>Mon, 04 Feb 2019 10:44:37 +0100</pubDate><author>henryfs@princeton.edu (Henry Schreiner)</author><guid>https://iscinumpy.dev/post/root-install/</guid><description>&lt;p&gt;For particle physicists, ROOT is one of the most important toolkits around. It
is a huge suite of tools that predates the C++ standard library, and has almost
anything a particle physicist could want. It has driven developments in other
areas too. ROOT&amp;rsquo;s current C++ interpreter, CLING, is the most powerful C++
interpreter available and is used by the Xeus project for Jupyter. The Python
work has helped PyPy, with CPPYY also coming from ROOT. However, due to the
size, complexity, and age of some parts of ROOT, it can be a bit challenging to
install; and it is even more challenging when you want it to talk to Python. I
would like to point to the brand-new Conda-Forge ROOT package for Linux and
macOS, and point out a few other options for macOS installs. Note for Windows
users: Due to the fact that ROOT expects the type &lt;code&gt;long&lt;/code&gt; to match the system
pointer size, 64-bit Windows cannot be supported for quite some time. While you
can use it in 32 bit form, this is generally impossible to connect to Python,
which usually will be a 64-bit build.&lt;/p&gt;</description></item><item><title>Announcing GooFit 2.1</title><link>https://iscinumpy.dev/post/announcing-goofit-21/</link><pubDate>Thu, 07 Dec 2017 03:20:00 -0500</pubDate><author>henryfs@princeton.edu (Henry Schreiner)</author><guid>https://iscinumpy.dev/post/announcing-goofit-21/</guid><description>&lt;!-- prettier-ignore-start --&gt;
&lt;p class="white"&gt;&lt;img src="https://iscinumpy.dev/images/post/2017/GooFitLogo21small.png" alt="GooFit logo"&gt;&lt;/p&gt;
&lt;!-- prettier-ignore-end --&gt;
&lt;p&gt;GooFit 2.1 introduces the full-featured Python bindings to GooFit. These
bindings mimic the C++ usage of GooFit, including bindings for all PDFs, and
also provide NumPy-centric conversions, live Jupyter notebook printing, pip
install, and more. Most of the examples in C++ are provided in Python form, as
well.&lt;/p&gt;
&lt;p&gt;Several other API changes were made. Observables are now distinguished from
Variables and provided as a separate class. Both these classes are now passed
around by copy everywhere.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; The three and four body amplitude classes have
been refactored and simplified. OpenMP is now supported via homebrew on macOS;
GooFit is one of the only packages that currently can build with OpenMP on the
default macOS compiler. Eigen is now available, and &lt;a href="https://github.com/CLIUtils/CLI11"&gt;CLI11&lt;/a&gt; has been updated to
version 1.3.&lt;/p&gt;
&lt;p&gt;GooFit 2.1 will receive continuing support while development on GooFit 2.2
presses on with a new indexing scheme for PDFs.&lt;/p&gt;</description></item><item><title>Announcing GooFit 2.0</title><link>https://iscinumpy.dev/post/announcing-goofit-20/</link><pubDate>Thu, 08 Jun 2017 17:54:00 -0700</pubDate><author>henryfs@princeton.edu (Henry Schreiner)</author><guid>https://iscinumpy.dev/post/announcing-goofit-20/</guid><description>&lt;p&gt;The next version of the premier CUDA/OpenMP fitting program for HEP analysis,
GooFit 2.0, &lt;a href="GooFit"&gt;has been released&lt;/a&gt;. GooFit is now easy to build on a wide
variety of Unix systems, and supports debuggers and IDEs. GooFit is faster, has
unit tests, and working examples. More PDFs and examples have been added, as
well as newly released example datasets that are downloaded automatically.
GooFit now has built in support for MPI, and can use that to deploy to multiple
graphics cards on the same machine. A new command line parser (&lt;a href="https://github.com/CLIUtils/CLI11"&gt;CLI11&lt;/a&gt;) and
drastically improved logging and errors have made code easier to write and
debug. Usage of GooFit specific terminology is now reduced, using standard
Thrust or CUDA terms when possible, lowering the barrier for new developers. A
new Python script has been added to assist users converting from pre 2.0 code.&lt;/p&gt;
&lt;p&gt;The file structure of GooFit and the build system have been completely revamped.
The fake &lt;code&gt;nvcc&lt;/code&gt; features have been removed, as have the &lt;code&gt;rootstuff&lt;/code&gt; copies of
ROOT classes. PDFs are now organized by type and compile and link separately.
Multiple PDF caching support has improved. The build system now uses CMake and
manages external libraries.&lt;/p&gt;
&lt;p&gt;A new feature of the CMake build system is GooFit Packages, which are complete
packages that can be added to GooFit and built, allowing analysis code to live
in a separate location from GooFit, rather than the old method of simply forking
GooFit and adding your analysis manually. A GooFit Package can be made into an
example trivially. See &lt;a href="https://github.com/maddocbf/goofit_KKPiPi"&gt;this package&lt;/a&gt;
for an example.&lt;/p&gt;
&lt;p&gt;GooFit 2.0 will receive continuing support while development on GooFit 2.1
presses on.&lt;/p&gt;
&lt;h2 id="links"&gt;Links&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://github.com/GooFit/GooFit"&gt;GooFit on GitHub&lt;/a&gt; • &lt;a href="https://GooFit.github.io"&gt;GooFit webpage&lt;/a&gt; • &lt;a href="https://GooFit.github.io/GooFit"&gt;API documentation&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Uncertainty extension for IPython</title><link>https://iscinumpy.dev/post/uncertainty-extension-for-ipython/</link><pubDate>Fri, 24 Jul 2015 06:45:00 -0700</pubDate><author>henryfs@princeton.edu (Henry Schreiner)</author><guid>https://iscinumpy.dev/post/uncertainty-extension-for-ipython/</guid><description>&lt;p&gt;Wouldn&amp;rsquo;t it be nice if we had uncertainty with a nice notation in IPython? The
current method would be to use raw Python,&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;uncertainties&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ufloat&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ufloat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;12.34&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre class="output"&gt;
12.340+/-0.010
&lt;/pre&gt;
&lt;p&gt;Let&amp;rsquo;s use the infix library to make the notation easier. We&amp;rsquo;ll define &lt;code&gt;|pm|&lt;/code&gt; to
mean &lt;code&gt;+/-&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Simple Overloading in Python</title><link>https://iscinumpy.dev/post/simple-operator-overloading-in-python/</link><pubDate>Tue, 07 Jul 2015 09:45:00 -0700</pubDate><author>henryfs@princeton.edu (Henry Schreiner)</author><guid>https://iscinumpy.dev/post/simple-operator-overloading-in-python/</guid><description>&lt;p&gt;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 &lt;code&gt;truediv&lt;/code&gt; with &lt;code&gt;div&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;While there are several nice Python libraries that support uncertainty (for
example, the powerful
&lt;a href="https://pypi.python.org/pypi/uncertainties/"&gt;uncertainties&lt;/a&gt; package and the
related units and uncertainties package
&lt;a href="http://pint.readthedocs.org/en/0.6/"&gt;pint&lt;/a&gt;), they usually use standard error
combination rules. For a beginning physics class, often &amp;lsquo;maximum error&amp;rsquo;
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.&lt;/p&gt;
&lt;p&gt;To implement this, let&amp;rsquo;s build a Python class and use overloading to implement
algebraic operations.&lt;/p&gt;</description></item></channel></rss>