Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convergence parameters check #61

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions susyexists/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# K-point convergence tracker (Materials)

> Ideal candidate: scientists skilled in Density Functional Theory and proficient in python.

# Overview

The aim of this task is to create a python package that implements automatic convergence tracking mechanism for a materials simulations engine. The convergence is tracked with respect to the k-point sampling inside a reciprocal cell of a crystalline compound.

# Requirements

1. automatically find the dimensions of a k-point mesh that satisfy a certain criteria for total energy (eg. total energy is converged within dE = 0.01meV)
1. the code shall be written in a way that can facilitate easy addition of convergence wrt other characteristics extracted from simulations (forces, pressures, phonon frequencies etc)
1. the code shall support VASP or Quantum ESPRESSO

# Expectations

- correctly find k-point mesh that satisfies total energy convergence parameters for a set of 10 materials, starting from Si2, as simplest, to a 10-20-atom supercell of your choice
- modular and object-oriented implementation
- commit early and often - at least once per 24 hours

# Timeline

We leave exact timing to the candidate. Must fit Within 5 days total.

# User story

As a user of this software I can start it passing:

- path to input data (eg. pw.in / POSCAR, INCAR, KPOINTS) and
- kinetic energy cutoff

as parameters and get the k-point dimensions (eg. 5 5 5).

# Notes

- create an account at exabyte.io and use it for the calculation purposes
- suggested modeling engine: Quantum ESPRESSO
110 changes: 110 additions & 0 deletions susyexists/Si_parameter_test.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from src import model #Import library\n",
"num_core = 8 #Define number of cores"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"#Step 1 - Initialize model\n",
"pw = model.pw(project_id=\"Si\") #Define project\n",
"pw.from_poscar(directory=\"./Structures/Si.poscar\") #Load structure\n",
"pw.get_primitive() #Get primitive cell\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ecutwfc: 50.0 DeltaE :-0.0006273841728230423 Ry Time: 0.1938261985778809 seconds\n",
"ecutwfc: 60.0 DeltaE :-0.0003047080408862257 Ry Time: 0.2084970474243164 seconds\n",
"ecutwfc: 70.0 DeltaE :-6.351904913692863e-05 Ry Time: 0.2371938228607178 seconds\n",
"ecutwfc: 80.0 DeltaE :-6.302970438909483e-06 Ry Time: 0.2995648384094238 seconds\n",
"ecutwfc: 90.0 DeltaE :-1.8760475342105565e-06 Ry Time: 0.3129620552062988 seconds\n",
"ecutwfc: 100.0 DeltaE :-1.1352211721771255e-06 Ry Time: 0.3260128498077393 seconds\n",
"ecutwfc: 110.0 DeltaE :-5.068481669923131e-07 Ry Time: 0.4594228267669678 seconds\n",
"ecutwfc: 120.0 DeltaE :-3.066274292251592e-07 Ry Time: 0.4630310535430908 seconds\n",
"ecutwfc: 130.0 DeltaE :-2.0733272876327646e-07 Ry Time: 0.4597089290618896 seconds\n",
"ecutwfc: 140.0 DeltaE :-1.7449340994346585e-07 Ry Time: 0.5133810043334961 seconds\n",
"ecutwfc: 150.0 DeltaE :-1.0422343521554467e-07 Ry Time: 0.5248079299926758 seconds\n",
"ecutwfc: 160.0 DeltaE :-2.12823554335273e-07 Ry Time: 0.5203700065612793 seconds\n",
"ecutwfc: 170.0 DeltaE :-1.0274962747303107e-07 Ry Time: 0.5212390422821045 seconds\n",
"ecutwfc: 180.0 DeltaE :-4.080993676325306e-08 Ry Time: 0.5420069694519043 seconds\n"
]
}
],
"source": [
"res = pw.test('ecutwfc',conv_thr=1e-7,start=40,end=500,step=10,num_core=8,debug=False,out=True)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"kpoints: 3.0 DeltaE :-0.11467918418520107 Ry Time: 1.894612073898315 seconds\n",
"kpoints: 4.0 DeltaE :-0.02549575453173958 Ry Time: 3.407161951065063 seconds\n",
"kpoints: 5.0 DeltaE :-0.006562763616971168 Ry Time: 2.148712158203125 seconds\n",
"kpoints: 6.0 DeltaE :-0.0016181548250191469 Ry Time: 3.427868127822876 seconds\n",
"kpoints: 7.0 DeltaE :-0.00030730358718500383 Ry Time: 3.61491584777832 seconds\n",
"kpoints: 8.0 DeltaE :-2.980461402835033e-05 Ry Time: 6.036959886550903 seconds\n",
"kpoints: 9.0 DeltaE :7.220643169603136e-06 Ry Time: 7.17269492149353 seconds\n",
"kpoints: 10.0 DeltaE :4.551905615102214e-06 Ry Time: 9.542922973632812 seconds\n",
"kpoints: 11.0 DeltaE :1.018306175382122e-06 Ry Time: 10.97165894508362 seconds\n",
"kpoints: 12.0 DeltaE :-2.4028405931630914e-08 Ry Time: 13.10678911209106 seconds\n"
]
}
],
"source": [
"res = pw.test('kpoints',conv_thr=1e-7,start=2,end=20,step=1,num_core=8,debug=False,out=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
16 changes: 16 additions & 0 deletions susyexists/Structures/Si.poscar
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Si8
1.0
5.4437023729394527 0.0000000000000000 0.0000000000000003
0.0000000000000009 5.4437023729394527 0.0000000000000003
0.0000000000000000 0.0000000000000000 5.4437023729394527
Si
8
direct
0.7500000000000000 0.7500000000000000 0.2500000000000000 Si
0.0000000000000000 0.5000000000000000 0.5000000000000000 Si
0.7500000000000000 0.2500000000000000 0.7500000000000000 Si
0.0000000000000000 0.0000000000000000 0.0000000000000000 Si
0.2500000000000000 0.7500000000000000 0.7500000000000000 Si
0.5000000000000000 0.5000000000000000 0.0000000000000000 Si
0.2500000000000000 0.2500000000000000 0.2500000000000000 Si
0.5000000000000000 0.0000000000000000 0.5000000000000000 Si
38 changes: 38 additions & 0 deletions susyexists/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"pw": {
"control": {
"pseudo_dir": "./pseudos/"
},
"system": {
"degauss": "0.1",
"ecutwfc": "20",
"occupations": "smearing"
},
"electrons": {
"conv_thr": "1e-6"
},
"ions": {},
"cell": {},
"k_points": "1 1 1 0 0 0"
},
"ph": {
"inputph": {
"ldisp": "true",
"nq1": "1",
"nq2": "1",
"nq3": "1"
}
},
"q2r": {
"input": {
"zasr": "simple"
}
},
"matdyn": {
"input": {
"asr": "simple",
"q_in_band_form": "true",
"q_in_cryst_coord": "true"
}
}
}
Loading