Extra topics

Overview

Teaching: min
Exercises: min
Questions
  • Why are socket calculators more computationally efficient?

Objectives
  • Calculate properties using a socket interface

Socket interfaces allow more efficient communication and data re-use

from ase.calculators.qe import Espresso, EspressoProfile
from ase.calculators.socketio import SocketIOCalculator

profile = EspressoProfile(['pw.x'])

calc = Espresso(profile=profile,
                pseudo_dir=pseudo_dir,
                kpts=(2, 2, 2),
                input_data={'control':  {'tprnfor': True,
                                         'tstress': True},
                            'system': {'ecutwfc': 40.}},
                pseudopotentials={'Si': 'Si.pbe-n-rrkjus_psl.1.0.0.UPF'})

calc = SocketIOCalculator(calc=calc, unixsocket='random-walk-socket')

Quantum Espresso setup

The Quantum Espresso calculator was introduced in a previous tutorial, if you haven’t done this tutorial yet, look there for some setup information.

Exercise: Socket random walk calculation

Repeat our random-walk energy calculation from the Quippy example using DFT implemented in Quantum Espresso.

Hint: as this is a DFT calculation and we have only four compute cores, you will need to use a smaller unit cell.

Exercise: Geometry optimisation

For a small unit cell of your choice, try performing geometry optimization with the QuasiNewton optimizer. How does the performance compare between using Espresso as a FileIOCalculator and as a SocketIOCalculator?

Key Points

  • Socket interfaces allow more efficient communication and data re-use