Skip to content

Calculate the Phonons of a Magnetic Material

1. Introduction

Calculate the phonon dispersion and the phonon density of states (DOS) of a magnetic material in Quantum ESPRESSO, with density functional perturbation theory (DFPT) on a spin-polarized ground state, with or without a relaxation first. The cost grows steeply with the number of atoms, so the notebook is meant for a small primitive cell.

2. Open the notebook

In JupyterLite, the notebook is made/workflows/phonon_dos_dispersion_magn.ipynb, entry 5.1.2 "Phonon DOS and Dispersion (Magnetic)" of made/workflows/Introduction.ipynb.

3. Set the parameters

Cell 1.2 holds the material, workflow and compute parameters:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from datetime import datetime
from mat3ra.ide.compute import QueueName

# 2. Auth and organization parameters
ORGANIZATION_NAME = None

# 3. Material parameters
FOLDER = "../uploads"
MATERIAL_NAME = "FeO"

# 4. Workflow parameters
WORKFLOW_SEARCH_TERM = "phonon_dos_dispersion.json"
MAGNETIC_WORKFLOW_SEARCH_TERM = "band_structure_magn.json"
APPLICATION_NAME = "espresso"
MY_WORKFLOW_NAME = "Phonon Density of States + Dispersions (spin magnetism)"

# Model parameters
MODEL_SUBTYPE = "gga"  # "gga" or "lda"

# 5. Compute parameters
CLUSTER_NAME = None  # specify full or partial name i.e. "cluster-001" to select
QUEUE_NAME = QueueName.D
PPN = 1
TIME_LIMIT = "04:00:00"

# 6. Job parameters
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M")
POLL_INTERVAL = 30  # seconds

MATERIAL_NAME is looked up with load_material. MAGNETIC_WORKFLOW_SEARCH_TERM names the workflow whose spin-polarized self-consistent input replaces that of the phonon workflow.

The overview explains the account, FOLDER, workflow, compute and job parameters.

Cell 1.3 holds the method, phonon and magnetic parameters:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Method parameters
PSEUDOPOTENTIAL_TYPE = "us"  # "us" (ultrasoft, GBRV [1]), "nc" (norm-conserving), "paw"
FUNCTIONAL = "pbe"           # for gga: "pbe", "pbesol"; for lda: "pz"

# Relax the structure before phonons. Phonons require a force-minimized geometry —
# an unrelaxed structure produces imaginary (negative) modes. Relaxes in the magnetic
# state, in the SCF step: "relax" (atoms only) or "vc-relax" (atoms and cell).
ADD_RELAXATION = False
RELAXATION_TYPE = "relax"

# Electronic k-grids; if None, the workflow default is used
SCF_KGRID = None         # e.g. [8, 8, 8]

# Phonon q-grid for the DFPT run (ph.x); if None, the workflow default is used
PHONON_QGRID = None      # e.g. [4, 4, 4]

# DFPT mixing for magnetic metals (ph.x alpha_mix(1)); if None, the ph.x default (0.7) is used
ALPHA_MIX = 0.3

# Phonon DOS interpolation grid (matdyn.x); if None, the workflow default is used
DOS_QGRID = None         # e.g. [12, 12, 12]

# Phonon dispersion path (matdyn.x); if None, the workflow default is used
QPATH = None             # [{"point": "Γ", "steps": 20}, {"point": "N", "steps": 20}, {"point": "M", "steps": 20}, {"point": "Γ", "steps": 20}]

# Collinear magnetization by atomic species (with labels), e.g. antiferromagnetic FeO
STARTING_MAGNETIZATION = {"Fe1": -1, "Fe2": 1}

# Patch &CONTROL and &ELECTRONS (recommended for magnetic insulators)
ADDITIONAL_PARAMETERS = {
    # "control": {
    #     "tstress": False,
    #     "tprnfor": False,
    # },
    # "electrons": {
    #     "mixing_mode": "plain",
    #     "mixing_beta": 0.2,
    #     "mixing_ndim": 10,
    #     "conv_thr": "1.0d-8",
    #     "diagonalization": "cg",
    #     "electron_maxstep": 200,
    #     "diago_david_ndim": 4,
    #     "diago_full_acc": True,
    #     "startingwfc": "atomic+random",
    # }
}

# Energy cutoffs (raise for harder cases — e.g. 60 / 480 for Graphene)
ECUTWFC = 40
ECUTRHO = 200

ADD_RELAXATION = True runs the self-consistent step as a relaxation in the magnetic state, of the type RELAXATION_TYPE: "relax" (atoms only) or "vc-relax" (atoms and cell). PHONON_QGRID is the q-grid of ph.x, DOS_QGRID the interpolation grid of the DOS and QPATH the dispersion path of matdyn.x, set like the k-points and paths. ALPHA_MIX is the mixing factor of ph.x (alpha_mix(1)); with None, the ph.x default is used.

STARTING_MAGNETIZATION sets the starting magnetization per species. A species is an element followed by its atom label, such as Fe1 and Fe2: the atoms that need a separate starting magnetization are labeled in Materials Designer before the run, and the others are left unlabeled. ADDITIONAL_PARAMETERS patches the &CONTROL and &ELECTRONS namelists of the self-consistent step; its commented values are recommended for magnetic insulators.

The overview explains the model, k-point and cutoff and engine input parameters.

4. Run and read the result

Run the notebook with Run > Run All and log in when it asks, as in Authentication in JupyterLite.

After the job finishes, section 8 plots the phonon dispersion and the phonon DOS.

5. Interactive JupyterLite notebook

The interactive JupyterLite notebook for calculating the phonons of a magnetic material can be accessed below.

Phonon Dispersions and Density of States Calculation calculates the phonon dispersion and DOS from the web interface, and Spin-Magnetic Band Structure Calculation in Quantum ESPRESSO sets the starting magnetization there.