ase: a programmable environment for calculations with many ...dc › ~askhl › files ›...

18
ASE: A programmable environment for calculations with many electronic structure codes Ask Hjorth Larsen Center for Atomic-scale Materials Design, Technical University of Denmark 16th ETSF workshop September 28 2011

Upload: others

Post on 06-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

ASE: A programmable environment forcalculations with many electronic structure codes

Ask Hjorth Larsen

Center for Atomic-scale Materials Design, Technical University of Denmark

16th ETSF workshopSeptember 28 2011

Page 2: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Introduction

Atomic Simulation Environment

ASE is a set of tools for atomic-scale simulation tasks.

What can ASE do?

I Set up and view structures

I Run calculations such as structure optimizations andmolecular dynamics

I Read and write structures in many file formats

I ASE is open source / free software (LGPLv2.1)

What is so special about ASE?

I ASE unifies many electronic structure codes within a singleenvironment

I Calculations are written as Python scipts

Page 3: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Introduction

Motivation

I Electronic structure codes usually take different inputparameters and have incompatible file formats

I Each code requires learning a new input syntax

I And yet, much functionality is common to all codes: atomicgeometries, structure optimization algorithms, . . .

I ASE identifies common functionality and separates it from thespecific parameters of different codes

I Electronic structure codes are abstracted as calculators.Calculators implement a specific programming interface

Page 4: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Introduction

A bit of history

I ASE was developed as an interface to the FORTRAN-basedultrasoft pseudopotential code Dacapo

I S. R. Bahn and K. W. Jacobsen, An object-orientedscripting interface to a legacy electronic structure code,Comput. Sci. Eng. 4, 56 (2002), ISSN 1521-9615.

I ASE is a part of the CAMPOS (CAMP Open Source) projecthttps://wiki.fysik.dtu.dk/

I Other CAMPOS codes have been written with ASE interfaces:ASAP and GPAW

I ASE development is driven in part by our own requirements,so ASE/GPAW is a strongly correlated system

Page 5: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Atoms and calculators

Atoms and calculators

Atoms

Calculator

External code

generate

input

script

retrieve and

convert data

"get

potential

energy"

solve Schrödinger

equation

return the

potential

energy

I Atoms objects representgeometry: positions,atomic numbers, unitcell, momenta, . . .

I Calculators can be basedon anything thatcalculates energies,forces (DFT, classicalpotentials, ...)

Page 6: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Atoms and calculators

Example: The ASE/GPAW “hello world”

Page 7: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Atoms and calculators

ASE calculators so far

Page 8: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Atoms and calculators

Supported calculators

GPAW Grid-based real-space PAW code DFT, HFAsap Highly efficient EMT code (C++) EMT

Dacapo planewave USPP code DFTemt Effective Medium Theory calculator EMT

abinit A planewave pseudopotential code DFTsiesta LCAO pseudopotential code DFT

dftb DftbPlus DFT based tight binding DFTturbomole Fast atomic orbital code DFT, HF

castep Planewave pseodopotential code DFT, HFvasp Planewave PAW code DFT

FHI-aims NAO full-potential code DFT, HFexciting Full Potential LAPW code DFT, LAPW

fleur Full Potential LAPW code DFT, LAPWlammps Classical molecular dynamics code

Page 9: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Python

Scripting with Python in ASE

I Access to a complete language provides very high flexibility

I Python is interpreted, so no compilation required

I Well suited for scripting due to high-level features andsimple syntax

I Cross-platform (although some supercomputers can be finicky)

Scientific programming in Python

I numpy: module for array calculations

I scipy: module for high-level mathematics with numpy(optimization, integration, root finding)

I matplotlib: module for plotting

Page 10: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

The big picture

Overview of ASE classes

I Only the most commonobjects shown

I Red: user interfaceGreen: classes forinternal use

Page 11: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

The big picture

Demonstration: structure optimization

Page 12: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Structures and tools

Structure generation

Molecules

I ASE includes G1, G2 and G3 datasets

from ase.data.molecules import molecule

system = molecule(’CH3CH2OH ’)

Crystal structures

I Bulk

I Surfaces

I Clusters

IO

I ASE supports a couple dozen file formats

Page 13: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Structures and tools

Demonstration: Gold 111 surface

Page 14: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Structures and tools

Bulk rutile

from ase.lattice.spacegroup import crystal

a = 4.6

c = 2.95

rutile = crystal ([’Ti’, ’O’],

basis =[(0, 0, 0),

(0.3, 0.3, 0.0)],

spacegroup =136,

cellpar =[a, a, c, 90, 90, 90])

Page 15: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Structures and tools

Demonstration: Pt cluster with GUI

Page 16: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Development

Future plans or work in progress

Electronic structure interface

I Get density of states

I Export wavefunctions, densities (basis set conversions)

I More uniform input parameters

Automation

I Bulk submit script generation?

I “Run this calculator on this set of structures”

And more

I Interface to deal with electronic excitations

I Debian packages for Debian Open Science

I “Scratch your own itch”

Page 17: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Concluding remarks

List of committers

Andrew Peterson Ask Hjorth Larsen Jonas BjorkDavid Landis Marcin Dulak George TritsarisLars Grabow Heine Anton Hansen Felix HankeJakob Blomquist Jon B. Maronsson Janne BlomqvistJens J Mortensen Jesper Friis Jingzhe ChenJohn Kitchin Jussi Enkovaara Kristen KaasbjergJesper Kleis Karsten W Jacobsen Markus KaukonenMichael Walter Poul Georg Moses Marco VaninChristian Glinsvad Jakob Schiotz Mattias SlabanjaMikkel Strange Tao Jiang Thomas OlsenAnthony Goodrow Carsten Rostgaard Janosch M RaubaTroels K Jacobsen

Page 18: ASE: A programmable environment for calculations with many ...dc › ~askhl › files › ase.pdf · Atomic Simulation Environment Introduction Atomic Simulation Environment ASE is

Atomic Simulation Environment

Concluding remarks

Conclusion

I Pluggable calculators

I Python scripting

I Object oriented interface

I Structure generation and I/O

I Open source / free software

Links and info

I CAMPOS: https://wiki.fysik.dtu.dk/

I ASE: https://wiki.fysik.dtu.dk/ase/

I Mailing list: [email protected]

I IRC: #gpaw on irc.freenode.net (some of the same people)

I Python: http://www.python.org/