How to reduce the number of authors in your Zotero library

Are you a scientist with a bunch of Zotero entries that have 1000+ authors (*cough* the LIGO Scientific Collaboration *cough*)? Is your bibtex file huge, and does the Sync with Zotero option break whenever you try to load a bibtext file into Overleaf (with an unhelpful error message)? Then you should update your library to reduce the number of authors with each entry!

WARNING: For the love of god, save a copy of your Zotero library before you do this! I have obviously not tested this rigorously and am neither an expert in Python or the databases that Zotero uses. I did this by renaming my local Zotero library (in your home directory in Mac) to something like “zotero_backup”. This was also necessary since you’ll need to rebuild your local library from the remote one at the end.

While there are presumably a bunch of different ways to do, I went with the Pyzotero package. It provides a direct (and very easy) API to your online Zotero. You can install it with either pip or conda:

pip install pyzotero


conda config --add channels conda-forge && conda install pyzotero

You can then, from python, directly access your online Zotero library. To do that, you’ll need your Zotero username and an API key (following the instructions here). Once you’ve set that up, you can connect to your Zotero library and import all the entries with:

from pyzotero import zotero
zot = zotero.Zotero(<your library ID>,'user',<your API key>)
items = zot.everything(zot.items())

Note this may take a minute or two, depending on how large your library is. Once that’s done, you can just iterate through the items in the library (it produces a list of python dictionaries), and delete however many authors you want from the end of each entry. Here, I decided to delete every author past the first 50:

for i, item in enumerate(items):
    if 'creators' in item['data'].keys():
        num = len(item['data']['creators'])
        if num > 50:
            for j in reversed(range(50,num)):
                del items[i]['data']['creators'][j]

(yes I’m sure there’s a cleaner way to do this; I wanted to get back to writing quickly). Once that’s done, you just need to update your entries in the remote repository:

for idx,item in enumerate(items):
        print("Failed at item "+str(idx))

I found that the only entries that failed where my own papers (probably something to do with the “My Publications” option). Once that is done remotely, you can open Zotero again locally, download your new (reduced author list) Zotero library back from the server, and you should be good to go!

ADDENDUM: if you want to use the same LaTex citation keys between the desktop and online versions (which is really the whole point), you’ll need to add the citation keys to the “Extra” part of the Zotero database. This can be done by just selecting all the entries in your library, right clicking, and clicking Better BibTex -> Pin BibTex Key. Check out this answer on Stack Overflow. Once that’s done, you can sync your local library (sync button in the upper right hand corner) and you should be good to go!

Post-Newtonian Stellar Dynamics

Since I published my paper on spin orientations last year (Rodriguez et al., 2016 or my last post), I think I’ve managed to convince some people that the positive (or negative) values for the effective spins of merging black hole binaries could be a good way to discriminate whether the system was formed from stellar binaries in a galactic field or through dynamical processes in a dense star cluster.  There have been a couple of papers looking at the statistics of these events, and how many detections we might need before we can start to say where LIGO’s binary black holes are coming from.  These papers have also tried to pin down whether the spin distribution of the events LIGO/Virgo has already detected show evidence of spin alignment (indicating formation from a binary) or of a random spin distribution (indicating dynamical formation).  Of course, since most of the effective spins are also consistent with black holes having no spins, it’s been somewhat hard to make any definitive claims (e.g. Farr et al., 2016, which shows a weak preference for an isotropic distribution, versus the other Farr el al., 2016 which, using a slightly different methodology, shows a weak preference for a spin-aligned distribution).

The problem is that none of LIGO/Virgo’s binary black holes have shown evidence for significant black hole spin.  Only one of the systems, GW1512126, has had spins whose magnitudes could be easily measured.  Every other system, even the possibly-anti-aligned system GW170104, could have just as easily been non-spinning.  It’s pretty hard to measure the direction of a vector when its magnitude is almost 0.  For people who study isolated binary evolution, this provides a natural explanation for systems like GW170104: its entirely possible that heavy binary black holes simply aren’t born with significant spins.  If that were true, then most of LIGO/Virgo’s events could be explained through either channel.

But!  There’s a weird caveat here.  For a little while now, I’ve been studying the effects of post-Newtonian dynamics on the evolution of black hole binaries in the dynamical formation channel.  In other words, what happens when you have an encounter between three black holes, and you carefully keep track of all the relativistic effects (e.g. pericenter precession and gravitation-wave emission).  Turns out, if you look at this carefully, you can go from a vanilla dynamical scattering:

to something significantly crazier:

What the hell just happened there?  It turns out, during these crazy resonant encounters between black holes (which are all too common in dense star clusters), you can get two black holes so close together that they’ll form a highly-eccentric binary black hole which merges during the encounter.

When that happens, the two black holes form a new massive black hole (in red above), that immediately gets a kick to its velocity from the emission of gravitational waves.  Now for black holes that are maximally spinning (chi ~ 1), these merger kicks can be as high as 4000 km/s.  On the other hand, if the spins are small, the kicks can be as low as a few 10s of km/s.

Because people always assumed that black holes get large spins when they’re born, it was reasonable to believe that these merger black holes would get kicked out of the cluster pretty quickly.  After all, the speed needed to escape from a typical globular cluster is a few 10s of km/s.  But if the recent claim from the population synthesizers is true, that heavy black holes actually get no spins, then we could actually start to think about building up multiple generations of black holes in globular clusters!

