Equation of state (EOS)

For the source code, see eos.

Example: Silicon

Prepare the inputs and submit the workflow

[5]:
from ase.build import bulk
from ase import Atoms
from aiida import load_profile
from workgraph_collections.ase.espresso.eos import EosWorkGraph
from aiida_pythonjob.config import config

load_profile()

config["allow_pickle"] = True

# create input structure
atoms = bulk("Si")

metadata = {
    "options": {
        'prepend_text' : """eval "$(conda shell.posix hook)"
        conda activate aiida
        export OMP_NUM_THREADS=1
        """,
    }
}
pseudopotentials = {"Si": "Si.pbe-nl-rrkjus_psl.1.0.0.UPF"}
pseudo_dir = "/home/xing/data/ase/espresso_pseudo"
# pseudo_dir = "/home/wang_x3/datas/pseudos/psl"
input_data = {
    "control": {"calculation": "scf"},
    "system": {"ecutwfc": 30, "ecutrho": 240,
               "occupations": "smearing",
                "degauss": 0.01,
                "smearing": "cold",},
}
#------------------------- Set the inputs -------------------------
wg = EosWorkGraph.build_graph(atoms=atoms,
                   computer="localhost",
                   scales=[0.95, 0.98, 1.0, 1.02, 1.05],
                   command="mpirun -np 2 pw.x",
                   pseudopotentials=pseudopotentials,
                   pseudo_dir=pseudo_dir,
                   input_data=input_data,
                   kpts=[4, 4, 4],
                   metadata=metadata)
wg.to_html()
[5]:

Run the calculation

[3]:
wg.run()

09/03/2025 06:13:07 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178206|WorkGraphEngine|continue_workgraph]: tasks ready to run: pw_calculator
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178206|WorkGraphEngine|continue_workgraph]: tasks ready to run: pw_calculator
09/03/2025 06:13:08 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178206|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 178210
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178206|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 178210
09/03/2025 06:13:30 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178206|WorkGraphEngine|update_task_state]: Task: pw_calculator, type: PYTHONJOB, finished.
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178206|WorkGraphEngine|update_task_state]: Task: pw_calculator, type: PYTHONJOB, finished.
09/03/2025 06:13:32 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178206|WorkGraphEngine|continue_workgraph]: tasks ready to run: generate_scaled_atoms
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178206|WorkGraphEngine|continue_workgraph]: tasks ready to run: generate_scaled_atoms
INFO:aiida_pythonjob.decorator:Executing process function, current stack status: 47 frames of 3000
09/03/2025 06:13:33 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178206|WorkGraphEngine|update_task_state]: Task: generate_scaled_atoms, type: PYFUNCTION, finished.
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178206|WorkGraphEngine|update_task_state]: Task: generate_scaled_atoms, type: PYFUNCTION, finished.
09/03/2025 06:13:34 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178206|WorkGraphEngine|continue_workgraph]: tasks ready to run: calc_all_structures
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178206|WorkGraphEngine|continue_workgraph]: tasks ready to run: calc_all_structures
09/03/2025 06:13:42 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178206|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 178253
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178206|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 178253
09/03/2025 06:13:49 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178253|WorkGraphEngine|continue_workgraph]: tasks ready to run: pw_calculator,pw_calculator1,pw_calculator2,pw_calculator3,pw_calculator4
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178253|WorkGraphEngine|continue_workgraph]: tasks ready to run: pw_calculator,pw_calculator1,pw_calculator2,pw_calculator3,pw_calculator4
09/03/2025 06:13:58 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178253|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 178257, 178261, 178265, 178269, 178273
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178253|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 178257, 178261, 178265, 178269, 178273
09/03/2025 06:14:25 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178253|WorkGraphEngine|update_task_state]: Task: pw_calculator, type: PYTHONJOB, finished.
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178253|WorkGraphEngine|update_task_state]: Task: pw_calculator, type: PYTHONJOB, finished.
09/03/2025 06:14:31 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178253|WorkGraphEngine|continue_workgraph]: tasks ready to run:
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178253|WorkGraphEngine|continue_workgraph]: tasks ready to run:
09/03/2025 06:14:31 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178253|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 178261, 178265, 178269, 178273
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178253|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 178261, 178265, 178269, 178273
09/03/2025 06:14:43 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178253|WorkGraphEngine|update_task_state]: Task: pw_calculator1, type: PYTHONJOB, finished.
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178253|WorkGraphEngine|update_task_state]: Task: pw_calculator1, type: PYTHONJOB, finished.
09/03/2025 06:14:44 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178253|WorkGraphEngine|update_task_state]: Task: pw_calculator2, type: PYTHONJOB, finished.
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178253|WorkGraphEngine|update_task_state]: Task: pw_calculator2, type: PYTHONJOB, finished.
09/03/2025 06:14:45 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178253|WorkGraphEngine|update_task_state]: Task: pw_calculator3, type: PYTHONJOB, finished.
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178253|WorkGraphEngine|update_task_state]: Task: pw_calculator3, type: PYTHONJOB, finished.
09/03/2025 06:14:45 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178253|WorkGraphEngine|update_task_state]: Task: pw_calculator4, type: PYTHONJOB, finished.
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178253|WorkGraphEngine|update_task_state]: Task: pw_calculator4, type: PYTHONJOB, finished.
09/03/2025 06:14:51 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178253|WorkGraphEngine|continue_workgraph]: tasks ready to run:
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178253|WorkGraphEngine|continue_workgraph]: tasks ready to run:
09/03/2025 06:14:52 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178253|WorkGraphEngine|finalize]: Finalize workgraph.
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178253|WorkGraphEngine|finalize]: Finalize workgraph.
09/03/2025 06:14:53 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178206|WorkGraphEngine|update_task_state]: Task: calc_all_structures, type: GRAPH, finished.
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178206|WorkGraphEngine|update_task_state]: Task: calc_all_structures, type: GRAPH, finished.
09/03/2025 06:14:56 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178206|WorkGraphEngine|continue_workgraph]: tasks ready to run: fit_eos
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178206|WorkGraphEngine|continue_workgraph]: tasks ready to run: fit_eos
INFO:aiida_pythonjob.decorator:Executing process function, current stack status: 47 frames of 3000
09/03/2025 06:14:57 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178206|WorkGraphEngine|update_task_state]: Task: fit_eos, type: PYFUNCTION, finished.
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178206|WorkGraphEngine|update_task_state]: Task: fit_eos, type: PYFUNCTION, finished.
09/03/2025 06:14:57 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178206|WorkGraphEngine|continue_workgraph]: tasks ready to run:
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178206|WorkGraphEngine|continue_workgraph]: tasks ready to run:
09/03/2025 06:14:57 PM <77904> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [178206|WorkGraphEngine|finalize]: Finalize workgraph.
REPORT:aiida.orm.nodes.process.workflow.workchain.WorkChainNode:[178206|WorkGraphEngine|finalize]: Finalize workgraph.

Print the results

[4]:
#------------------------- Print the output -------------------------
print('\nResult: \nB: {B}\nv0: {v0}\ne0: {e0}\nv0: {v0}'.format(**wg.outputs.result.value))


Result:
B: 88.541858293246
v0: 41.224378688688
e0: -277.89646661704
v0: 41.224378688688