Skip to content

Calculate the Formation Energy

1. Introduction

Calculate the formation energy of a compound. The elemental references are the Standata elemental materials of its elements, whose total energies are calculated beforehand with the Total Energy notebook.

2. Open the notebook

In JupyterLite, the notebook is made/workflows/formation_energy.ipynb, entry 6.6.1 "Compound formation energy" 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
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"  # Name of the compound to load from uploads folder, Standata, or platform

# 4. Workflow parameters
WORKFLOW_SEARCH_TERM = "formation_energy.json"
APPLICATION_NAME = "espresso"
MY_WORKFLOW_NAME = "Formation Energy"

# 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

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

Cell 1.3 holds the k-grid and the source of the elemental total energies:

1
2
3
4
5
6
7
8
9
# K-grid for SCF (if not set, the workflow default is used)
SCF_KGRID = None  # e.g. [6, 6, 6]

# Elemental total energy source
# Controls whose total_energy properties are used for elemental references:
#   'public'     — any owner (highest precision wins)
#   'curators'   — only curators' properties
#   'my_account' — curators' or your own properties
ELEMENTAL_TE_SOURCE = "public"

SCF_KGRID is the k-grid of the compound. ELEMENTAL_TE_SOURCE selects whose elemental total energies are used.

4. Run and read the result

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

Section 4 stops when an elemental reference has no total energy. After the job finishes, section 8 shows the formation energy.

5. Interactive JupyterLite notebook

The interactive JupyterLite notebook for calculating the formation energy can be accessed below.

Calculate Formation Energy runs the formation energy workflow from the web interface.