Published in Advanced Optical Technologies—A double feature

Two of my papers were published in Advanced Optical Technologies, recently, as part of a topical issue on applied quantum technologies.

The first paper deals with encoding the polarization of light signals for quantum key distribution (QKD). In principle, light is very good at maintaining its polarization, but in practice things like thermal effects in optical fibers and physical orientations causes polarizations to get rotated in sometimes unpredictable ways. There are various techniques to control and correct for these effects. This paper proposes an approach based on sampling the QKD signals themselves, and analyzes the performance in terms of how much light needs to be sampled. It turns out you can do very well to preserve the polarization with a relatively few signals.

The second paper looks at whether ‘adaptive optics’ techniques can be used to help transmit QKD signals from ground to an orbiting satellite. Adaptive optics uses fast sensors and deformable elements (e.g., mirrors, phase plates) to correct turbulence-induced variations, enhancing pointing precision and, thus, the total signal collected at the receiver. It turns out to be tricky to use this effectively when they satellite is in low-Earth orbit due its fast motion over the ground station [...]

Read this post

Introducing UWU, the Uncomplicated Web Uploader

On occasion it's been useful to transfer files to/from colleagues at different organizations. But when they want to send me something, doing so securely (i.e., not via email) can be a bit of a chore. I've found solutions tend to require too much technical setup for the sender (e.g., key-based SFTP), need too much on-going management at the server (e.g., user-based SFTP), or are part of a much heavier integrated solution (e.g., a fully-fledged personal cloud suite). I just wanted a minimal CGI script that I can run on something as basic as my Raspberry PI. So I made UWU.

UWU, the Uncomplicated Web Uploader, is a simple portal for uploading files to a server through a web browser. It's loosely inspired by woof, and while that tool does have an upload mode, it can't be set up to run on an HTTPS-secured server. UWU can. In addition, a standalone server for private/trusted networks can be run, without any prerequisites other than Python 3.

UWU provides separate “spaces” which a user can upload to, each with enforced file size and count quotas. By design, UWU does not support viewing the existing contents of spaces [...]

Read this post

Preserving merge trees when using git-svn

If you're like me, you might be using git-svn to connect to centralized SVN repositories (e.g., at the workplace) while keeping many of the powerful features of git. Sometimes you might be working in a local feature branch that is linked to a remote branch, and do a git svn rebase to grab updates from the SVN server. This command only fetches from the corresponding server branch. But, if an SVN merge, say from trunk, had happened on that branch at the server, then git-svn needs the corresponding local master branch to be up-to-date to notice that it was the parent of that merge. If you hadn't fetched from master recently, you lose the merge tree. Oops.

Before the rebase it would've been better to use git svn fetch --all (or it ought to have been, assuming git-svn fetches revisions in order once for all branches). But you might forget to do that. If that's where you find yourself, it is possible to recover. In the feature branch, use git svn reset -r{REV} -p, replacing {REV} with the revision number of the SVN merge which git-svn failed to assign a parent. Then do git svn fetch --all before [...]

Read this post

Upcasting through covariant interfaces in a constrained generic C# method

Here's a subtle one. Assume you have the appropriate “using System.Collections.Generic;” clause included somewhere up above. Can you spot what's wrong with this code?

interface ITestInterface
{
}

class TestClass<T>
    where T : ITestInterface
{
    public void TestMethod()
    {
        IReadOnlyList<T> x = null;
        IReadOnlyList<ITestInterface> y = x;
    }
}

Seems reasonable, right? An IReadOnlyList is covariant in its stored type, so given that T is constrained to be an ITestInterface, assigning such a list of T to a list of ITestInterface should be fine. And yet, compiling this code will fail at “y = x”, being unable to implicitly convert the types.

After some hair-pulling, I eventually worked out that the solution is to add “class” to the constraints on T. It would seem that, otherwise, the compiler will assume that the generic type T will not have any kind of inheritance for which covariance will be relevant. So it doesn't consider that, and the cast fails.

Read this post

Prevent .xsession-errors growing forever on Debian

The default configuration of the X server in Debian keeps a log of all the console output of the programs a user runs from their X session. It also keeps this log indefinitely. This is quite clearly a design mistake, because even ignoring badly behaved programs (those which are needlessly noisy are indisputably buggy), enough legitimate errors will eventually eat your disk. Plus the unjustifiable assumption that all programs out in the wild will be well-behaved, which is a nice hope but contrary to reality.

Sadly, this behaviour is also an ancient bug that has been, it would seem, forgotten about.

Anyway, here's a relatively simple method to fix that. As root, edit /etc/X11/Xsession. Just below the ERRFILE=$HOME/.xsession-errors line, add this:

ERRFILEOLD="$ERRFILE".old

if [ -f "$ERRFILE" ]; then
set +e
mv -f "$ERRFILE" "$ERRFILEOLD" 2> /dev/null
set -e
fi

Each time the user logs in, the old .xsession-errors log file will be moved to .xsession-errors.old (overwriting anything already with that name), and a new one created. Thus it ensures that the file doesn't grow indefinitely, so long as the user logs out and back in at some point.

Read this post

Published in Optics Express: Genuine time-bin-encoded quantum key distribution over a turbulent depolarizing free-space channel

Light can be used to encode information in a variety of ways. Polarization, for example: a ‘0’ bit could be represented by a pulse of horizontally polarized light, and a ‘1’ bit could be vertically polarized. This generally works well for transmissions over free-space. Also, by allowing superposition states and reducing the intensity to single-photon levels, one can start to access interesting quantum protocols such as quantum key distribution (QKD). You can do this with other encodings, too—“time bin”, for example, where you encode information in the arrival time, early or late, relative to a reference. But because of the way the superposition state (that is, the early “and” late state) is measured, it doesn't generally work well over air because of turbulence.

A recently discovered enhancement of the measurement device by my colleagues intrinsically bypasses the turbulence problem, and in this paper, we couple this improved apparatus with a QKD system to demonstrate a real quantum protocol with time-bin encoded light transmitted over long-distance (1.2 km) free space. The approach we take here could in future be used as a bridge between optic fiber (where turbulence isn't an issue) and free-space for quantum protocols.

J. Jin, J [...]

Read this post


← Previous | Page 2 of 9 | Next →