Skip to content

Calculate the Total Energy

1. Introduction

Calculate the total energy of a material, with or without a relaxation first.

2. Open the notebook

In JupyterLite, the notebook is made/workflows/total_energy.ipynb, entry 2.1.1 "Total 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
24
25
26
27
28
29
30
from datetime import datetime
from mat3ra.ide.compute import QueueName

# 2. Auth and organization parameters
# Set organization name to use it as the owner, otherwise your personal account is used
ORGANIZATION_NAME = None

# 3. Material parameters
FOLDER = "../uploads"
MATERIAL_NAME = "Silicon"  # Name of the material to load from local file or Standata

# 4. Workflow parameters
WORKFLOW_SEARCH_TERM = "total_energy.json"  # Search term for Workflows Standata
APPLICATION_NAME = "espresso"  # Specify application name (e.g., "espresso", "vasp", "nwchem")
ADD_RELAXATION = False  # Whether to add relaxation subworkflow as first unit

# set k-grid for relaxation and SCF (if not set, KPPRA is used by default)
RELAXATION_KGRID = None  # e.g., [4, 4, 4]
SCF_KGRID = None  # e.g., [4, 4, 4]

MY_WORKFLOW_NAME = "Total Energy" + (" (relax)" if ADD_RELAXATION else "")

# 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 commented code in cell 4.3.2 sets a model other than the workflow's when uncommented.

The overview explains the account, material, workflow, k-point, compute and job 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 total energy.

5. Interactive JupyterLite notebook

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