Setting up a Wacom Intuos CTL-4100 drawing tablet on Ubuntu 20.04 LTS

For much of the pandemic, when it has come time to write things by hand, I could write on my (old, inexpensive) tablet, or write on paper and point a camera. But more recently I’ve begun to use collaborative whiteboards, and my tablet simply cannot handle it. To be fair, it’s several years old, I got it on sale, and it was even then quite inexpensive. But it’s just not up to the task.

So I bought a Wacom drawing tablet to plug into my computer. Specifically, I bought a Wacom Intuos CTL-4100 (about 70 dollars) and have gotten it working on my multiple monitor Ubuntu 20.04 LTS setup.

For many, that would be the end of the story — as these work very well and are just plug-and-play. Or at least, that’s the story on supported systems. I use linux as my daily driver, and on my main machine I use Ubuntu. This is explicitly unsupported by Wacom, but there has long been community support and community drivers.

I note here the various things that I’ve done to make this tablet work out well.

My ubuntu distribution (20.04 LTS) already had drivers installed, so I could just plug it in and “use” the drawing tablet. But there were problems.

Firstly, it turns out that when Wacom Intuos CTL-4100 is first plugged in, the status light on the Wacom dims and indicates that it’s miscalibrated. This is immediately noticeable, as the left third of the tablet corresponds to the whole writing area on the screen (which also happens to be incorrect at first — this is the second point handled below).

This is caused by the tablet mis-identifying my operating system as Android, and the dimmed light is one way the tablet indicates it’s in Android mode. (I’ll note that this is also indicated with a different vendor ID in lsusb, where it’s reported as 0x2D1F instead of 0x056A. This doesn’t actually matter, but it did help me track down the problem).

Thus after plugging in my tablet, it is necessary to restart the tablet in “PC Mode”. This is done by holding the two outer keys on the tablet for a few seconds until the light turns off and on again. After it turns on, it should be at full brightness.

Secondly, I also have multiple screens set up. Although it looks fine, in practice what actually happens is that I have a single “screen” of a certain dimension and the X window system partitions the screen across my monitors. But the Wacom tablet initially was mapped to the whole “screen”, and thus the left side of the tablet was at the far left of my left monitor, and 7 inches or so to the right on the tablet corresponded to the far right of my right monitor. All of my writing had the wrong aspect ratio and this was totally unwieldy.

But this is fixable. After plugging in the tablet and having it in PC Mode (described above), it is possible to map its output to a region of the “screen”. This is easiest done through xrandr and xsetwacom.

First, I used xrandr --listactivemonitors to get the name of my monitors. I see that my right monitor is labelled DP-2. I’ve decided that my monitor labelled DP-2 will be the monitor in which I use this tablet — the area on the tablet will correspond to the area mapped to my right monitor.

Now I will map the STYLUS to this monitor. First I need to find the id of the stylus. To do this, I use xsetwacom --list devices, whose output for me was

Wacom Intuos S Pad pad id: 21 type: PAD
Wacom Intuos S Pen stylus id: 22 type: STYLUS
Wacom Intuos S Pen eraser id: 23 type: ERASER
Wacom Intuos S Pen cursor id: 24 type: CURSOR

I want to map the stylus. (I don’t currently know the effect of mapping anythign else, and that hasn’t been necessary, but I suppose this is a thing to keep in mind). Thus I note the id 22.

Then I run xsetwacom --set "21" MapToOutput DP-2, and all works excellently.

I’m sure that I’ll encounter more problems at some point in the future. When I do, I’ll update these notes accordingly.

Posted in Tech | Tagged , | Leave a comment

Slides from a talk at AIM

I’m currently at an AIM workshop on Arithmetic Statistics, Discrete Restriction, and Fourier Analysis. This morning (AIM time)/afternoon (USEast time), I’ll be giving a talk on Lattice points and sums of Fourier Coefficients of modular forms.

The theme of this talk is embodied in the statement that several lattice counting problems like the Gauss circle problem are essentially the same as very modular-form-heavy problems, sometimes very closely similar and sometimes appearing slightly different.

In this talk, I describe several recent adventures, successes and travails, in my studies of problems related to the Gauss circle problem and the task of producing better bounds for the sum of the first several coefficients of holomorphic cuspforms.

Here are the slides for my talk.

I’ll note that various parts of this talk have appeared in several previous talks of mine, but since it’s the pandemic era this is the first time much of this has appeared in slides.

Posted in Expository, Math.NT, Mathematics | Leave a comment

Slides from a talk on computing Maass forms

Yesterday, I gave a talk on various aspects of computing Maass cuspforms at Rutgers.

