Skip to content

evortran: genetic algorithms in modern Fortran

evortran banner

evortran is a modern Fortran library for genetic algorithm (GA) optimization. It is designed to be simple to use while remaining flexible and efficient. The library is implemented in Fortran for fast numerical computation and supports parallel execution on multi-core CPUs via OpenMP. It is distributed through the Fortran Package Manager (fpm).

With evortran, users can apply genetic algorithms to a wide range of problems: parameter estimation, function minimization, complex search tasks, parameter scans, or reconstruction of parameters from noisy data.

evortran has been published in SciPost Physics Codebase:

Thomas Biekötter, evortran: a modern Fortran package for genetic algorithms with applications from LHC data fitting to LISA signal reconstruction, SciPost Phys. Codebases 64 (2026)

Installation

Prerequisites

evortran requires:

  • A Fortran compiler: gfortran or Intel ifx
  • git
  • Fortran Package Manager fpm version ≥ 0.13.0

If fpm is not installed, see the FPM installation instructions.

Clone and build

git clone https://gitlab.com/thomas.biekoetter/evortran
cd evortran
fpm build --profile="debug"

Use the debug profile while setting up your problem — it enables runtime checks for incorrect argument usage. Switch to release for production runs:

fpm build --profile="release"

Use evortran as a dependency

Add evortran to the [dependencies] section of your fpm.toml:

[dependencies]
evortran = { git="https://gitlab.com/thomas.biekoetter/evortran", branch="master" }

Quick start

The following minimal example minimizes the two-dimensional Rosenbrock function. Save it as app/my_program.f90 inside your fpm project directory:

program my_program

  use evortran__util_kinds, only : wp
  use evortran__individuals_float, only : individual
  use evortran__evolutions_float, only : evolve_population

  implicit none

  type(individual) :: best_ind

  best_ind = evolve_population( &
    200, 2, rosenbrock, &
    lower_lim=-2.0_wp, upper_lim=2.0_wp, &
    fitness_target=1.0e-10_wp, &
    mating='blend', &
    mutate='gaussian')

  write(*,*) 'Minimum at x =', best_ind%genes
  write(*,*) 'f(x) =', best_ind%get_fitness()

contains

  pure subroutine rosenbrock(ind, f)
    class(individual), intent(in) :: ind
    real(wp), intent(out) :: f
    f = (1.0_wp - ind%genes(1))**2 + 100.0_wp*(ind%genes(2) - ind%genes(1)**2)**2
  end subroutine

end program

Build and run with:

fpm run my_program --profile="release"

Python interface

A Python wrapper is available as pyevortran, providing a Python interface to selected evortran routines. Installation instructions and usage examples can be found in the Python interface section of this documentation.