# C. Gogolin

## HomeResearchCodingContact

### Open-source software

I have stated and am contributing to various open-source projects. I am presenting some below, a few more can be found on my Github profile.

In particular, I am on of the developers of PennyLane, a library for the optimization of variational quantum circuits and quantum machine learning with automatic differentiation and a contributer to the quantum computing simulators StrawberryFields and ProjectQ. I am the lead developer of Pen&PDF, Library, and O-3PO.

### Library: BibTeX on Android

Library is an Android app that I wrote in order to be able to conveniently browse my documents (mostly scientific publications) on my Android tablet.

Library allows you to browse your BibTeX files on your Android device.

Features include:

• Clear presentation of BibTeX entries in a list
• Search/Filter/Sort
• Open associated local files (including file path conversion)
• Open web links created from BibTeX information
• Material design
• Minimal permissions

Library is free and open source! You can get the source code from github:

git clone https://github.com/cgogolin/library.git

### Pen&PDF: PDF annotating on Android

Pen&PDF intents to makes editing PDFs as easy as writing on a piece of paper.

Pen&PDF is a PDF viewer and annotation app for Android built on top of MuPDF.

Features include:

• View/annotate/draw into any PDF document
• Create blank documents for notes and add blank pages to any document
• Search documents
• Material design

Pen&PDF is free and open source! You can get the source code from github:

git clone https://github.com/cgogolin/penandpdf.git

I have been using xmonad almost every single day since 2008 and it has been running without any major problems and without a single crash. xmonad has changed the way I think about user interfaces and it has significantly increased my productivity. xmonad is one of the greatest and most reliable pieces of software I have ever used and I would like to say thank you to the community! Keep up the good work!

In case anyone finds it useful here is my xmonad config:

### LaTeX Beamer themes

I consider LaTeX Beamer, in combination with TikZ, to be the by far best software to make the slides for my seminar talks. However, there is one big problem:

All talks done with LaTeX Beamer look almost identical.

If you want to bring a message across, you have to attract the audience's attention. Having slides that look exactly like the ones of the previous speaker is definitely counterproductive. Therefore, I decided to make my own set of themes for LaTeX Beamer — and share them with the community.

Instead of giving a longish explanation of the features of these themes I recommend downloading one of the real life presentations that can be found in the research section of this homepage. All talks from July 2008 on were made using this theme set.
Nevertheless, I want to emphasize that the inner theme "chamfered" adds some very nice and brand new features to the LaTeX Beamer class: It features boxes with customizable rounding radius, content-to-box and head-to-body distance, as well as an optional drop shadow effect compatible with all box shapes. In addition, a surrounding outline can be activated.

To install the themes put them in the same directory as your LaTeX Beamer source file, or copy them to an appropriate folders in the LaTeX load path:

[load path]/tex/latex/beamer/themes/[color|inner|outer]/

You can then use them as usually with something like

\useinnertheme[realshadow,corners=2pt,padding=2pt]{chamfered}

in your source file. There is some additional documentation in the .sty files.

Feedback is greatly appreciated!

The themes were last updated on 2011-07-15 (bug fix).

I was very happy to find out that people seem to be actually using these themes! See this post on the Malaysian LaTeX user group for example. I would like to thank all the people that have made me aware of bugs, compatibility problems and other shortcomings of my implementation. Thanks folks!

 beamercolorthemeshark.sty beamerinnerthemechamfered.sty beamerouterthemewuerzburg.sty

### Nice overlay effect in LaTeX Beamer

When doing slides for a talk you sometimes want to first give an overview of a certain idea and then explain some parts of it in more detail. One way of doing this is to uncover the information bitwise. Sometimes this might not be ideal for a couple of reasons. For example, you must be careful to leave enough space for the extra information, which can easily lead to an odd looking layout. Alternatively, and in particular if you have quite a lot of extra information, you could create an entirely new page covering the extra information and then come back to the overview page once you have finished explaining them. This approach also has certain downsides, the most important of which probably is that the audience might miss the fact that you are still talking about the same thing. Especially if you want to provide details concerning several different aspects of you main idea this can be very confusing.

So, what to do?