Here are the slides for my talk.

Unlike most other talks that I’ve given, this doesn’t center on past results that I’ve proved. Instead, this is a description of an ongoing project to figure out how to rigorously compute many Maass forms, implement this efficiently in code, and add this data to the LMFDB.

Posted in LMFDB, Math.NT, Mathematics | Tagged , , | Leave a comment

Long live opalstack!

I finished migrating my webserver from webfaction to opalstack. For those wondering if this is a good idea, I would recommend it. It was fairly painless.

Having said that, I did lose a little data: exactly the one post that warned that I was moving! I don’t know how this happened, but after checking this is the only thing lost in the transfer.

But in total, migrating and setting up the various websites (static, php, wordpress, flask) was straightforward, although nontrivial. Migrating email and ensuring that I had no email downtime was more important to me, and more annoying.

In total, the accounts I manage had on the order of 10k email messages, which is not very many in the big picture. Creating new matching mailboxes and mailusers was very easy, but somehow the transferring of the messages was a surprisingly time-consuming endeavor.

I also learned that complete DNS propagation for my email took about 41 hours. Well actually, google/gmail took 41 hours, and every other email service detected the change within 23 hours. I suppose this has something to do with the vast multitude of caching that google/gmail must do. But it was very easy (though slightly annoying) to manually sync email for the whole time. (Actually, I’d expected it to take up to 72 hours, so this wasn’t so bad).

Long live the opalstack.

(As the one post where I warn about migration disappeared, I’ll note that I moved because godaddy bought webfaction and have been changing the service/running it into the ground. I liked webfaction before they were bought, and I’ve used them for almost 10 years. Hopefully opalstack will stay stable for many years to come.)

Posted in Uncategorized | Tagged | Leave a comment

Talk on computing Maass forms

In a remarkable coincidence, I’m giving two talks on Maass forms today (after not giving any talks for 3 months). One of these was a chalk talk (or rather camera on pen on paper talk). My other talk can be found at https://davidlowryduda.com/static/Talks/ComputingMaass20/.

In this talk, I briefly describe how one goes about computing Maass forms for congruence subgroups of $\mathrm{SL}(2)$. This is a short and pointed exposition of ideas mostly found in papers of Hejhal and Fredrik Strömberg’s PhD thesis. More precise references are included at the end of the talk.

This amounts to a description of the idea of Hejhal’s algorithm on a congruence subgroup.

Side notes on revealjs

I decided to experiment a bit with this talk. This is not a TeX-Beamer talk (as is most common for math) — instead it’s a revealjs talk. I haven’t written a revealjs talk before, but it was surprisingly easy.

It took me more time than writing a beamer talk, most likely because I don’t have a good workflow with reveal and there were several times when I wanted to use nontrivial javascript capabilities. In particular, I wanted to have a few elements transition from one slide to the next (using the automatic transition capabilities).

At first, I had thought I would write in an intermediate markup format and then translate this into revealjs, but I quickly decided against that plan. The composition stage was a bit more annoying.

But I think the result is more appealing than a beamer talk, and it’s sufficiently interesting that I’ll revisit it later.

Posted in Expository, Math.NT, Mathematics | Tagged , , | Leave a comment

The current cover art for the Proceedings of the Royal Society

The current issue of the Proceedings of the Royal Society A1 features cover artwork made by Vikas Krishnamurthy, Miles Wheeler, Darren Crowdy, Adrian Constantin, and me.

Cover of Proceedings of the Royal Society AA version of the cover pre-addition is the following.

This is based on the work in A transformation between stationary point vortex equilibria, which concerns solutions to Euler’s equation for inviscid (2D) fluid motion $$ \frac{\partial \mathbf{V}}{\partial t} + (\mathbf{V} \cdot \nabla) \mathbf{V} = – \frac{\nabla p}{p_0}, $$ where $\nabla = (\partial/\partial x, \partial / \partial y)$ is the 2D gradient operator. There is a notion of vortices for these systems, and the paper examines configurations of point vortices under certain idealized conditions that leads to particularly nice analysis. In the situation studied, one can sometimes begin with one configurations of point vortices and perform a transformation that yields another, bigger and more complicated configuration.

This is the situation depicted on the cover — begin with a simple configuration and iterate the process. The spiral shape was added afterwards and doesn’t describe underlying mathematical phenomena. The different colors of each vortex shows whether that vortex is a sink or a source, essentially.

