Computational 2D Materials Database (C2DB)

If you are using data from this database in your research, please cite the following paper:

The Computational 2D Materials Database: High-Throughput Modeling and Discovery of Atomically Thin Crystals

Sten Haastrup, Mikkel Strange, Mohnish Pandey, Thorsten Deilmann, Per S. Schmidt, Nicki F. Hinsche, Morten N. Gjerding, Daniele Torelli, Peter M. Larsen, Anders C. Riis-Jensen, Jakob Gath, Karsten W. Jacobsen, Jens Jørgen Mortensen, Thomas Olsen, Kristian S. Thygesen

2D Materials 5, 042002 (2018)

The data can be downloaded or browsed online:

Brief description

The database contains structural, thermodynamic, elastic, electronic, magnetic, and optical properties of around 4000 two-dimensional materials distributed over more than 50 different crystal structures. The properties are calculated by DFT and many-body perturbation theory (G0W0 and the Bethe- Salpeter Equation for around 200 materials) using the GPAW code and a semi- automated ASE based workflow. The workflow and a table with the numerical settings employed for the calculation of the different properties is provided below.

../_images/workflow.png

Overview of methods and parameters used

If a parameter is not specified at a given step, its value equals that of the last step where it was specified:

Workflow step(s)

Parameters

Structure and energetics(*) (1-4)

vacuum = 15 Å; \(k\)-point density = 6.0/Å\(^{-1}\); Fermi smearing = 0.05 eV; PW cutoff = 800 eV; xc functional = PBE; maximum force = 0.01 eV/Å; maximum stress = 0.002 eV/Å\(^3\); phonon displacement = 0.01Å

Elastic constants (5)

\(k\)-point density = \(12.0/\mathrm{Å}^{-1}\); strain = \(\pm\)1%

Magnetic anisotropy (6)

\(k\)-point density = \(20.0/\mathrm{Å}^{-1}\); spin-orbit coupling = True

PBE electronic properties (7-10 and 12)

\(k\)-point density = \(12.0/\mathrm{Å}^{-1}\) (\(36.0/\mathrm{Å}^{-1}\) for DOS)

Effective masses (11)

\(k\)-point density = \(45.0/\mathrm{Å}^{-1}\); finite difference

Deformation potential (13)

\(k\)-point density = 12.0/Å\(^{-1}\); strain = \(\pm\)1%

Plasma frequency (14)

\(k\)-point density = 20.0/Å\(^{-1}\); tetrahedral interpolation

HSE band structure (8-12)

HSE06@PBE; \(k\)-point density = 12.0/Å\(^{-1}\)

\(G_0W_0\) band structure (8, 9)

\(G_0W_0\)@PBE; \(k\)-point density = \(5.0/\mathrm{Å}^{-1}\); PW cutoff = \(\infty\) (extrapolated from 170, 185 and 200 eV); full frequency integration; analytical treatment of \(W({q})\) for small \(q\); truncated Coulomb interaction

RPA polarisability (15)

RPA@PBE; \(k\)-point density = \(20.0/\mathrm{Å}^{-1}\); PW cutoff = 50 eV; truncated Coulomb interaction; tetrahedral interpolation

BSE absorbance (16)

BSE@PBE with \(G_0W_0\) scissors operator; \(k\)-point density = \(20.0/\mathrm{Å}^{-1}\); PW cutoff = 50 eV; truncated Coulomb interaction; at least 4 occupied and 4 empty bands

(*) For the cases with convergence issues, we set a (k)-point density of 9.0 and a smearing of 0.02 eV.

Versions

Version

rows

comment

2018-06-01

1888

Initial release

2018-08-01

2391

Two new prototypes added

2018-09-25

3084

New prototypes

2018-12-10

3331

Some BSE spectra recalculated due to small bug affecting absorption strength of materials with large spin-orbit couplings

Key-value pairs

key

description

unit

E_B

Exciton binding energy from BSE

eV

E_x

Soc. total energy, x-direction

eV/unit cell

E_y

Soc. total energy, y-direction

eV/unit cell

E_z

Soc. total energy, z-direction

eV/unit cell

Topology

Band topology

age

Time since creation

alphax

Static total polarizability (x)

Ang

alphax_el

