Software tools for Mathematicians

If you are using mathematics in your work or studies and you are interested in developing your own math-related software, then this article is for you. Typically, most people versed in the formal sciences can write some code. Nevertheless, the path fro…


This content originally appeared on Level Up Coding - Medium and was authored by Dimitri Papaioannou

If you are using mathematics in your work or studies and you are interested in developing your own math-related software, then this article is for you. Typically, most people versed in the formal sciences can write some code. Nevertheless, the path from writing some code to developing functional, sharable software solutions is not always straightforward. I am hoping this guide will help you on your journey.

The Operating System

Let’s start with the decision that is probably the least worth sweating about. Unless you are a micro-electronics aficionado, there are just three broad choices: Mac, Windows, or Linux. Linux of course comes in many different flavors and is considered an OS for advanced users, mainly because the vast number of choices is giving you enough rope to hang yourself in diverse ways.

My advice is to stick with what you know. It is unlikely that dedicated Mac users will enjoy working with Windows or Linux and vice versa. You will, sooner or later, need to use some Unix-like command language. This is only a problem if you are using Windows, but it turns out that are plenty of options:

Docker

Most mature software is ported in all popular operating systems. If you find that the tool you need has not been ported to your OS of choice, you still have some options:

  1. Look for a docker image that someone has already built that you can download and use.
  2. Try building it from the source code. You don’t necessarily need to know what you are doing since there are usually instructions to guide you. However, if the build fails for some reason you may hit a dead end.
  3. Find a cloud provider who supplies virtual instances where you can install and run the software. There will almost definitely be a small cost associated with this.

Docker is the least painful of these solutions, hence it is something worth adding to your toolbox. Docker is an open platform for developing, shipping, and running applications. Once you install docker, it is typically easy to find a pre-built application (called an image) and run it on your machine.

Here is an example of how to install and run elastic-search with just two commands:

docker pull docker.elastic.co/elasticsearch/elasticsearch:7.11.1
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.11.1

It should be noted that apps running on Docker will be slower than if they were running natively.

Programming Languages

Choosing a programming language largely depends on your personal preferences and objectives. Learning any language requires a significant commitment, because the difficulty does not lie in adapting to the syntax and idioms, but mastering the libraries and development ecosystem around the language. Luckily, there are only a handful of languages specifically geared towards scientific computing. If you are unsure which one to choose, here is the process I recommend:

  1. Decide what type of projects you want to work on.
  2. Look for related projects in the open-source domain, by searching GitHub, Kaggle, Stack Overflow, et cetera
  3. See which language most of the other people use for these projects.

This list of languages and their descriptions may also assist you:

  • Python is a vastly popular, general-purpose, programming language that comes with a truly astounding number of resources for scientific computing. Python is widely used for Data Science, Financial applications, Engineering, Physics, but also for many non-scientific applications. Its immense flexibility and wealth of resources make it a pretty difficult language to master, but the good news is that there is probably already a solution for every problem you encounter.
  • R markets itself as a language for statistical computing, but it has a large collection of libraries for any sort of scientific application. It is available in all major operating systems and there are only a couple of IDEs for it, the most popular being RStudio. Packages are very easy to install and mostly work without problems. Choose R if you are mainly interested in Data Science and/or Statistical applications and want to get results quickly.
  • Julia is the new kid on the block. It is designed specifically for modern scientific and distributing computing. It has a growing number of aficionados but as of now it is not nearly as popular as Python or R. Choose Julia if you like being on the bleeding edge, but expect resources to be scarce.
  • Matlab is a language designed for mathematical applications and comes with very intuitive syntax, a large number of packages, and beautiful graphics. It is widely popular in academia, where is it offered at a significant discount, but in the corporate world, it comes with hefty subscription fees. You will need to pay more for additional packages, and even more for deploying on a server. There is an open-source alternative called Octave. I’ve used it for some toy projects and seems to work fine but I don’t get the sense that it is widely popular.
  • Mathematica is another high-quality product designed for mathematical applications, including symbolic computations, and it also requires a paid subscription.

Development Process Resources

