Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
NaviCatGA
Logo

Getting Started

  • Installation

Tutorials

  • Tutorials
    • 1. Continuous optimization
    • 2. SMILES fragment optimization
    • 3. Editing a real molecule (SELFIES)
    • 4. Config-driven runs
    • 5. Multi-objective optimization
    • 6. 3D structures (XYZ/AaronTools)
    • 7. Writing your own assembler, fitness function, and launcher
    • 8. Logging and saving run artifacts

Configuration

  • Configuration Templates

API Reference

  • API Reference
    • navicatGA
      • navicatGA.alphabet_solver
      • navicatGA.base_solver
      • navicatGA.cache
      • navicatGA.chemistry_selfies
      • navicatGA.chemistry_smiles
      • navicatGA.chemistry_xyz
      • navicatGA.config
      • navicatGA.exception_messages
      • navicatGA.exceptions
      • navicatGA.fitness_functions_float
      • navicatGA.fitness_functions_selfies
      • navicatGA.fitness_functions_xyz
      • navicatGA.float_solver
      • navicatGA.helpers
      • navicatGA.logger
      • navicatGA.quantum_wrappers_selfies
      • navicatGA.quantum_wrappers_xyz
      • navicatGA.queue_wrappers_xyz
      • navicatGA.score_modifiers
      • navicatGA.selfies_solver
      • navicatGA.smiles_solver
      • navicatGA.timeout
      • navicatGA.wrappers_selfies
      • navicatGA.wrappers_smiles
      • navicatGA.wrappers_xyz
      • navicatGA.xyz_solver
Back to top
View this page
Edit this page

NaviCatGA¶

A flexible pure-Python Genetic Algorithm optimizer, part of the NaviCat project.

DOI

NaviCatGA is developed by LCMD at EPFL, part of the NaviCat project funded within the NCCR Catalysis of the Swiss National Science Foundation.

The base solver’s dependencies are minimal (numpy, matplotlib); each representation-specific child solver pulls in chemistry dependencies only when used (rdkit, selfies, AaronTools, pyscf, matter-chimera). See Installation.


Key ideas¶

  • One base class, several representations. GenAlgSolver runs the generic GA loop (selection, crossover, mutation, convergence). It knows nothing about what a chromosome means: that’s supplied by an assembler (chromosome → object to score) and a fitness_function (object → score), passed in at construction.

  • Four ready-made solvers: FloatGenAlgSolver (continuous vectors), SmilesGenAlgSolver/SelfiesGenAlgSolver (molecules via SMILES/SELFIES fragments), XYZGenAlgSolver (3D structures via AaronTools substituent/ligand swaps). They’re example/reference implementations meant to be adapted or subclassed, not a fixed closed API.

  • Config-driven construction. navicatGA.config.build_solver_from_yaml builds any solver from a YAML file instead of a hardcoded constructor call, resolving fitness_function/chromosome_to_*/scalarizer by dotted reference. See Configuration Templates.

Quick start¶

from navicatGA.float_solver import FloatGenAlgSolver

def my_fitness(x):
    return -sum((xi - 0.5) ** 2 for xi in x)

solver = FloatGenAlgSolver(
    n_genes=3,
    fitness_function=my_fitness,
    variables_limits=(0, 1),
    pop_size=50,
    max_gen=100,
)
result = solver.solve()
print(result.best_individual, result.best_fitness)

Start with Tutorial 1 for the full walkthrough of what assembler/fitness_function mean and how the rest of the GA-mechanics params work, then move on to the SMILES/SELFIES/config-driven/multi-objective tutorials as your problem needs them. navicatGA/test/ doubles as a set of small worked examples, and examples/ holds four complete config-driven downstream projects (frustrated Lewis pairs, Ni-catalyzed ether cleavage, bipyridine organocatalysts, singlet-fission materials), each with a cheap smoke config.


Citation¶

If you use NaviCatGA in your research, please cite:

DOI

Genetic Optimization of Homogeneous Catalysts

@article{laplaza_genetic_2022,
	title = {Genetic {Optimization} of {Homogeneous} {Catalysts}},
	url = {https://chemistry-europe.onlinelibrary.wiley.com/doi/abs/10.1002/cmtd.202100107},
	doi = {10.1002/cmtd.202100107},
	language = {en},
	journal = {Chemistry–Methods},
	volume = {2},
	pages = {e202100107},
	author = {Laplaza, Raúl and Gallarati, Simone and Corminboeuf, Clémence},
	month = mar,
	year = {2022},
}

Getting Started

  • Installation

Tutorials

  • Tutorials

Configuration

  • Configuration Templates

API Reference

  • API Reference
    • navicatGA
Next
Installation
Copyright © 2021, rlaplaza, lcmd-epfl
Made with Sphinx and @pradyunsg's Furo
On this page
  • NaviCatGA
    • Key ideas
    • Quick start
    • Citation