Static interband polarizability (x)

Ang

alphax_lat

Static lattice polarizability (x)

Ang

alphay

Static total polarizability (y)

Ang

alphay_el

Static interband polarizability (y)

Ang

alphay_lat

Static lattice polarizability (y)

Ang

alphaz

Static total polarizability (z)

Ang

alphaz_el

Static interband polarizability (z)

Ang

alphaz_lat

Static lattice polarizability (z)

Ang

asr_id

Material unique ID

c_11

Stiffness tensor, 11-component

N/m<sup>dim-1</sup>

c_12

Stiffness tensor, 12-component

N/m<sup>dim-1</sup>

c_13

Stiffness tensor, 13-component

N/m<sup>dim-1</sup>

c_22

Stiffness tensor, 22-component

N/m<sup>dim-1</sup>

c_23

Stiffness tensor, 23-component

N/m<sup>dim-1</sup>

c_33

Stiffness tensor, 33-component

N/m<sup>dim-1</sup>

calculator

ASE-calculator name

cbm

Conduction band minimum

eV

cbm_gw

Conduction band minimum (G0W0)

eV

cbm_hse

Conduction band minimum (HSE)

eV

cell_area

Area of unit-cell

Ang<sup>2</sup>

charge

Net charge in unit cell

|e|

class

Material class

cod_id

Related COD id

dE_zx

Magnetic anisotropy (E<sub>z</sub> - E<sub>x</sub>)

meV/unit cell

dE_zy

Magnetic anisotropy (E<sub>z</sub> - E<sub>x</sub>)

meV/unit cell

dipz

Out-of-plane dipole along +z axis

e * Ang/unit cell

doi

Monolayer reported DOI

dos_at_ef_nosoc

Density of states at the Fermi level w/o soc.

states/(eV * unit cell)

dos_at_ef_soc

Density of states at the Fermi level

states/(eV * unit cell)

efermi

Fermi level

eV

ehull

Energy above convex hull

eV/atom

emass_cb_dir1

Conduction band effective mass, direction 1

m<sub>e</sub>

emass_cb_dir2

Conduction band effective mass, direction 2

m<sub>e</sub>

emass_vb_dir1

Valence band effective mass, direction 1

m<sub>e</sub>

emass_vb_dir2

Valence band effective mass, direction 2

m<sub>e</sub>

energy

Total energy

eV

evac

Vacuum level

eV

evacdiff

Vacuum level difference

eV

fmax

Maximum force

eV/Ang

folder

Path to collection folder

formula

Chemical formula

gap

Band gap

eV

gap_dir

Direct band gap

eV

gap_dir_gw

Direct band gap (G0W0)

eV

gap_dir_hse

Direct band gap (HSE)

eV

gap_dir_nosoc

Direct gap w/o soc.

eV

gap_gw

Band gap (G0W0)

eV

gap_hse

Band gap (HSE)

eV

has_asr_bandstructure

asr.bandstructure is calculated

has_asr_bandstructure_calculate

asr.bandstructure@calculate is calculated

has_asr_berry

asr.berry is calculated

has_asr_berry_calculate

asr.berry@calculate is calculated

has_asr_borncharges

asr.borncharges is calculated

has_asr_bse

asr.bse is calculated

has_asr_convex_hull

asr.convex_hull is calculated

has_asr_database_app

asr.database.app is calculated

has_asr_database_fromtree

asr.database.fromtree is calculated

has_asr_database_material_fingerprint

asr.database.material_fingerprint is calculated

has_asr_deformationpotentials

asr.deformationpotentials is calculated

has_asr_emasses

asr.emasses is calculated

has_asr_fermisurface

asr.fermisurface is calculated

has_asr_gs

asr.gs is calculated

has_asr_gw

asr.gw is calculated

has_asr_gw_gw

asr.gw@gw is calculated

has_asr_hse

asr.hse is calculated

has_asr_hse_calculate

asr.hse@calculate is calculated

has_asr_infraredpolarizability

asr.infraredpolarizability is calculated

has_asr_magnetic_anisotropy

asr.magnetic_anisotropy is calculated

has_asr_pdos

asr.pdos is calculated

has_asr_phonons

asr.phonons is calculated

has_asr_phonons_calculate

