Skip to content

Calculate the Band Gap

1. Introduction

Calculate the electronic band gap of a material in Quantum ESPRESSO, with or without a relaxation first.

2. Open the notebook

In JupyterLite, the notebook is made/workflows/band_gap.ipynb, entry 4.1.1 "Band Gap / Band Gap+DOS (HSE)" 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
29
30
31
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 = "Silicon"

# 4. Workflow parameters
# Options: "band_gap" / "band_gap_dos_hse"
CALCULATION_TYPE = "band_gap"

APPLICATION_NAME = "espresso"
ADD_RELAXATION = False

WORKFLOW_SEARCH_TERM = f"{CALCULATION_TYPE}.json"
MY_WORKFLOW_NAME = CALCULATION_TYPE.replace("_", " ").title() + (" (relax)" if ADD_RELAXATION else "")

# Model parameters
MODEL_SUBTYPE = "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

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

CALCULATION_TYPE selects the Standata workflow <CALCULATION_TYPE>.json: "band_gap" or "band_gap_dos_hse".

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

Cell 1.3 holds the method parameters:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Method parameters
PSEUDOPOTENTIAL_TYPE = "us"  # "us" (ultrasoft), "nc" (norm-conserving), "paw"
FUNCTIONAL = "pbe"            # for lda: "pz"; for gga: "pbe", "pbesol"

# K-grids
RELAXATION_KGRID = None  # e.g. [4, 4, 4]
SCF_KGRID = None          # e.g. [4, 4, 4]
NSCF_KGRID = None         # e.g. [8, 8, 8] — used for band_gap_dos_hse

# Energy cutoffs
ECUTWFC = 40
ECUTRHO = 200

NSCF_KGRID applies to the non-self-consistent step of "band_gap_dos_hse". 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 shows the band gaps.

5. Interactive JupyterLite notebook

The interactive JupyterLite notebook for calculating the band gap can be accessed below.

Calculate Electronic Band Gap and Band Gap and Density of States with Quantum ESPRESSO (HSE) calculate the band gap from the web interface.