Skip to content

Calculate the Surface Energy

1. Introduction

Calculate the surface energy of a slab. The bulk crystal is found from the build metadata of the slab, and its total energy is taken from a finished total energy job on the platform, calculated beforehand with the Total Energy notebook.

2. Open the notebook

In JupyterLite, the notebook is made/workflows/surface_energy.ipynb, entry 6.2.1 "Surface energy calculation" of made/workflows/Introduction.ipynb.

3. Set the parameters

Cell 1.2 holds the slab, 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"
SLAB_NAME = "Slab"  # Name of the slab to load from uploads folder or from the platform

# 4. Workflow parameters
WORKFLOW_SEARCH_TERM = "surface_energy.json"
APPLICATION_NAME = "espresso"
MY_WORKFLOW_NAME = "Surface 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

SLAB_NAME is looked up in FOLDER, then among the account's materials.

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

Cell 1.3 holds the k-grid and the source of the bulk total energy:

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

# Whose total_energy properties to consider for the bulk reference: "public"
# (any owner, highest precision wins), "curators" (only curators'), or
# "my_account" (curators' or your own).
BULK_TOTAL_ENERGY_SOURCE = "my_account"

SCF_KGRID is the k-grid of the slab. BULK_TOTAL_ENERGY_SOURCE selects whose total energy of the bulk is 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 3 stops when the bulk crystal has no finished total energy job. After the job finishes, section 7 shows the surface energy and prints the total energies of the slab and of the bulk.

5. Interactive JupyterLite notebook

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

Calculate Surface Energy runs the surface energy workflow from the web interface.