I was told most of this after the fact by Miles — who researches fluid dynamics, is a friend from grad school, and was my coauthor on a paper about the mean value theorem. I do not typically think about fluid dynamics (and did not write the paper), and it’s a bit funny how I got involved in the production of this cover. But it was fun, and we produced many arresting images. In the future Miles and I intend to revisit these images and better describe how the various aspects of the image describes and reflects the underlying mathematical behavior.

As a fun aside — we didn’t only produce one image. We made many, and we made many configurations.2 In my work on visualizing modular forms, I developed a few techniques for color selection from matplotlib style colormaps, and produced several variants. I’ve collected a few of these below.

Posted in Art, Expository, Math.CA, Mathematics | Leave a comment

phase_mag_plot: a sage package for plotting complex functions

Inspired by conversations with Elias Wegert and Frank Farris at the Illustrating Mathematics semester program at ICERM last year, I wrote several plotting libraries for complex plotting. I wrote them with the intention of plotting modular forms in a variety of ways, leading to my talk at Bowdoin in November 2019 and my first post on the CS arxiv.1

I’ve gotten several requests to make these plotting libraries available, and so I’ve made davidlowryduda/phase_mag_plot available on github as a sage library. See the github page and README for examples and up-to-date information.

This version is capable of producing contour-type plots of complex functions.

A plot of x^2(x-3)(x-3i) with magnitude-type contoursA plot of x^2(x-3)(x-3i) with tile-type contours

This does not include any colormap capability yet, as that is a substantially more involved2 process. But at some point in the future, I intend to look at revisiting the complex plotting within sage itself, perhaps updating it to allow plots of this nature.

Posted in Mathematics, Programming, sage, sagemath, sagemath | 2 Comments

Notes from a talk at Dartmouth on the Fibonacci zeta function

I recently gave a talk “at Dartmouth”1. The focus of the talk was the (odd-indexed) Fibonacci zeta function:
$$ \sum_{n \geq 1} \frac{1}{F(2n-1)^s},$$
where $F(n)$ is the nth Fibonacci number. The theme is that the Fibonacci zeta function can be recognized as coming from an inner product of automorphic forms, and the continuation of the zeta function can be understood in terms of the spectral expansion of the associated automorphic forms.

This is a talk from ongoing research. I do not yet understand “what’s really going on”. But within the talk I describe a few different generalizations; firstly, there is a generalization to other zeta functions that can be viewed as traces of units on quadratic number fields, and secondly there is a generalization to quadratic forms recognizing solutions to Pell’s equation.

I intend to describe additional ideas from this talk in the coming months, as I figure out how pieces fit together. But for now, here are the slides.

Posted in Expository, Math.NT, Mathematics | Tagged , , , , | Leave a comment

Pictures of equidistribution – the line

In my previous note, we considered equidistribution of rational points on the circle $X^2 + Y^2 = 2$. This is but one of a large family of equidistribution results that I’m not particularly familiar with.

This note is the first in a series of notes dedicated to exploring this type of equidistribution visually. In this note, we will investigate a simpler case — rational points on the line.

Continue reading

Posted in Expository, Math.AG, Math.NT, Mathematics | Tagged , , , , | Leave a comment

Points on X^2 + Y^2 = 2 equidistribute with respect to height

When you order rational points on the circle $X^2 + Y^2 = 2$ by height, these points equidistribute.

Stated differently, suppose that $I$ is an arc on the circle $X^2 + Y^2 = 2$. Then asymptotically, the number of rational points on the arc $I$ with height bounded by a number $H$ is equal to what you would expect if $\lvert I\rvert /2\sqrt{2}\pi$ of all points with height up to $H$ were on this arc. Here, $\lvert I\rvert /2\sqrt{2}\pi$ the ratio of the arclength of the arc $I$ with the total circumference of the circle.

This only makes sense if we define the height of a rational point on the circle. Given a point $(a/c, b/c)$ (written in least terms) on the circle, we define the height of this point to be $c$.

In forthcoming work with my frequent collaborators Chan Ieong Kuan, Thomas Hulse, and Alexander Walker, we count three term arithmetic progressions of squares. If $C^2 – B^2 = B^2 – A^2$, then clearly $A^2 + C^2 = 2B^2$, and thus a 3AP of squares corresponds to a rational point on the circle $X^2 + Y^2 = 2$. We compare one of our results to what you would expect from equidistribution. From general principles, we expected such equidistribution to be true. But I wasn’t sure how to prove it.

With helpful assistance from Noam Elkies, Emmanuel Peyre, and John Voight (who each immediately knew how to prove this), I learned how to prove this fact.

The rest of this note contains this proof.

Continue reading

Posted in Expository, Math.NT, Mathematics, sage, sagemath | Tagged , | 1 Comment