Jekyll2017-09-17T23:12:44-07:00https://duetosymmetry.com/Leo C. SteinPostdoctoral researcher @ Caltech. Specializing in gravity and general relativity.Leo C. Steinleostein@tapir.caltech.eduSimple slow-rotation neutron star structure solver2017-09-08T14:24:09-07:002017-09-08T14:24:09-07:00https://duetosymmetry.com/code/simple-slow-rot-NS-solver<p>I’m releasing into the wild <a href="https://github.com/duetosymmetry/simple-slow-rot-NS-solver">a simple code for computing neutron star
structure in the slow-rotation
expansion</a>
to first and second order. This code was originally from Nico Yunes,
with a bunch of development by Kent Yagi. I rewrote huge chunks of it
to give it a command line/config file interface, turned some magic
numbers into configurable parameters, C++ified some important bits,
etc. Kent gave me his blessing to release it into the wild. For IP
reasons, I first had to remove the dependence on code from Numerical
Recipes, which is why it looks like the commit history starts in
Sept. 2017.</p>
<p>Of course there are already codes like
<a href="http://www.gravity.phys.uwm.edu/rns/">RNS</a> and
<a href="http://www.lorene.obspm.fr/">LORENE</a>, so who needs another NS code?
This code is useful for two reasons:</p>
<ol>
<li>There is a modular implementation of the piecewise-polytropic model
from Read, Lackey, Owen, and Friedman (2009)
[<a href="https://arxiv.org/abs/0812.2163">arXiv:0812.2163</a>] along with their
fits for named EOSs; and</li>
<li>The slow-rotation expansion allows to
accurately extract the moment of inertia and quadrupole moment.</li>
</ol>
<p>Feel free to improve the code in any way you see fit and send me a
pull request, or open a new issue, anything you want under the MIT
license.</p>Leo C. Steinleostein@tapir.caltech.eduI’m releasing into the wild a simple code for computing neutron star structure in the slow-rotation expansion to first and second order. This code was originally from Nico Yunes, with a bunch of development by Kent Yagi. I rewrote huge chunks of it to give it a command line/config file interface, turned some magic numbers into configurable parameters, C++ified some important bits, etc. Kent gave me his blessing to release it into the wild. For IP reasons, I first had to remove the dependence on code from Numerical Recipes, which is why it looks like the commit history starts in Sept. 2017.Living Reviews in Relativity author index2017-08-28T21:10:00-07:002017-08-28T21:10:00-07:00https://duetosymmetry.com/rebuilt-lrr-index<p>Some time ago I hit the ‘old man shaking his fist at a cloud’ age.
Then Springer took over Living Reviews in Relativity and moved all the
papers into their infrastructure. Along with this move was the demise
of the LRR server and the old LRR author index (snapshot seen
<a href="https://web.archive.org/web/20161125104822/http://relativity.livingreviews.org/Articles/author.html">here</a>
from the Internet Archive).</p>
<p>Thanks to the magic of INSPIRE’s xml and writing
<a href="https://github.com/duetosymmetry/lrr-index">a bit of python code</a>,
I was able to resurrect my own copy of the author index. I don’t know
if anybody else will find it useful, but you can browse it here:
<a href="https://duetosymmetry.com/lrr-index/">LRR author index</a>.</p>Leo C. Steinleostein@tapir.caltech.eduI missed the author index from LRR, so I rebuilt one.Note on simple(r) equations for Einstein-dilaton-Gauss-Bonnet and dynamical Chern-Simons theories2017-08-06T22:43:00-07:002017-08-06T22:43:00-07:00https://duetosymmetry.com/notes/note-on-simple-eoms-for-edgb-dcs<p>Special thanks to Helvi Witek, who originally showed me one simplified
form of the “C-tensor” in Einstein-dilaton-Gauss-Bonnet (EDGB).
<script type="math/tex">
\newcommand{\cd}{\nabla}
\newcommand{\dR}{ {}^{*}\!R}
\newcommand{\ddR}{ {}^{*}\!R^{*}{} }
</script></p>
<hr />
<p>If you’ve ever looked into theories beyond general relativity, you’re
already aware that their field equations can be very complicated. For
example, here’s a clip from <a href="https://arxiv.org/abs/1511.05513">one paper on EDGB</a>:</p>
<p><img src="https://duetosymmetry.com/images/EDGB-scary.png" alt="Scary equations for EDGB" /></p>
<p>Ack! That’s pretty unwieldy. But don’t despair, it turns out that
the above mess can be written much more compactly.</p>
<p>Just to set conventions, let’s work with the action</p>
<div>
\begin{align}
\label{eq:action1}
S = \int d^4x \sqrt{-g} \left[
\frac{1}{2}m_{pl}^2 R
- \frac{1}{2} (\cd^a \vartheta) (\cd_a \vartheta)
\right]
+ S_{int}
\end{align}
</div>
<p>where <script type="math/tex">\vartheta</script> is a scalar (dilaton or axion) and <script type="math/tex">S_{int}</script> is
a non-minimal interaction term between the scalar and curvature.</p>
<h2 id="einstein-dilaton-gauss-bonnet">Einstein-dilaton-Gauss-Bonnet</h2>
<p>For EDGB, let’s take</p>
<div>
\begin{align}
\label{eq:SEDGB}
S_{int}^{EDGB} = -\frac{1}{8} m_{pl} \ell^2
\int d^4x \sqrt{-g}
F(\vartheta)
\left[
R^2 - 4 R_{ab}R^{ab} + R_{abcd}R^{abcd}
\right]
\end{align}
</div>
<p>with some arbitrary coupling function F, and some dimensional
parameter <script type="math/tex">\ell</script>. Now this above curvature combination might seem
arbitrary, but it’s actually the 4-dimensional Euler density (see
e.g. <a href="http://jacobi.luc.edu/Useful.html#EulerDensities">Bob McNees’s notes</a>).
It’s more natural to write that as</p>
<div>
\begin{align}
\label{eq:euler4}
\ddR_{abcd}R^{abdc} = R^2 - 4 R_{ab}R^{ab} + R_{abcd}R^{abcd}.
\end{align}
</div>
<p>Here we’ve defined the <em>double-dual</em> <script type="math/tex">\ddR</script> of the Riemann tensor.
First, we dualize on the left two antisymmetric indices to define the
left-dual,</p>
<div>
\begin{align}
\label{eq:leftdual}
\dR^{abcd} \equiv \frac{1}{2} \epsilon^{abef} R_{ef}{}^{cd},
\end{align}
</div>
<p>and then we further dualize on the right two antisymmetric indices to
get the double-dual,</p>
<div>
\begin{align}
\label{eq:doubledual}
\ddR^{abcd} \equiv \dR^{ab}{}_{gh} \frac{1}{2} \epsilon^{ghcd}
= \frac{1}{2} \epsilon^{abef} R_{efgh} \frac{1}{2} \epsilon^{ghcd}.
\end{align}
</div>
<p>Now, it’s an exercise in algebraic manipulation to show that the
equation for the metric from the action defined in
Eqs. \eqref{eq:action1}, \eqref{eq:SEDGB} is given simply by</p>
<div>
\begin{align}
\label{eq:eom-EDGB}
\boxed{
m_{pl}^2 G_{ab} - m_{pl} \ell^2 \cd^c \cd^d
\left[
\ddR_{cabd} F(\vartheta)
\right] = T_{ab}
}
\end{align}
</div>
<p>where <script type="math/tex">T_{ab}</script> is the stress-energy tensor for matter plus the
stress-energy tensor for the scalar field. That’s quite a
bit simpler than the image above, isn’t it! If you want to get
xTensor to verify this for you, grab
<code class="highlighter-rouge">EDGB-and-DCS-EOMs-and-C-tensors-simplified.nb</code> from the
<a href="https://github.com/xAct-contrib/examples">xAct examples collection</a>.</p>
<p>I wrote the above in a certain way to make it look very similar to the
case of dynamical Chern-Simons (DCS, below), but before moving on—recall
that one reason people like EDGB is that the equations of motion are
only second order in the metric. That’s not obvious from the way I
wrote it, because it looks like you might get third and fourth
derivatives of the metric. However, one nice property of the
double-dual of Riemann is that it’s divergence free (see MTW
Eq. (13.51) and exercise 13.11). This means we can rewrite</p>
<div>
\begin{align}
\label{eq:C-tensor-EDGB-idents}
\cd^c \cd^d
\left[
\ddR_{cabd} F(\vartheta)
\right]
=
\cd^c
\left[
\ddR_{cabd} \cd^d F(\vartheta)
\right]
=
\ddR_{cabd} \cd^c \cd^d F(\vartheta).
\end{align}
</div>
<p>Now it’s obvious that there are only second derivatives of the metric.
However, the first or second forms might give more insight, because
from them you can see that this so-called “C-tensor” is itself the
divergence of some tensor. That’s the kind of thing you might want to
integrate over a region…</p>
<h2 id="dynamical-chern-simons">Dynamical Chern-Simons</h2>
<p>Anyway, on to DCS. Now we use the interaction term</p>
<div>
\begin{align}
\label{eq:SDCS}
S_{int}^{DCS} = -\frac{1}{8} m_{pl} \ell^2
\int d^4x \sqrt{-g}
F(\vartheta)
\dR^{abcd} R_{abcd}
\end{align}
</div>
<p>with just a single dual. Again it looks kind of arbitrary, but
when <script type="math/tex">\dR^{abcd} R_{abcd}</script> is integrated over the whole manifold,
you get a topological invariant.</p>
<p>The equation for the metric in DCS is also kind of scary looking, but
again some algebra shows that you can write it as</p>
<div>
\begin{align}
\label{eq:eom-DCS}
\boxed{
m_{pl}^2 G_{ab} - m_{pl} \ell^2 \cd^c \cd^d
\left[ \dR_{c(ab)d} F(\vartheta)
\right] = T_{ab}
}
\end{align}
</div>
<p>where <script type="math/tex">(ab)</script> means that we are symmetrizing (with a factor of 1/2)
on those two indices. This looks very similar to the expression for
EDGB! However, the single-dual of Riemann is only manifestly
divergence-free on the left two indices, so
this equation does have third derivatives of the metric. The
double-divergence does vanish, so there are no fourth
derivatives.</p>
<p>All of the above calculations are in my notebook
<code class="highlighter-rouge">EDGB-and-DCS-EOMs-and-C-tensors-simplified.nb</code> in the
<a href="https://github.com/xAct-contrib/examples">xAct examples collection</a>.
Hope you learned something!</p>Leo C. Steinleostein@tapir.caltech.eduHere to save you some algebra and column-inchesRecent talks in Rome and Nottingham2017-07-24T17:00:00-07:002017-07-24T17:00:00-07:00https://duetosymmetry.com/talks/recent-talks-Rome-Nottingham<p>Just an update on talks I gave recently. Valeria Ferrari, Leonardo
Gualtieri, and Paolo Pani hosted the conference “<a href="https://agenda.infn.it/conferenceDisplay.py?ovw=True&confId=12616">New Frontiers in
Gravitational-Wave
Astrophysics</a>”
at Sapienza University in Rome, and graciously invited me to speak
about “Numerical black holes and mergers in theories beyond GR”
(<a href="https://agenda.infn.it/conferenceTimeTable.py?confId=12616#20170621.detailed">slides available from their web
site</a>:
click on the little folder next to my name).</p>
<p>Then in July, Thomas Sotiriou invited me to come visit the University
of Nottingham (home of Robin Hood). I gave two talks: first, a more
general one, “Probing strong-field gravity: black holes and mergers in
general relativity and beyond” for non-experts; and second, to
Thomas’s strong-gravity group meeting, a talk covering my <a href="https://duetosymmetry.com/pubs/NHEK-met-pert/">recent work
on separing metric perturbations in near-horizon extremal Kerr</a>.</p>Leo C. Steinleostein@tapir.caltech.eduJust an update on talks I gave recently. Valeria Ferrari, Leonardo Gualtieri, and Paolo Pani hosted the conference “New Frontiers in Gravitational-Wave Astrophysics” at Sapienza University in Rome, and graciously invited me to speak about “Numerical black holes and mergers in theories beyond GR” (slides available from their web site: click on the little folder next to my name).Separating metric perturbations in near-horizon extremal Kerr spacetimes2017-07-19T00:00:00-07:002017-07-19T00:00:00-07:00https://duetosymmetry.com/pubs/NHEK-met-pert<p class="align-right" style="width: 350px"><img src="https://duetosymmetry.com/images/NHEK-schem.png" alt="" /></p>
<blockquote>
<p>Linear perturbation theory is a powerful toolkit for studying black
hole spacetimes. However, the perturbation equations are hard to
solve unless we can use separation of variables. In the Kerr
spacetime, metric perturbations do not separate, but curvature
perturbations do. The cost of curvature perturbations is a very
complicated metric-reconstruction procedure. This procedure can be
avoided using a symmetry-adapted choice of basis functions in highly
symmetric spacetimes, such as near-horizon extremal Kerr. In this
paper, we focus on this spacetime, and (i) construct the
symmetry-adapted basis functions; (ii) show their orthogonality; and
(iii) show that they lead to separation of variables of the scalar,
Maxwell, and metric perturbation equations. This separation turns
the system of partial differential equations into one of ordinary
differential equations over a compact domain, the polar angle.</p>
</blockquote>Leo C. Steinleostein@tapir.caltech.eduWhenever you've got symmetry, you should use it!Numerical binary black hole mergers in dynamical Chern-Simons: I. Scalar field2017-05-23T00:00:00-07:002017-05-23T00:00:00-07:00https://duetosymmetry.com/pubs/numerical-bbh-in-dcs-scalar<p>Here’s a movie from one of the simulations we ran for this paper:</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/WQH-1b_XUM4" frameborder="0" allowfullscreen=""></iframe>
<hr />
<p class="align-right" style="width: 250px"><img src="https://duetosymmetry.com/images/num-order-reduced-dcs-waveforms.png" alt="" /></p>
<blockquote>
<p>Testing general relativity in the non-linear, dynamical,
strong-field regime of gravity is one of the major goals of
gravitational wave astrophysics. Performing precision tests of
general relativity (GR) requires numerical inspiral, merger, and
ringdown waveforms for binary black hole (BBH) systems in theories
beyond GR. Currently, GR and scalar-tensor gravity are the only
theories amenable to numerical simulations. In this article, we
present a well-posed perturbation scheme for numerically integrating
beyond-GR theories that have a continuous limit to GR. We
demonstrate this scheme by simulating BBH mergers in dynamical
Chern-Simons gravity (dCS), to linear order in the perturbation
parameter. We present mode waveforms and energy fluxes of the dCS
pseudoscalar field from our numerical simulations. We find good
agreement with analytic predictions at early times, including the
absence of pseudoscalar dipole radiation. We discover new
phenomenology only accessible through numerics: a burst of dipole
radiation during merger. We also quantify the self-consistency of
the perturbation scheme. Finally, we estimate bounds that
GR-consistent LIGO detections could place on the new dCS length
scale, approximately <script type="math/tex">\ell \lesssim \mathcal{O}(10)</script> km.</p>
</blockquote>Leo C. Steinleostein@tapir.caltech.eduOne of the first numerical simulations of black hole mergers in beyond-GR effective field theoriesNote on commutation coefficients in two ways2017-05-04T13:52:00-07:002017-05-04T13:52:00-07:00https://duetosymmetry.com/notes/note-on-commutation-coefficients-two-ways<script type="math/tex">
\newcommand{\cd}{\nabla}
\newcommand{\pd}{\partial}
\newcommand{\Lie}{\mathcal{L}}
</script>
<p>Suppose somebody hands you a collection of n linearly-independent
vector fields <script type="math/tex">\{v_a\}_{a=1}^n</script> on an n-dimensional manifold, which
you can use as a frame field (not necessarily an orthonormal frame
field, because I haven’t said anything about a metric yet!). A
natural thing to compute are the <em>commutation coefficients</em> of these
vector fields,</p>
<div>
\begin{align}
\label{eq:vec-c}
[v_a, v_b] = c_{ab}{}^d v_d \,,
\end{align}
</div>
<p>where we decompose the commutators back into the basis of the vector
fields themselves. The collection of scalar fields <script type="math/tex">c_{ab}{}^d</script> are
called the commutation coefficients. Because of the antisymmetry of
the Lie bracket, the commutation coefficients are automatically
antisymmetric in the lower two indices.</p>
<p>On the other hand, let’s say somebody hands you a collection of n
linearly-independent one-forms <script type="math/tex">\{\theta^a\}_{a=1}^n</script>, which you can
use as a coframe field (again not necessarily orthonormal, because no
metric yet; and this coframe field might not be dual to the frame
field). A natural thing to compute is the exterior derivative of each
form, <script type="math/tex">d\theta^a</script>, which you could then expand in the basis of
two-forms made by wedging together the <script type="math/tex">\theta^a</script>’s. So you could
define another set of coefficients <script type="math/tex">\tilde{c}</script> from</p>
<div>
\begin{align}
\label{eq:covec-c}
d\theta^a = \tilde{c}^a{}_{bd} \frac{1}{2} \theta^b \wedge \theta^d
\end{align}
</div>
<p>where we have included a factor of 1/2 for future convenience. (This
is not to be confused with the connection 1-form <script type="math/tex">\omega^a{}_b</script>.)</p>
<p>The wedge product of two one-forms is automatically antisymmetric, so
again we have this property that the collection of scalar fields
<script type="math/tex">\tilde{c}^a{}_{bd}</script> is automatically antisymmetric in the lower
indices.</p>
<p>This should probably lead you to suspect that the two sets of
coefficients are related when the vector and covector bases are
related. So, let’s now say that the two bases are dual to each other,</p>
<div>
\begin{align}
\theta^a(v_b) = \langle \theta^a, v_b \rangle = i_{v_b} \theta^a
= \delta^a_b \,.
\end{align}
</div>
<p>Notice that we still haven’t needed a metric: finding a dual basis is
possible without metric (roughly, you only need to be able to do
matrix inversion).</p>
<p>Now we can extract components of each equation, Eqs. \eqref{eq:vec-c}
and \eqref{eq:covec-c}, by contracting with the right type of object.
If we contract Eq. \eqref{eq:vec-c} with <script type="math/tex">\theta^e</script>, we’ll find</p>
<div>
\begin{align}
c_{ab}{}^e = \langle \theta^e, [v_a, v_b] \rangle
= i_{[v_a, v_b]} \theta^e \,.
\end{align}
</div>
<p>Similarly, if we insert two vectors into the two slots of
Eq. \eqref{eq:covec-c}, we find</p>
<div>
\begin{align}
\tilde{c}^a{}_{ef} = (d\theta^a)(v_e, v_f)
= i_{v_f} i_{v_e} d\theta^a \,.
\end{align}
</div>
<p>So now the question is: what is the relationship, if any, between</p>
<div>
\begin{align}
i_{[v,w]} \omega && \textrm{and} && i_v i_w d\omega \ ?
\end{align}
</div>
<p>In fact, with the use of some
<a href="https://duetosymmetry.com/notes/note-on-exterior-interior-Lie-derivative-superalgebra/">differential identities</a>
(or a one-liner in my package
<a href="http://www.xact.es/xTerior/">xTerior</a>, using the function
<code class="highlighter-rouge">SortDerivations[]</code>)
you can show that for any vectors <script type="math/tex">v, w</script> and form <script type="math/tex">\omega</script>, we have</p>
<div>
\begin{align}
\label{eq:fancy}
i_v i_w d\omega = i_{[v,w]} \omega
+ d i_v i_w \omega
- \Lie_v i_w \omega + \Lie_w i_v \omega
\end{align}
</div>
<p>(there are a bunch of equivalent ways to rewrite this). Now let
<script type="math/tex">v=v_a, w = v_b, \omega=\theta^d</script>. Since
<script type="math/tex">i_{v_a}\theta^d = \delta^d_a</script>, the last three terms on the right
hand side of Eq. \eqref{eq:fancy} will vanish. In this case we’ll
find</p>
<div>
\begin{align}
i_{v_a} i_{v_b} d\theta^d = i_{[v_a, v_b]} \theta^d
\end{align}
</div>
<p>which immediately tells us that</p>
<div>
\begin{align}
c_{ab}{}^d = -\tilde{c}^d{}_{ab}
\,.
\end{align}
</div>
<p>So indeed, the same information is encoded in the commutation
coefficients of vectors, <script type="math/tex">c_{ab}{}^d</script>, and the decomposition of
<script type="math/tex">d\theta^d</script> into basis two-forms, <script type="math/tex">\tilde{c}^d{}_{ab}</script>.</p>
<p>Note again that everything has been independent of a metric.</p>
<div>
\begin{align}
\end{align}
</div>Leo C. Steinleostein@tapir.caltech.eduAn identity between vector commutation coefficients and coframe connection coefficientsNote on exterior, interior, and Lie derivative superalgebra2017-05-03T19:18:00-07:002017-05-03T19:18:00-07:00https://duetosymmetry.com/notes/note-on-exterior-interior-Lie-derivative-superalgebra<script type="math/tex">
\newcommand{\cd}{\nabla}
\newcommand{\pd}{\partial}
\newcommand{\Lie}{\mathcal{L}}
</script>
<p>This is just a short note to help me remember some very important
identities in exterior differential geometry. For a pleasant
introduction to the topic, I recommend Schutz<sup id="fnref:1"><a href="#fn:1" class="footnote">1</a></sup>. I learned the
superalgebra interpretation from the beginning of Guillemin and
Sternberg<sup id="fnref:2"><a href="#fn:2" class="footnote">2</a></sup>.</p>
<p>In exterior differential geometry, there are a few basic operations we
use all the time. Let’s start with a form <script type="math/tex">\alpha</script> of degree
<script type="math/tex">a</script>, and <script type="math/tex">\beta</script> of degree <script type="math/tex">b</script>. Then we know we can <em>wedge</em> the
two together to get a form of degree <script type="math/tex">a+b</script>,</p>
<div>
\begin{align}
\omega \equiv \alpha \wedge \beta = (-1)^{ab} \beta \wedge \alpha \,.
\end{align}
</div>
<p>Already we can say that the space of forms is <a href="https://en.wikipedia.org/wiki/Graded_ring#Anticommutativity">graded and anticommutative</a>.
When we move a form past another, we pick up this factor of <script type="math/tex">(-1)^{ab}</script>.
One natural thing we know how to do with forms is to take their
<a href="https://en.wikipedia.org/wiki/Exterior_derivative">exterior derivatives</a>,</p>
<div>
\begin{align}
d\omega = (d\alpha)\wedge \beta + (-1)^{a} \alpha \wedge (d\beta)
\,.
\end{align}
</div>
<p>The exterior derivative operator increases the degree of a form by 1.
From the commutation of partial derivatives, we know that <script type="math/tex">d^2=0</script>.
We see that <script type="math/tex">d</script> satisfies some version of the Leibniz rule, as a
derivative must, but there is a factor of <script type="math/tex">(-1)^{a}</script>, as if we have
moved a degree 1 form past <script type="math/tex">\alpha</script>. The operator <script type="math/tex">d</script>
is acting very much like it wants to be considered as a degree 1
object.</p>
<p>For our other basic operations we’ll need to introduce some vector
fields, <script type="math/tex">v, w</script>. The most obvious things to do with vectors are to
pair them with their duals—covectors, i.e. one-forms. Because too
many people have invented their own notations, we have all the
possibile notations</p>
<div>
\begin{align}
\langle \alpha, v \rangle = \alpha(v) = v \lrcorner \alpha = i_v \alpha
\end{align}
</div>
<p>for a one-form <script type="math/tex">\alpha</script>. Actually we will generalize and allow
<script type="math/tex">i_v</script> to mean “insert vector <script type="math/tex">v</script> into the first slot of the
following degree <script type="math/tex">a</script> form”, i.e.</p>
<div>
\begin{align}
(i_v \alpha)(\underbrace{-, \ldots, -}_{a-1~\mathrm{ slots}}) =
\alpha(\underbrace{v, -, \ldots, -}_{a~\mathrm{slots}})
\,.
\end{align}
</div>
<p>Since forms are alternating in all of their slots, we automatically
get the identity</p>
<div>
\begin{align}
i_v i_w = -i_w i_v \,,
\end{align}
</div>
<p>so this
“<a href="https://en.wikipedia.org/wiki/Interior_product">interior multiplication</a>”
operation satisfies anticommutativity. When we extend to wedge
products, we again get something that looks like a Leibniz rule,</p>
<div>
\begin{align}
i_v (\alpha \wedge \beta) = (i_v \alpha) \wedge \beta
+ (-1)^a \alpha \wedge (i_v \beta)
\,.
\end{align}
</div>
<p>This is quite interesting, because we again get a factor of <script type="math/tex">(-1)^a</script>
that looks like we have moved an odd degree form past <script type="math/tex">\alpha</script>.
Since <script type="math/tex">i_v</script> lowers the degree of a form, it’s consistent to think of
it as having “degree –1”.</p>
<p>The final type of operation we care about here is
the <a href="https://en.wikipedia.org/wiki/Lie_derivative">Lie derivative</a>.
Almost anything can be Lie differentiated along a vector field <script type="math/tex">v</script>.
I will just skip ahead and remind us that</p>
<div>
\begin{align}
\Lie_v \omega = (\Lie_v \alpha) \wedge \beta + \alpha \wedge (\Lie_v \beta)
\,,
\end{align}
</div>
<p>Again, a Leibniz rule, as it must be, this time without any factors of
–1. This should make you think that <script type="math/tex">\Lie_v</script> is acting like an
object of degree 0, which is consistent with the fact that it does not
change the degree of forms that it acts on.</p>
<p>But there are other ways to take one derivative of a form <script type="math/tex">\omega</script>
and get back a form of the same degree, using a vector <script type="math/tex">v</script>.
Specifically, we can first raise the degree with <script type="math/tex">d</script> and then lower
it with <script type="math/tex">i_v</script>, or vice versa. So you might expect that <script type="math/tex">\Lie_v</script>
is somehow related to these two other possibilities. In fact, that is
the content of “Cartan’s magic formula”,</p>
<div>
\begin{align}
\label{eq:Cartan}
\Lie_v \omega = di_v \omega + i_v d\omega
\,.
\end{align}
</div>
<p>You can prove this inductively if you wish.</p>
<p>Eq. \eqref{eq:Cartan} is very suggestive in two ways. First, if
you’re counting the “degrees” of <script type="math/tex">d, \Lie_v, i_v</script> as <script type="math/tex">+1, 0, -1</script>,
then you’ll notice that this formula works out correctly. Second, on
the right hand side we have the <em>sum</em> of two “derivative” operations,
but they are yielding one derivative operation on the left. Usually
this would happen if we had considered a difference, or commutator of
two derivative operators. So maybe we have to consider a different
type of commutator?</p>
<p>Let’s look at all the identities we have amongst the operators (where
<script type="math/tex">[v,w]</script> means the Lie bracket of vector fields):</p>
<table>
<thead>
<tr>
<th> </th>
<th><script type="math/tex">d</script></th>
<th><script type="math/tex">\Lie</script></th>
<th><script type="math/tex">i</script></th>
</tr>
</thead>
<tbody>
<tr>
<td><script type="math/tex">d</script></td>
<td><script type="math/tex">d^2 = 0</script></td>
<td><script type="math/tex">d\Lie_v - \Lie_v d = 0</script></td>
<td><script type="math/tex">di_v + i_vd = \Lie_v</script></td>
</tr>
<tr>
<td><script type="math/tex">\Lie</script></td>
<td>–</td>
<td><script type="math/tex">\Lie_v \Lie_w - \Lie_w \Lie_v = \Lie_{[v,w]}</script></td>
<td><script type="math/tex">\Lie_v i_w - i_w \Lie_v = i_{[v,w]}</script></td>
</tr>
<tr>
<td><script type="math/tex">i</script></td>
<td>–</td>
<td>–</td>
<td><script type="math/tex">i_v i_w + i_w i_v = 0</script></td>
</tr>
</tbody>
</table>
<p>You’ll notice that minus signs only appear in the row and column
labeled by <script type="math/tex">\Lie.</script> That means that we can define for ourselves a
<a href="https://en.wikipedia.org/wiki/Lie_superalgebra">supercommutator</a>,</p>
<div>
\begin{align}
[x,y] \equiv xy - (-1)^{|x|\, |y|} yx
\,,
\end{align}
</div>
<p>where <script type="math/tex">|x|</script> is the degree of <script type="math/tex">x</script>. Now we can honestly claim that
<script type="math/tex">d, \Lie_v, i_v</script> have degrees <script type="math/tex">+1, 0, -1</script>, because we have a
superalgebra! Rewriting our table in this language is quite beautiful:</p>
<table>
<thead>
<tr>
<th> </th>
<th><script type="math/tex">d</script></th>
<th><script type="math/tex">\Lie</script></th>
<th><script type="math/tex">i</script></th>
</tr>
</thead>
<tbody>
<tr>
<td><script type="math/tex">d</script></td>
<td><script type="math/tex">[d,d] = 0</script></td>
<td><script type="math/tex">[d,\Lie_v]= 0</script></td>
<td><script type="math/tex">[d,i_v] = \Lie_v</script></td>
</tr>
<tr>
<td><script type="math/tex">\Lie</script></td>
<td>–</td>
<td><script type="math/tex">[\Lie_v, \Lie_w] = \Lie_{[v,w]}</script></td>
<td><script type="math/tex">[\Lie_v, i_w] = i_{[v,w]}</script></td>
</tr>
<tr>
<td><script type="math/tex">i</script></td>
<td>–</td>
<td>–</td>
<td><script type="math/tex">[i_v, i_w] = 0</script></td>
</tr>
</tbody>
</table>
<p>Notice that the result on the right hand side of each of these
(super)commutators is almost uniquely determined just by being
consistent about degrees.</p>
<h1 id="references">References</h1>
<div class="footnotes">
<ol>
<li id="fn:1">
<p>Schutz, <a href="https://books.google.com/books?id=HAPMB2e643kC">Geometrical Methods of Mathematical Physics</a> <a href="#fnref:1" class="reversefootnote">↩</a></p>
</li>
<li id="fn:2">
<p>Guillemin and Sternberg, <a href="https://books.google.com/books?id=LWXyCAAAQBAJ">Supersymmetry and Equivariant de Rham Theory</a> <a href="#fnref:2" class="reversefootnote">↩</a></p>
</li>
</ol>
</div>Leo C. Steinleostein@tapir.caltech.eduThese three objects form a superalgebra! Whoa!ssh ipython notebook tunneling magic2017-04-19T22:24:00-07:002017-04-19T22:24:00-07:00https://duetosymmetry.com/code/ssh-ipython-notebook-magic<p>The problem: you have large datasets on a remote machine and want to
use an <code class="highlighter-rouge">ipython</code> (<a href="http://jupyter.org/"><code class="highlighter-rouge">jupyter</code></a>) notebook to
interactively analyse your data. You could transfer the data to your
local machine, or mount the remote drive. But ideally, the <code class="highlighter-rouge">jupyter</code>
server should run on the remote machine, so that only the much smaller
<em>web page</em> data is transferred. This is what you want to happen:</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/rfGnFiO9sME" frameborder="0" allowfullscreen=""></iframe>
<p>If you’ve ever started <code class="highlighter-rouge">jupyter</code> locally, this will look familiar.
But if you launch it on the remote machine, then <code class="highlighter-rouge">jupyter</code> is going to
try to launch a browser on the remote instead of locally.</p>
<p>One solution is to use <code class="highlighter-rouge">ssh</code> tunneling, but you’re responsible for
opening the tunnel and manually connecting your local browser to the
tunnel.</p>
<p>I pulled together a solution that involves
an <a href="https://www.iterm2.com/"><code class="highlighter-rouge">iTerm2</code></a> trigger to locally launch your
browser. This will work in any programmable terminal that has trigger
functionality. There may be other solutions, please contact me if you
have something cleaner.</p>
<h1 id="instructions">Instructions</h1>
<p>There are just 3 steps:</p>
<ol>
<li>
<p>On your local machine, set up your <code class="highlighter-rouge">ssh_config</code> to always forward a
specific port for this remote host. I picked 8889, leaving 8888
free for a locally-running <code class="highlighter-rouge">jupyter</code>. To do this, add an entry for
the remote host in <code class="highlighter-rouge">~/.ssh/config</code> with the <code class="highlighter-rouge">LocalForward</code> keyword
like so:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>Host wheeler
HostName wheeler.caltech.edu
User leostein
ForwardX11 no
LocalForward 8889 localhost:8888
</code></pre>
</div>
<p>This tells <code class="highlighter-rouge">ssh</code> that whenever I <code class="highlighter-rouge">ssh wheeler</code>, it’s also going to
forward my <em>local</em> port 8889 to the <em>remote</em> interface:port pair
localhost:8888, which is where the remote <code class="highlighter-rouge">jupyter</code> server is going
to be listening.</p>
</li>
<li>
<p>On your remote machine, edit your
<code class="highlighter-rouge">~/.jupyter/jupyter_notebook_config.py</code> to use a custom “browser”.
If you don’t already have a config file, then run <code class="highlighter-rouge">jupyter notebook
--generate-config</code> to create one in the default place. Open this
file and find the variable named <code class="highlighter-rouge">NotebookApp.browser</code>. Uncomment
it and set it to emit a magic keyword. I set this:</p>
<div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="n">c</span><span class="o">.</span><span class="n">NotebookApp</span><span class="o">.</span><span class="n">browser</span> <span class="o">=</span> <span class="s">u'echo TRIGGER-ITERM-2-WHEELER-JUPYTER </span><span class="si">%</span><span class="s">s'</span>
</code></pre>
</div>
<p>The <code class="highlighter-rouge">%s</code> is going to get replaced with the URL on the remote
server. I found that the <code class="highlighter-rouge">%s</code> is necessary for <code class="highlighter-rouge">jupyter</code> to
actually execute this command.</p>
</li>
<li>
<p>Configure <code class="highlighter-rouge">iTerm2</code> with a trigger. Go to Preferences > Profiles,
select the relevant profile (probably default if you haven’t
customized anything). Then go to Advanced, and under Triggers, hit
Edit:</p>
<p><img src="https://duetosymmetry.com/images/iterm2-prefs-profs-advanced.png" alt="" /></p>
<p>Hit the plus to add a new trigger. Set the regular expression to</p>
<div class="highlighter-rouge"><pre class="highlight"><code>^TRIGGER-ITERM-2-WHEELER-JUPYTER
</code></pre>
</div>
<p>using the same magic keyword as in step 2 (if you omit the caret,
you’re going to have an annoying time editing the
<code class="highlighter-rouge">jupyter_notebook_config</code> in the future, if you need to do that).
Set the Action to ‘Run Command…’. Then set the Parameters to</p>
<div class="highlighter-rouge"><pre class="highlight"><code>open "http://localhost:8889/tree"
</code></pre>
</div>
<p>using the same <em>local</em> port as in step 1. You should see something
like this:</p>
<p><img src="https://duetosymmetry.com/images/iterm2-prefs-profs-advanced-2.png" alt="" /></p>
</li>
</ol>
<p>That’s it! Next time you <code class="highlighter-rouge">ssh</code> to your remote host from <code class="highlighter-rouge">iTerm2</code> and
start <code class="highlighter-rouge">jupyter</code>, your local browser will launch and automatically
connect to the remote ipython session.</p>
<h1 id="extra-credit">Extra credit</h1>
<p>The solution above picked a specific local port to go with a specific
server, and tunnels to a predetermined remote port. It won’t work if
you try to have multiple remote jupyter servers on the same remote.
You will also have to have specific port numbers in your <code class="highlighter-rouge">ssh_config</code>
and <code class="highlighter-rouge">iTerm2</code> triggers, one for each remote.</p>
<p>There is a better solution. <code class="highlighter-rouge">iTerm2</code> will capture groups in triggers’
regular expressions, and can pass them as parameters to the
command. Therefore you can:</p>
<ol>
<li>Set your remote jupyter <code class="highlighter-rouge">NotebookApp.browser</code> to also emit your
<remote_user> and <remote_host></li>
<li>Write a trigger regex to match the above string and capture groups
for username, hostname, and <remote_interface>:<remote_port> pair
out of the URL</li>
<li>Pass those parameters to a local (python) script</li>
<li>
<p>Your python script must find a free local port, say <local_port>.
Then it will execute</p>
<div class="highlighter-rouge"><pre class="highlight"><code>ssh -N -f -L <local_port>:<remote_interface>:<remote_port> <remote_user>@<remote_host>
</code></pre>
</div>
<p>where values in angled brackets get replaced with parameters that
were passed from the regex capture groups.</p>
</li>
<li>Finally, your script will launch your local browser pointing to
“http://localhost:<local_port>/tree”.</li>
</ol>
<p>If you implement this, please let me know!</p>Leo C. Steinleostein@tapir.caltech.eduHow to get remote jupyter to automatically open a local browser.Note on Lie derivatives and divergences2017-04-12T16:00:00-07:002017-04-12T16:00:00-07:00https://duetosymmetry.com/notes/note-on-Lie-derivatives-and-divergences<script type="math/tex">
\newcommand{\cd}{\nabla}
\newcommand{\pd}{\partial}
\newcommand{\Lie}{\mathcal{L}}
</script>
<p>One of Saul Teukolsky’s favorite pieces of advices is if you’re ever
stuck, try integrating by parts. If we’re working with a covariant
derivative <script type="math/tex">\cd_a</script>, and we have some tensor quantities <script type="math/tex">S, T</script> under
an integral, then every calculus student knows that we can move the
derivative from one to the other,</p>
<div>
\begin{align}
\int_R S (\cd_a T) \sqrt{|g|} d^nx =
\int_R (- \cd_a S) T \sqrt{|g|} d^nx + \textrm{boundary term.}
\end{align}
</div>
<p>(Of course, this only makes sense if your integral itself makes
sense—so <script type="math/tex">\cd, S, T</script> together make the integrand a scalar.) Here
<script type="math/tex">R</script> is the integration region, and the boundary terms above come
from
<a href="https://en.wikipedia.org/wiki/Stokes%27_theorem">Stokes’ theorem</a>,
converting the integral of a total divergence in <script type="math/tex">R</script> into the
integral of a flux through the boundary <script type="math/tex">\pd R</script>.</p>
<p>Sometimes in differential geometry, instead of dealing with a
metric-compatible covariant derivative <script type="math/tex">\cd_a</script>, we’re dealing with a
<a href="https://en.wikipedia.org/wiki/Lie_derivative">Lie derivative</a>
<script type="math/tex">\Lie_v</script> along a vector field <script type="math/tex">v</script>. Wouldn’t it be convenient,
then, if we could integrate by parts with Lie derivatives? That is,
do we have the property that</p>
<div>
\begin{align}
\label{eq:Lie-int-by-parts-q}
\int_R S (\Lie_v T) \sqrt{|g|} d^nx \overset{?}{=}
\int_R (- \Lie_v S) T \sqrt{|g|} d^nx + \textrm{boundary term?}
\end{align}
</div>
<p>After all, integrating by parts comes from rearranging the Leibniz
rule <script type="math/tex">\cd_a(S\, T) = (\cd_a S) T + S (\cd_a T)</script>. But the Lie
derivative, being a
<a href="https://en.wikipedia.org/wiki/Derivation_(differential_algebra)">derivation</a>,
also satisfies the Leibniz rule,</p>
<div>
\begin{align}
\label{eq:Lie-Leibniz}
\Lie_v(S\, T) = (\Lie_v S) T + S (\Lie_v T) .
\end{align}
</div>
<p>But in reality all this gets us is the formula</p>
<div>
\begin{align}
\int_R S (\Lie_v T) \sqrt{|g|} d^nx =
\int_R (- \Lie_v S) T \sqrt{|g|} d^nx +
\int_R \Lie_v(S \, T) \sqrt{|g|}d^nx \,.
\end{align}
</div>
<p>If we want this to become Eq. \eqref{eq:Lie-int-by-parts-q}, then we
need the final term to be a total divergence. The sufficient
condition for this to be a total divergence is that <script type="math/tex">v^a</script> <em>must be
divergence-free</em>. We can show this by detouring back through
covariant derivatives. First, notice that for this integrand
to make sense, we need all the indices in the product <script type="math/tex">ST</script> to be
contracted so that it is a scalar. Now the action of a Lie derivative
on a scalar is the same as the action of that vector on the scalar,
and can also be expressed in terms of any covariant derivative,</p>
<div>
\begin{align}
\Lie_v(S \, T) = v(S \, T) = v^a \pd_a (S \, T )= v^a \cd_a (S \, T) \,.
\end{align}
</div>
<p>Notice that when <script type="math/tex">\cd_a v^a = 0</script>, we can pull it inside the
derivative,</p>
<div>
\begin{align}
\cd_a v^a = 0 \quad \Longrightarrow \quad
v^a \cd_a (S \, T) = \cd_a ( v^a S \, T) \,.
\end{align}
</div>
<p>When this is the case, we can turn the last term into a boundary
integral,</p>
<div>
\begin{align}
&\cd_a v^a = 0 \quad \Longrightarrow \nonumber\\
&\int_R S (\Lie_v T) \sqrt{|g|} d^nx =
\int_R (- \Lie_v S) T \sqrt{|g|} d^nx +
\int_{\pd R} S T v^a n_a \sqrt{|\gamma|} d^{n-1} x
\,,
\end{align}
</div>
<p>where <script type="math/tex">n_a</script> is the unit normal to the boundary <script type="math/tex">\pd R</script> and
<script type="math/tex">\sqrt{|\gamma|} d^{n-1}x</script> is the proper “area” element.</p>
<h2 id="special-case-killing-vector-field">Special case: Killing vector field</h2>
<p>A
<a href="https://en.wikipedia.org/wiki/Killing_vector_field">Killing vector field</a>
(KVF) is a special case of a divergence-free
vector field. If <script type="math/tex">v</script> is a KVF, it generates an isometry of the
metric,</p>
<div>
\begin{align}
\Lie_v g = 0 \quad \Longrightarrow \quad
\cd_{(a} v_{b)} = 0 \quad \Longrightarrow \quad
\cd_a v^a = 0 \,,
\end{align}
</div>
<p>where the last equality comes from taking the trace of the middle
equation. Thus we have the corollary that we can “integrate by parts”
the Lie derivative along any Killing vector field.</p>Leo C. Steinleostein@tapir.caltech.eduWhen can you integrate-by-parts with Lie derivatives?