My most recent paper, written with some new and some old collaborators, is the first in a series looking at exactly that.  It turns out that, when you correctly treat the post-Newtonian dynamics in a dense star cluster, you can get a ton of mergers occurring in the cluster.  If the spins from the first generation of black holes is low, then those merger products can even be retained in the cluster, and since the cluster will always form binaries out of the most massive black holes available, you can form binaries from the second generation of black holes:



Screen Shot 2018-01-02 at 11.46.44 AM.png

The masses of binary black holes from globular clusters which merge in the local universe (Rodriguez et al., 2017).  When the first generation of black holes merge in the cluster (the orange), the new black holes they form can stick around and form more binaries, producing a second generation of binary black holes (in black). These second-generation black holes can be more massive than what we think you can get from the collapse of a single star.

These second generation black holes will all have large spins (anytime you merge two black holes, they form a new black hole with a spin around 0.7), and they’ll be more massive than any of the other black holes in the cluster.  This last point is critical.  We think there’s an upper limit on the masses of black holes you can get from a single star.  Anything above that mass (around 40-50 solar masses), and the star completely explodes without leaving behind a black hole or anything else.  If that’s true, then you would only expect first generation black holes binaries to have masses of at most 40M+40M.  But if you’ve got second generation black holes, they could be twice as massive, forming systems with masses of 80M+40M.  Since those could only have formed through repeated mergers, I made the claim that if LIGO/Virgo detects something in the mass gap, then it almost certainly came from a cluster.  It was nice to finally have this in a paper, though I have been saying this for a little while:IMG_2083.jpg

Looking at the histogram, these events should be pretty rare (and they depend critically on how fast the first generation of black holes was spinning at birth).  But I still have hope!  In LIGO/Virgo’s next observing run (O3), they’re projected to be sensitive to 80M+40M black hole mergers out to a redshift of 1 (nearly 8 billion years ago)!  This provides us with a pretty clear way of identifying the contribution of dynamics to merging binary black holes.  Either black holes are born with large spins, and eventually we’ll see something with anti-aligned spins, or they’re born with small spins, and eventually we’ll see something so massive it could only have formed in a secondary merger.  Either way, after a sufficient number of detection, we’ll have a pretty clear idea of how significant the dynamical channel really is.  Just how many is “a sufficient number” is what I’m working on now.

Black Hole Spins

It’s been an interesting few years since the first detection of gravitational waves.  We’ve gone from a single, initial binary black hole mergers (GW150914), to 6 detentions (5 binary black holes and 1 binary neutron star merger).  As you an imagine, this has been pretty damned exciting.

But we still haven’t settled exactly where these systems are coming from.  The two main channels for forming compact binaries–isolated evolution from stellar binaries (aka the field) and dynamical formation in dense star clusters–can seem to produce all of the events we’ve seen so far.  Despite our best efforts, we can’t seem to find a system that clearly shows the history of where it came from.

I started looking at this problem at the beginning of my fellowship at MIT.  Since it’s going to be a few years before we have catalogues of compact-object mergers, the easiest thing to do for now will be to look for systems that could only have come from one channel or the other.  The easiest idea, which people have had for years, is that the orientation of the black hole spins might be a good way to discriminate the two channels:

Screen Shot 2018-01-02 at 10.20.00 AM

If you assume that black holes forming from isolated binaries should start off spinning in the same direction as their orbit (i.e. S and L parallel, in the image above), then you would expect most binaries from the field to have spins aligned with their orbit.  On the other hand, since dynamically-formed binaries would have their spins aligned at random, you wouldn’t expect to see too many merging black hole binaries with S and L parallel.  Instead, you would expect the spins to precess about the the total angular momentum (J, above) of the system.  This precession actually causes amplitude modulations in the gravitational waves detectable by LIGO, as the binary points towards and away from Earth:

What’s really interesting is that, because most black holes from stellar binaries probably start off with their spins aligned, it should be (nearly) impossible for the spins to become anti-aligned with their orbit.  This is important because what LIGO measures best isn’t the orientation of the spins in 3D space, it’s the projection of those spins onto the orbital angular momentum, aka the effective spin, or chi effective  (the green arrow in the above diagram).

This was the claim I made: that if LIGO manages to detect a binary whose spins are anti-aligned with its orbit, then that binary was probably formed in a cluster.  This won’t be true for every binary black hole formed in a cluster, of course.  But since the spins are essentially isotropic in the dynamical formation scenario, then basic statistics tells us that roughly half of cluster systems should have their spins anti-aligned with the orbit.

I published the above paper in mid-November 2016.  A few months later, LIGO detected it’s second heavy black hole binary, GW170104.  Amazingly, it seemed to have evidence of having its spins anti-aligned with the orbit!

Screen Shot 2018-01-02 at 10.35.15 AM.png

GW170104, from Abbott et al., 2017

Now this doesn’t definitively show that this system came from a cluster.  Looking at the posterior on chi effective above, it’s also entirely possible that the black holes had no spins at all.  But the balance of probability (82%)  is that the spins alignments were negative, suggestive of dynamical formation.  Now nobody would claim that 82% is definitive of anything, but it certainly is suggestive.  That, coupled with the fact that the masses of GW170104 happen to lie right at the median for detectable binary black holes from globular clusters

Screen Shot 2018-01-02 at 10.48.19 AM.png

An updated version of the plot from Rodriguez et al., 2016, including GW170104

at least hints to me that we’re on the right track (I even got interviewed by Science, where I basically said the same thing).  I think we’ll need to few more detections before we can say anything definitive, but fortunately LIGO’s next observing run, O3, is less than a year away.