asr.phonons@calculate is calculated

has_asr_phonopy_calculate

asr.phonopy@calculate is calculated

has_asr_plasmafrequency

asr.plasmafrequency is calculated

has_asr_polarizability

asr.polarizability is calculated

has_asr_projected_bandstructure

asr.projected_bandstructure is calculated

has_asr_raman

asr.raman is calculated

has_asr_setup_params

asr.setup.params is calculated

has_asr_stiffness

asr.stiffness is calculated

has_asr_structureinfo

asr.structureinfo is calculated

has_inversion_symmetry

Material has inversion symmetry

hform

Heat of formation

eV/atom

icsd_id

Related ICSD id

id

Uniqe row ID

is_magnetic

Material is magnetic

magmom

Magnetic moment

au

magstate

Magnetic state

mass

Sum of atomic masses in unit cell

au

minhessianeig

Minimum eigenvalue of Hessian

eV/Ang<sup>2</sup>

natoms

Number of atoms

pbc

Periodic boundary conditions

plasmafrequency_x

2D plasma frequency (x)

eV/Ang<sup>0.5</sup>

plasmafrequency_y

2D plasma frequency (y)

eV/Ang<sup>0.5</sup>

smax

Maximum stress on unit cell

eV/Ang<sup>3</sup>

spacegroup

Space group

speed_of_sound_x

Speed of sound (x)

m/s

speed_of_sound_y

Speed of sound (y)

m/s

spgnum

Space group number

spin_axis

Magnetic easy axis

stoichiometry

Stoichiometry

thermodynamic_stability_level

Thermodynamic stability level

uid

Unique identifier

unique_id

Random (unique) ID

user

Username

vbm

Valence band maximum

eV

vbm_gw

Valence band maximum (G0W0)

eV

vbm_hse

Valence band maximum (HSE)

eV

volume

Volume of unit cell

Ang<sup>3</sup>

workfunction

Work function (avg. if finite dipole)

eV

Example

The following python script shows how to plot the positions of the VBM and CBM.

# creates: band-alignment.png
from math import floor
import numpy as np
import matplotlib.pyplot as plt
import ase.db

# Connect to database
db = ase.db.connect('c2db.db')

rows = db.select('gap>0,class=TMDC-H', sort='gap')

labels = []
vbms = []
cbms = []
for row in rows:
    M, X = row.symbols[:2]
    label = M + X + '$_2$'
    labels.append(label)
    vbms.append(row.vbm)
    cbms.append(row.cbm)

x = np.arange(len(vbms)) + 0.5
emin = floor(min(vbms)) - 1.0

# With and height in pixels
ppi = 100
figw = 800
figh = 400

fig = plt.figure(figsize=(figw / ppi, figh / ppi), dpi=ppi)
ax = fig.add_subplot(1, 1, 1)
ax.bar(x, np.array(vbms) - emin, bottom=emin)
ax.bar(x, -np.array(cbms), bottom=cbms)
ax.set_xlim(0, len(labels))
ax.set_ylim(emin, 0)
ax.set_xticks(x)
ax.set_xticklabels(labels, rotation=90, fontsize=10)

plt.title("2H-TMD's: Positions of VBM and CBM (PBE+SOC)", fontsize=12)
plt.ylabel('Energy relative to vacuum [eV]', fontsize=10)
plt.tight_layout()
plt.savefig('band-alignment.png')

This produces the figure

../_images/band-alignment.png

Tools for creating the “Computational 2D materials” database

Requirements

Workflow

The workflow for each material is described in the workflow.py file:

"""Workflow for C2DB.

Important utility functions in this script:

  create_tasks
  get_mag_states
  get_most_stable_magstate
  task
  is_thermodynamically_stable
  is_dynamically_stablex
  all_done

The workflow is factored into four components:

  magstate_workflow
  therm_stability_workflow
  dynamical_stability_workflow
  property_workflow

"""
from myqueue.task import task as mqtask
from pathlib import Path
from asr.core import read_json, chdir
from asr.setup.strains import main as setupstrains
from asr.setup.strains import get_strained_folder_name, get_relevant_strains
from ase.io import read
import os

VERBOSE = os.environ.get('MQVERBOSE', False)