I think that a quite elegant way to deal with such a situation is the following: Put the details in a box that hovers above the overview slide. This way you can avoid ending up with a cluttered layout and still give the audience some visual guidance that will help them to intuitively understand that you have not switched subject but are rather giving some details. An example of how this can look like can be seen in the picture on the left or in the slides of my talk "Thermalization in nature and on a quantum computer".

And here is how you can implement this using TikZ and LaTeX Beamer:

\newcommand<>{\hover}[1]{\uncover#2{%
\begin{tikzpicture}[remember picture,overlay]%
\draw[fill,opacity=0.4] (current page.south west)
rectangle (current page.north east);
\node at (current page.center) {#1};
\end{tikzpicture}}
}

This command will cover the entire page with an opaque black rectangle and the draw what ever you give it as main argument in the middle of the page above this rectangle. The <> after the \newcommand makes it overlay specification aware. A standard use case would be the following:

\begin{frame}
\frametitle{A frame}
Some text
\hover<2>{
\begin{minipage}{0.8\linewidth}
\begin{block}{A block hovering above the slide}
I am visible on slide two.
\end{block}
\end{minipage}
}
\end{frame}

The effect works particularly well with the option [realshadow] of my inner theme beamerinnerthemechamfered.

There is however one problem with LaTeX Beamer themes that include a foot line. The foot line is drawn after the content of the frame. There is thus no (easy) way to have the opaque rectangle cover the foot line. The foot line of my outer theme beamerouterthemewuerzburg can be suppressed by giving the [nofootline] option.

### urxvt.tabbed keybindings

rxvt-unicode, also known as urxvt, is my preferred terminal emulator. It has a very useful Perl extension called urxvt.tabbed, which allows you to have multiple terminal sessions in one urxvt window. Unfortunately, the default key bindings of urxvt.tabbed are such that ctrl-left and ctrl-right exchange the current tab with the one left or right of the current one and I would better like to use ctrl-left and ctrl-right to move the cursor one word left or right as usual.
Fortunately, it is quite easy to change this behavior, although there is no option in the .Xdefaults file to do it. In the file "/usr/lib/urxvt/perl/tabbed" there is a subroutine called "tab_key_press". In this subroutine you find a line saying

if ($event->{state} & urxvt::ShiftMask) { change that to if ($event->{state} & urxvt::Mod1Mask) {

and a little bit further down there is a line saying

elsif ($event->{state} & urxvt::ControlMask) { change that to elsif ($event->{state} & urxvt::Mod1Mask && \$event->{state} & urxvt::ShiftMask) {

to use alt-left, alt-right, alt-down to move from one tab to another and create new tabs, and shift-alt-left and shift-alt-right to exchange tabs. Thereby you recover ctrl-left and ctrl-right for cursor movement.

### Keeping vpnc connections alive

The cisco vpn concentrator at the university of Würzburg tends to disconnect the vpn connection after irregular periods of time when connected through the university's wireless lan. Unfortunately vpnc does not provide a mechanism to automatically reestablish a lost connection.
So I decided to write a couple of scripts that automatically connect my notebook to the vpn server after a wlan connection to one of the access points at the campus is established and keeps the vpn connection alive until I disconnect from the wireless lan.
Just put the script "vpnc-keepalive" under "/etc/vpnc/" and the scripts "vpn-connect" and "vpn-disconnect" under "/etc/network/if-up.d" and "/etc/network/id-down.d" respectively. Then replace the string "RZUW" in "vpn-connect" by the ssid of your universities wireless lan and customize the call to vpnc in "vpnc-keepalive" to suit your needs.

 vpn-connect vpn-disconnect vpnc-keepalive

### Emacs customization

This is for all the Emacs users out there.

my .emacs file

### Xmgrace: Data and plotting options in one file

Grace also known as Xmgr is one of the standard plotting tools for scientific data. It is platform independent open source software.
One thing that always annoyed me was that fact that plotting a lot of different data sets with sightly different plotting options is a really time consuming task using the front end.
Most data that I plot using Grace are results of computer simulations. Of course the program that produces the data files "knows" what the right axes label are and could easily store that information, as well as a lot of other plotting options, together with the data in one file.
This is where my little helper script comes into place. It expects an output file name, additional Grace command line options and the paths to the data files to plot. Before invoking Grace it scans the data files for commented Grace plotting options, and directly produces a nice formatted postscript file.
Just save the file, make it executable and invoke it without parameters to learn more.

xmgrbatchplot