Useful Packages

The number of registered packages in the General registry is quite vast (about 2800 on 11/12/2018) and growing every day. So if you have a reasonably standard problem you want to solve, there is a good chance that someone has already made an effort.

To give you some ideas about the community and what is available, here is a non-exhaustive list, which is naturally influenced by my own background. I'm happy to adapt it, if you feel something is wrong / missing.

Without further ado:

Development and coding workflow

  • Revise is one of the absolute must-have packages. It watches your filesystem for changes to a Julia package or script and reloads it automatically in the current REPL / Jupyter kernel. If you are the developer of a Julia package or usually find yourself coding in one terminal and using the code in another, this package is indispensable.
  • JuliaFormatter: Basic automatic source-code formatter for Julia.
  • Infiltrator: Drop into an interactive REPL at an arbitrary place in your code. Great for debugging and testing.
  • Debugger: A gdb-like Julia debugger, which I use every day.
  • Rebugger: Another debugger. Preferred over Debugger by some people.
  • Juno: Not actually a package, but the development environment endorsed Julia computing.
  • Surely there is Julia support for your favourite editor, too.

Reports and source-code documentation

  • Documenter is the goto source code documentation tool for Julia.
  • Weave allows to mix markdown and Julia, where the Julia code is automatically executed and resulting plots, data, tables are included into the final document.

More linear algebra

  • IterativeSolvers is a rich library for iterative methods with the most important iterative solver algorithms (Conjugate Gradient, GMRES, BiCGStab, Chebychev iteration, ...)
  • StaticArrays: Arrays of compile-time known size. Has a huge speed improvement for example when used for 3D vectors or 3D rotations.
  • BlockArrays: Special array for block-wise storing or treating arrays
  • LazyArrays: Makes array operations lazy.
  • TensorOperations: Performs higher-order tensor operations in convenient syntax. Kernels are generated with respect to the operation performad and are automatically parallelised. GPU support in the making. An example:
In [ ]:
import Pkg; Pkg.add("TensorOperations")
using TensorOperations
N = 3
I = randn(N, N, N, N); C = randn(N, N);
@tensor It[i,j,k,l] := I[α,β,γ,δ] * C[α, i] * C[β, j] * C[γ, k] * C[δ, l]

Automatic Differentiation (AD)

Visualisation and interaction

  • Numerous plot packages were already mentioned in Dancing_Particles.
  • Interact is great for adding interactive sliders or buttons to a notebook. For example:
In [ ]:
import Pkg; Pkg.add("Interact")
using Interact
using Plots
Vmorse(r; re=0.7, α=1.3, D=10) = D*(1 - exp(-α * (r - re)))^2 - D

r = collect(0:0.1:10)
mp = @manipulate for α in slider(0:0.1:4; label="Steepness α"), D in slider(0:0.4:30, label="depth D"),
                     re in slider(0:0.1:4, label="Equilibrium re")
    p = plot(r, Vmorse.(r, re=re, α=α, D=D), label="Vmorse re=$re α= D=$D", ylim=(-30, 30))
end

Symbolic manipulation

  • SymPy: Julia wrapper of the popular python package

Standard file formats

Plenty of standard file formats in scientific computing and elsewhere can be used in Julia:

  • JSON and YAML (TOML is in the standard library)
  • HDF5
  • MAT: Support for Matlab's mat files
  • NCDatasets: Support for netcdf
  • JLD and JLD2: Julia's own file format to reproducably dump and load any Julia object.

Chemistry and Materials Science

Not too many projects in chemistry and materials science have adopted Julia so far. Here are a few:

  • Chemfiles: Wrapper around the C library of the same name, which understands quite a few file formats in quantum chemistry.
  • ASE: Wrapper around the python library of the same name for atomistic simulations in materials science
  • JuLIP: Library for generating and fitting interatomic potentials
  • DFTK: Toolkit for density-functional theory and related models in extended systems (shameless advertisement)

PDEs and ODEs

  • Most of the tooling for solving differential equations in Julia is collected in the JuliaDiffEq organisation. The most important package is DifferentialEquations, where basically all the strings are collected. The package mostly concentrates on ordinary differential equations in various kinnds (random, stochastic, algebraic, mixed discrete / continuous ...)
  • For PDEs one big ecosystem is JuliaFEM, mostly centered around the JuliaFEM package. It brings a suite for finite-element modelling and all sorts of supporting tools (mesh generation, node renumbering). They claim to be able to handle between 10M to 100M degrees of freedom.

The optimisation community has adopted Julia rather early and the respective Julia libraries are at a very good shape.

  • The driving force behind the Julia optimisation community is the JuliaOpt organisation with its working horse JuMP. This package defines a metalanguage for optimisation problems, which can be combined with about 20 open-source or commercial optimisation solvers. A pretty exhaustive set of problem classes are supported: Linear programming, (mixed) integer programming, semidefinite programming, nonlinear programming, ...

  • For certain highly specific use cases a number of specialised packages have emerged:

    • Optim for continuous optimisation problems including simple manifolds
    • LsqFit for least-squares problems
    • Roots for finding roots of functions
    • NLsolve for general non-linear systems of equations

Data science and statistics

Apart from a few examples, the most important statistics and data science packages are associated with the JuliaStats and JuliaData organisations. In particular there are:

  • Statistics in the standard library.
  • DataFrames: Package for working with tabular data ("the pandas of Julia")
  • PrettyTables: Nicely formatted tables
  • StatsKit: Metapackage loading a full suite of Statistics-related tools
  • Distributions: Defines standard distributions and their properties

Machine Learning

  • In Julia two important frameworks exist, namely Flux and Knet. Their philosophy seems to differ a little, such that both seem to have their respective pros and cons.
  • Bindings for popular packages in foreign languages exist as well (TensorFlow, Apache MXNet). These bindings seem to be less actively developed than the above packages, however.