class MissingUnrelaxedStructure(Exception):
    """Exception raised when unrelaxed.json is missing."""

    pass


def is_thermodynamically_stable(folder):
    """Determine whether a material is thermodynamically stable."""
    ch = read_json(folder / "results-asr.convex_hull.json")
    hform = ch["hform"]

    if hform > 0.2:
        return False
    return True


def is_dynamically_stable(folder):
    """Determine whether a material is dynamically stable."""
    ph = read_json(folder / "results-asr.phonons.json")
    if ph["dynamic_stability_phonons"] == 'low':
        return False

    st = read_json(folder / "results-asr.stiffness.json")
    if st["dynamic_stability_stiffness"] == 'low':
        return False

    return True


def task(*args, **kwargs):
    """Get MyQueue task instance."""
    name = kwargs.get("name") or args[0]
    if "creates" not in kwargs:
        kwargs["creates"] = [f"results-{name}.json"]
    return mqtask(*args, **kwargs)


def get_cwd():
    """Get current working directory."""
    return Path('.').absolute()


reference_dbs = [
    '/home/niflheim2/cmr/databases/referencedatabases/oqmd123.db',
    '/home/niflheim2/cmr/C2DB-ASR/collected-databases/references-c2db.db'
]


def basic_workflow(folder):
    """Generate tasks related finding most stable magnetic structures."""
    tasks = []
    if not (Path(folder) / 'structure.json').is_file():
        if not (Path(folder) / 'unrelaxed.json').is_file():
            raise MissingUnrelaxedStructure
        tasks += [task("asr.relax", resources="40:20h",
                       folder=folder),
                  task("asr.structureinfo", resources="1:10m",
                       deps=["asr.relax"], folder=folder)]
    else:
        tasks += [task("asr.structureinfo", resources="1:10m", folder=folder)]

    tasks += [
        task("asr.gs", folder=folder,
             resources="40:5h", deps=["asr.structureinfo"]),
        task("asr.magstate", folder=folder,
             deps=["asr.gs"]),
        task(
            'asr.convex_hull ' + ' '.join(reference_dbs),
            folder=folder,
            name='asr.convex_hull',
            resources='1:10m',
            creates=['results-asr.convex_hull.json'],
            deps=['asr.gs'])
    ]
    return tasks


def dynamical_stability_workflow(folder):
    """Generate tasks related to determining dynamical stability."""
    verbose_print('Executing dynamical_stability_workflow().')
    if isinstance(folder, str):
        folder = Path(folder)

    tasks = []
    with chdir(folder):
        if not setupstrains.done:
            setupstrains()

    relevant_strains = get_relevant_strains(pbc=[True, True, False])
    strainfolders = [Path(
        get_strained_folder_name(sign * 1, i, j, clamped=False)
    ).resolve() for i, j in relevant_strains for sign in [-1, 1]]

    assert strainfolders, 'Missing strain folders.'
    for strainfolder in strainfolders:
        tasks += [task(
            "asr.relax",
            folder=strainfolder,
            resources="40:3h",
            creates=["results-asr.relax.json"],
        )]

    tasks += [task(
        "asr.stiffness",
        resources="1:10m",
        folder=folder,
        creates=["results-asr.stiffness.json"],
        deps=([f'{strainfolder}/asr.relax' for strainfolder
               in strainfolders])
    )]

    tasks += [task("asr.phonons", folder=folder,
                   restart=3, resources="40:8h",
                   deps=["asr.gs"])]
    return tasks


def all_done(list_of_tasks):
    """Determine if all tasks in list_of_tasks are done."""
    return all([task.is_done() for task in list_of_tasks])


