Random Thoughts

Unordered, unfiltered, raw dump of my current mental state

Tags: phd

It has been a while since I last wrote anything here and the reason is that I have been quite busy with my PhD, which I started in the mid of 2020. Here is a miscellanea of things.

1My superpower

I have been fighting with mathematics. A lot. More exactly convex optimization. This got me thinking about the movie Mystery Men. In this comedy there is a band of “superheroes” with dubious powers, like someone that can get invisible but only when nobody is looking or like the protagonist Mr. Furious (Ben Stiller). Mr. Furious is a parody of Hulk because he can get incredibly angry and when he gets angry... well, that's it, he gets very very angry.

Figure 1. Mr Furious

I'm like Mr. Furious: I can think very hard about mathematics, and when I think about a math problem... you can bet I think hard about it.

2The tools of the trade

I'm using TeXmacs to write my math notes and I'm happy. I find the the experience quite good because I don't want to fight with LaTeX to write some notes that 90% of the time do not make it to something publishable (as a matter of fact I have not published anything yet, the shame).

I'm using Emacs to write my code and also the publishable paper, which started as TeXmacs export, which I uploaded to Overleaf, which I use to share with collaborators but I edit the files locally using Emacs and sync Overleaf with git.

I use Inkscape to draw the figures. I'm getting damn good at drawing figures, or so I think. And I know why math books have so little figures: it's hard to draw good figures. I have yet to solve the typography problem: I can have the same fonts in my paper and in my drawings but there is a problem with scaling the figures: it scales the fonts. I don't want to talk more about it. It's more complex that just fixing the font size. I refuse to use TikZ because I want to finish my thesis some day.

This has got me thinking about writing math texts, which deserves a section. But first: I'm using Julia to write the code (I'm trying to develop a new algorithm) and I'm very happy. It deserves a section, which comes now.


Julia is a newcomer. It is not trying to just substitute Python. It's trying to substitute also Matlab. It's perfect for my use case because I want to measure performance in nanoseconds, or God forbid, microseconds. You can get the same or better performance using C or C++ (or Rust I assume). But I'm not building a game engine, or a game, or anything resembling a final product. I'm exploring while I build and I want to remain interactive and I can have my cake and eat too with Julia.

Julia is a high level interface for LLVM.

I use Emacs, I had problems making the LSP work with Julia mode and so I'm programming like a black ops, no assistance in the deep of the code. I need to try again. I tried VSCode which is the official IDE for Julia. I have no problem using alternatives to Emacs, I'm not an editor zealot. As a matter of fact I used in the past Vim and I practice polyediting and have an open relationship with my editor but I found this PR which for me signals two problems: one is technical and is the need to somehow merge this in the main repository instead of as a separate plugin and the other is philosophical: I believe in powertools.

The good news: the Julia REPL is good. You have the shell and the package manager at your fingertips too. If some Julia developer is reading this: I love you and I'm sending you good energy waves. Peace. There are lots of things to do yet but is amazing all the things that have already been done.

4Math writing

I'm trying to develop a new algorithm for a particular case of collision detection (a solved problem, I have been told, an opinion which I admit has some merit). It's hard. I can make two kind of mistakes: mathematical/conceptual mistakes and implementation mistakes. It's a blast trying to figure where is your mistake. My favorite mathematical mistake is thinking that because I cannot find a counterexample some mathematical truth holds. Specially because I cannot draw (in 2D, no less) a counterexample. Oh my god, I'm such a sucker. It's important therefore to be sure that your math is tight, and when I say math I mean algorithms too. I have noticed something very funny: I don't even care that anybody reads my proof. I need the proof for myself.

Since I'm simultaneously writing the math/algorithm and the code (the former a little earlier, but there is a lot of overlap) I have started to appreciate (I pressume) what D. E. Knuth was trying to accomplish with Literate Programming. Describing your algorithm is like the dual problem of writing the code and he was trying to close the gap.

Have you tried to write LaTeX? It's an experience. There is a reason people use it. I'm of the opinion that if you think the people doing their job are stupid maybe you are the stupid one. This may apply to politicians, people using C++ or people using LaTeX or Word or whatever.

Academia is in the business of publishing papers and \(\LaTeX\) (or similar) is the most powerful tool. It has a lot of quirks and its errors, oh! it's errors! they rival the beauty of C++ template errors! But if your job is publishing math you use the most powerful tool and learn to cope with the pain. And when you are done you take a walk in the country, go to a concert or read a book. This means we get stuck in a local maximum, and writing mathematics is niche enough that it's really hard to break the status quo. Someday, I promise to myself, I will help to start the revolution.

You know what is niche too? Computer Algebra Systems. Which gets to the next and final section.


There are several CAS open source alternatives to Mathematica: Axiom (FriCAS), Reduce, (Wx)Maxima, SymPy, SAGE... I have tried all in varying intensities. I'm by the way a supporter (the minimum amount by the way) of the FSF for several years. I have been using Linux since forever. I'm writing this in a Linux laptop and I'm the only Linux developer in a team of something like 20 engineers which own Macs. That being said:

I have purchased a Mathematica Student License.

Why? I want to get good at using a CAS and Mathematica feels like the best. It has installed flawlessly in (Fedora) Linux. That already blows my mind (yes, I'm being a little cynical, but Maple didn't work).

Using Mathematica has been very interesting. I still can barely do anything by the way but some things are already clear. The first one is that the notebook runs circles around Jupyter Notebooks. The main reason however is that I feel like there is more to Mathematica than it's shiny surface and I plan to absorb the Wolfram Language. Some things annoy me, like the “marketing writing” that is everywhere.

I don't mind paying for the SW (and to get paid by the way doing my job!) but it's sad to see such a product closed, it's community strangled. The Mathematica notebook, using Python, would already be a killer product. I don't presume what is the answer. Jetbrains has managed to make a business with their IDE offering community editions. I'm not sure if a niche product like Mathematica could afford it. It's funny, contradictory if you wish, but Mathematica has convinced me of the important of libre software. For now, I will learn.


I should keep writing my paper/thesis.