Petr Karnakov

Research scientist with over 10 years of experience in software engineering, high-performance computing, and machine learning. Background spans academic research at ETH Zurich and Harvard University and industry at DeepL, with expertise in numerical methods, physics simulations, and current focus on LLM fine-tuning and multimodal systems. List of publications.

Projects

metamers

Generating images from a description by inverting a vision-language model (Qwen3.5). The image is optimized until the model describes it with exactly the given sentence. The multigrid parameterization from ODIL gives recognizable objects instead of adversarial noise. README with examples.

“A glass of wine on a table.” Image generated for "A glass of wine on a table."
“A cat sitting on a table.” Image generated for "A cat sitting on a table."

ODIL

ODIL (Optimizing a DIscrete Loss) is a method and Python framework for solving inverse problems for partial differential equations, which is orders of magnitude faster than PINN (physics-informed neural networks). Article about the method.

Rotating beads Rotating beads
Swapping beads Swapping beads
Contactless manipulation Contactless manipulation
Inverse design: body from flow Inverse design: body from flow
Poisson Poisson
Wave Wave
Heat Heat

Aphros

Distributed multiphysics solver in C++ with MPI for simulating multiphase flow with bubbles and electrochemical reactors. The solver performed the largest simulations of foaming by breakup and mixing of air in water. Article about foam simulations.

Coalescence Coalescence
Cheerios effect Cheerios effect
Bubble splitter Bubble splitter
Foam by mixing Foam by mixing
Bubbles in electrolyzer Bubbles in electrolyzer
Drops Drops
Bubbles in electrolyzer Bubbles in electrolyzer
Gallery Gallery

autodiff

Automatic differentiation framework in C++ with GPU support through OpenCL.

Reverse mode Reverse mode

AM205

Visual materials for a class on numerical methods, lectured in 2022.

PCA removing day-night cycle PCA removing day-night cycle
String harmonics String harmonics

ptoy

Game with particles and portals in C++.

Web version Web version

TinyOS

Prototype operating system in x86 assembly for a school competition in 2008.

Screencast Screencast