No matter which language you choose, the same invariants are going to be true about the development process:

  • You want to make sure the code you build works
  • You want the code to continue working every time you make changes
  • Optionally, you may want other people to understand your code and collaborate with you

The key to achieving these objectives is Source Control. Source control is a repository where you can not only store your code but also keeps track of the entire history of changes. This tool is essential for collaborating on a software project. It is also very useful to the lone programmer in case you break something and you need to refer to the last working version to figure out what went wrong.

The most popular source control tool is Git, so you don’t need to explore any other options unless you have specific reasons. Git comes in two parts: The part that you install on your computer and the part that actually stores your code which is an online repository. Luckily, there are repositories that will let you host your code for free:

  • GitHub is the most popular repository for hosting open source projects. You get unlimited public repositories and a free private one. You can get more private repositories and other services if you have a paid subscription.
  • If you are more secretive and want to keep your projects private, then GitLab offers unlimited free private repositories.

These hosting services offer a lot more than pure source control. One of their most important offerings is Continuous Integration. To understand the vast benefits of this concept, consider what you need to do to guarantee that your code runs correctly every time.

  1. For each software module that you develop, write one or more tests to validate it works as expected. The test should be such that every time you run it, you get the same results.
  2. Since software modules do not exist in isolation but usually interact with each other, you also need to ensure that all other modules continue to run correctly. This can be accomplished by rerunning all the tests that you have (hopefully) written for the other modules.
  3. If anything fails, get a description of the problem, so you can fix it and repeat the process.

GitHub and GitLab offer mechanisms that will automatically compile your code and run the tests once you commit new changes. If this action fails, you will be notified. This process guarantees that only working code ends up in the repository. This article contains an overview of how this works with GitHub. Although the specific article references Java, the same mechanism is available for a variety of languages.

Other Resources

I am closing by listing some additional resources that can be very useful to the practicing Software Scientist:

  • Kaggle started out as a machine learning competition platform and now it has evolved into a Data Science community where one can obtain data sets, examine other people’s solutions, read articles, tutorials, et cetera.
  • Wolfram Alpha is an online ultra-calculator that can be used to evaluate complex mathematical expressions, including analytical solutions to integrals, power series, differential equations, et cetera.
  • Jupiter Notebooks provide a great way to demonstrate and share your ideas. A notebook combines code with storytelling and graphs making it a highly readable resource. They used to be only for Python but they have been extended to other languages including R and Julia.
  • Latex is a high-quality typesetting system designed for the production of scientific documentation. It contains pretty much any math symbol you can imagine.

Software tools for Mathematicians was originally published in Level Up Coding on Medium, where people are continuing the conversation by highlighting and responding to this story.


This content originally appeared on Level Up Coding - Medium and was authored by Dimitri Papaioannou


Print Share Comment Cite Upload Translate Updates
APA

Dimitri Papaioannou | Sciencx (2021-02-25T01:21:54+00:00) Software tools for Mathematicians. Retrieved from https://www.scien.cx/2021/02/25/software-tools-for-mathematicians/

MLA
" » Software tools for Mathematicians." Dimitri Papaioannou | Sciencx - Thursday February 25, 2021, https://www.scien.cx/2021/02/25/software-tools-for-mathematicians/
HARVARD
Dimitri Papaioannou | Sciencx Thursday February 25, 2021 » Software tools for Mathematicians., viewed ,<https://www.scien.cx/2021/02/25/software-tools-for-mathematicians/>
VANCOUVER
Dimitri Papaioannou | Sciencx - » Software tools for Mathematicians. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/02/25/software-tools-for-mathematicians/
CHICAGO
" » Software tools for Mathematicians." Dimitri Papaioannou | Sciencx - Accessed . https://www.scien.cx/2021/02/25/software-tools-for-mathematicians/
IEEE
" » Software tools for Mathematicians." Dimitri Papaioannou | Sciencx [Online]. Available: https://www.scien.cx/2021/02/25/software-tools-for-mathematicians/. [Accessed: ]
rf:citation
» Software tools for Mathematicians | Dimitri Papaioannou | Sciencx | https://www.scien.cx/2021/02/25/software-tools-for-mathematicians/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.