def property_workflow(folder):
    """Generate tasks for various material properties."""
    verbose_print('Executing property_workflow()')
    atoms = read(folder / 'structure.json')
    tasks = [
        task("asr.bandstructure",
             folder=folder,
             resources="40:5h",
             deps=["asr.gs"]),
        task("asr.projected_bandstructure",
             folder=folder,
             resources="1:10m",
             deps=["asr.bandstructure"]),
        task("asr.polarizability",
             folder=folder,
             diskspace=1,
             resources="120:20h",
             deps=["asr.gs"]),
        task('asr.pdos', folder=folder,
             resources='40:5h',
             deps=['asr.gs']),
        task('asr.bader', deps=['asr.gs'],
             tmax='1h'),
    ]

    gsresults = read_json(folder / "results-asr.gs.json")
    structureinfo = read_json(folder / "results-asr.structureinfo.json")
    gap = gsresults.get("gap")

    # If there is a band gap
    if gap > 0.01:
        verbose_print(get_cwd(), 'Has band gap.')
        tasks += [task("asr.emasses",
                       folder=folder,
                       resources="40:5h",
                       deps=["asr.gs"]),
                  task("asr.emasses@validate",
                       folder=folder,
                       resources="1:10m",
                       deps=["asr.emasses"]),
                  task(
                      "asr.borncharges",
                      folder=folder,
                      resources="40:5h",
                      restart=3,
                      deps=["asr.gs"]),
                  task(
                      "asr.infraredpolarizability",
                      folder=folder,
                      deps=[
                          "asr.borncharges",
                          "asr.phonons",
                          "asr.polarizability",
                      ]),
                  task(
                      "asr.hse",
                      folder=folder,
                      resources="40:10h",
                      creates=["results-asr.hse.json"]),
                  ]
        if not structureinfo['has_inversion_symmetry']:
            tasks.append(
                task("asr.piezoelectrictensor",
                     resources="40:20h",
                     restart=3,
                     creates=['results-asr.piezoelectrictensor.json'],
                     deps=["asr.stiffness"]))

        if len(atoms) < 5 and gap > 0.2:
            tasks.append(task("asr.gw", folder=folder, resources="120:48h"))
    else:
        tasks += [
            task(
                "asr.fermisurface",
                folder=folder,
                resources="1:10m",
                creates=["results-asr.fermisurface.json"],
                deps=["asr.gs"],
            ),
            task(
                "asr.plasmafrequency",
                folder=folder,
                resources="40:20h",
                creates=["results-asr.plasmafrequency.json"],
                deps=["asr.gs"],
            )]

    return tasks


def return_tasks(tasks):
    """Wrap function for returning tasks."""
    if VERBOSE:
        print(get_cwd(), tasks)
    return tasks


def verbose_print(*args):
    """Only print if VERBOSE."""
    if VERBOSE:
        print(*args)


def create_tasks():
    """Create MyQueue Task list for the C2DB workflow.

    Note that this workflow relies on the folder layout of C2DB so be
    careful.

    """
    verbose_print(get_cwd())
    folder = Path('.')
    tasks = []
    tasks += basic_workflow(folder)

    if not all_done(tasks):
        return tasks

    if not is_thermodynamically_stable(folder):
        verbose_print('Is not thermodynamically stable.')
        return tasks

    dyn_tasks = dynamical_stability_workflow(folder)
    tasks += dyn_tasks
    if not all_done(tasks):
        verbose_print('Missing dynamic stability tasks.')
        return tasks

    if not is_dynamically_stable(folder):
        verbose_print('Is not dynamically stable.')
        return tasks

    tasks += property_workflow(folder)

    return tasks


if __name__ == '__main__':
    tasks = create_tasks()

    for ptask in tasks:
        print(ptask, ptask.is_done())

As an example, let’s do MoS\(_2\) in the CdI2 prototype (T-phase). Create a main folder and a subfolder:

$ mkdir TMD
$ cd TMD
$ mkdir MoS2-CdI2

Create a structure.json file containing something close to the groundstate structure:

$ python3
>>> from ase.build import mx2
>>> a = mx2('MoS2', '1T', a=3.20, thickness=3.17, vacuum=7.5)
>>> a.write('MoS2-CdI2/structure.json')

Start the workflow with:

$ mq workflow ~/cmr/docs/c2db/workflow.py MoS2-CdI2/

Note

The \(mq\) tool is described here

Once the first part of the workflow has finished, one or more folders will appear (nm/, fm/, afm/) if the material was thermodynimically stable. You can then run the remaining part of the workflow:

$ mq workflow ~/cmr/docs/c2db/workflow.py MoS2-CdI2/*m/

When everything is ready you can collect the results in a database file and inspect the results in a web-browser:

$ python3 -m asr.database.fromtree MoS2-CdI2/*m/
$ python3 -m asr.app