r/Python • u/basnijholt • Dec 13 '19
Python + Quantum Research = Art + Saving 1000s hours of CPU time
27
20
11
Dec 14 '19
Soo computers loves tits?
5
u/Rocket089 Dec 14 '19
I’m not the only one who thought of an hour glass figure with a great rack?!
YESSS 💪🏼
1
1
Dec 14 '19
Is this a band structure calculation?
2
u/basnijholt Dec 14 '19
It is the conductance through nanowire.
But a band structure is something that we typically calculate as well.
1
2
2
u/7JKS Dec 14 '19
2
u/VredditDownloader Dec 14 '19
beep. boop. I'm a bot that provides downloadable video links!
I also work with links sent by PM
Info | Support me ❤ | Github
0
97
u/basnijholt Dec 13 '19 edited Dec 13 '19
Adaptive: parallel active learning of mathematical functions
This is a quantum physics calculation in progress.
When evaluating a function numerically we would like to sample it more densely in the interesting regions instead of evaluating it on a manually-defined homogeneous grid. Together with my colleagues, we wrote an open-source Python software package Adaptive that evaluates the function at the optimal points by analyzing existing data and planning ahead on the fly. With a few lines of code you define your goal, evaluate functions on a computing cluster, and live-plot the data. It performs averaging of stochastic functions, interpolation of vector-valued one and two-dimensional functions, and one-dimensional integration.
This figure is from one of my recent papers Spin-Orbit Protection of Induced Superconductivity in Majorana Nanowires.
What you see here is how the calculation progresses in time. You see that as time progresses it starts to find the narrow lines (which have a physical meaning). For aesthetic purposes, I change the colormap slowly which is meaningless but pretty. The vertices (corners) of the white triangles on top of the plot represent the points are which the underlying function is evaluated. The >1000 years of computation time is based on a comparison between a homogeneous grid. If we take the size of the smallest triangle, the computation time with adaptive (2 weeks on 300 cores), and assume that all the features larger than the smallest triangles have been resolved, then the calculation would have taken 3134 years.
You can recreate this video by using this script and this data. The entire source code for generating the data is here (be warned, you probably need a supercomputer).
See (star) ⭐️ the repo on github.com/python-adaptive/adaptive and the documentation on adaptive.readthedocs.io.
Try
pip install adaptive[notebook]orconda install adaptive:-)You can also run Adaptive code live in Binder here!
P.S. adaptive has already been used in several other scientific publications, see the gallery!