Unverified Commit c2a2b7f6 authored by Jan Janssen's avatar Jan Janssen Committed by GitHub
Browse files

Merge pull request #63 from pyiron/cosmetic_changes

Cosmetic changes
parents 4307dfbe 68b95796
This source diff could not be displayed because it is too large. You can view the blob instead.
%% Cell type:markdown id:appointed-stylus tags:
%% Cell type:markdown id:previous-lotus tags:
# [**Workflows for atomistic simulations**](http://potentials.rub.de/)
%% Cell type:markdown id:straight-bicycle tags:
%% Cell type:markdown id:solid-explosion tags:
## **Day 1 - Atomistic simulations with [pyiron](https://pyiron.org)**
### **Exercise 2: Creating and working with structure databases**
Before the excercise, you should:
* Finish exercise 1
The aim of this exercise is to make you familiar with:
* Creating structure databases and working with them for potential fitting (day 2)
%% Cell type:markdown id:durable-leone tags:
%% Cell type:markdown id:apparent-assembly tags:
## **Importing necessary modules and creating a project**
This is done the same way as shown in the first exercise
%% Cell type:code id:novel-wisconsin tags:
%% Cell type:code id:fitting-testing tags:
``` python
import numpy as np
%matplotlib inline
import matplotlib.pylab as plt
```
%% Cell type:code id:sitting-religious tags:
%% Cell type:code id:mature-bearing tags:
``` python
from pyiron import Project
```
%% Cell type:code id:technical-newport tags:
%% Cell type:code id:considered-karma tags:
``` python
pr = Project("creating_datasets")
```
%% Cell type:markdown id:based-kentucky tags:
%% Cell type:markdown id:controlled-david tags:
## Creating a structure "container" from the data
We now go over the jobs generated in the first notebook to store structures, energies, and forces into a structure container which will later be used for potential fitting
**Note**: Usually these datasets are created using highly accurate DFT calculations. But for practical reasons, we only demonstrate how to do this using data from LAMMPS calculations (the workflow remain the same)
%% Cell type:code id:attached-germany tags:
%% Cell type:code id:wrong-pickup tags:
``` python
# Access the project created in exercise 1
pr_fs = pr["../first_steps"]
```
%% Cell type:code id:filled-natural tags:
%% Cell type:code id:current-vanilla tags:
``` python
# Create a TrainingContainer job (to store structures and databases)
container = pr.create.job.TrainingContainer('dataset_example')
```
%% Cell type:markdown id:married-storm tags:
%% Cell type:markdown id:dominican-northwest tags:
## **Add structures from the E-V curves**
For starters, we append structures from the energy volume curves we calculated earlier
%% Cell type:code id:mediterranean-upset tags:
%% Cell type:code id:concrete-background tags:
``` python
# Iterate over the jobs in this sub-project and append the final structure, potential energy, and forces
for job in pr_fs["E_V_curve"].iter_jobs(status="finished"):
container.include_job(job, iteration_step=-1)
```
%% Cell type:markdown id:acquired-missile tags:
%% Cell type:markdown id:worse-scheduling tags:
We can obtain this data as a `pandas` table
%% Cell type:code id:greatest-person tags:
%% Cell type:code id:changed-shame tags:
``` python
container.to_pandas()
```
%%%% Output: execute_result
name \
0 None
1 None
2 None
3 None
4 None
5 None
6 None
7 None
8 None
9 None
10 None
11 None
12 None
13 None
14 None
15 None
16 None
17 None
18 None
19 None
20 None
21 None
22 None
23 None
24 None
25 None
26 None
27 None
28 None
29 None
30 None
31 None
32 None
33 None
34 None
35 None
36 None
37 None
38 None
39 None
40 job_a_3_4
41 job_a_3_5
42 job_a_3_6
43 job_a_3_7
44 job_a_3_8
45 job_a_3_9
46 job_a_4_0
atoms \
0 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
1 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
2 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
3 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
4 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
5 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
6 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
7 (Atom('Cu', [0.0, 0.0, 0.0], index=0), Atom('Cu', [0.0, 1.8049999999995918, 1.804999999999592], index=1), Atom('Cu', [1.8049999999995918, 1.1052437362302365e-16, 1.804999999999592], index=2), Atom...
8 (Atom('Cu', [0.140426153531212, 11.00934611760493, 10.968207696001379], index=0), Atom('Cu', [10.983357200359302, 1.779939365335074, 1.7146804782560905], index=1), Atom('Cu', [2.1228644677344763, ...
9 (Atom('Cu', [0.1407579358923329, 11.020287239626356, 10.855878337455094], index=0), Atom('Cu', [0.29542104007972325, 1.6514729828183248, 1.7760939949715002], index=1), Atom('Cu', [1.99578258187561...
10 (Atom('Cu', [0.04675277832683521, 10.951786003502875, 0.20014601215416555], index=0), Atom('Cu', [0.08453269827616121, 1.807218974303731, 1.7664733621606055], index=1), Atom('Cu', [1.9597357123378...
11 (Atom('Cu', [10.991332780892245, 11.027168829788469, 0.17044757336885022], index=0), Atom('Cu', [10.869778028731718, 1.9053524080340238, 1.7569642307109068], index=1), Atom('Cu', [1.89027128290555...
12 (Atom('Cu', [10.958070767872973, 0.05270018288525903, 11.015795828313184], index=0), Atom('Cu', [0.04540970504125744, 2.0780519854689388, 1.8353871076994486], index=1), Atom('Cu', [1.8285627799497...
13 (Atom('Cu', [10.903697402270481, 10.843249424147054, 0.09574490333935876], index=0), Atom('Cu', [10.594918916668115, 1.7187193807013557, 1.957301113531466], index=1), Atom('Cu', [1.676074002401865...
14 (Atom('Cu', [0.25841198959969514, 0.07063449316617948, 10.912283030401635], index=0), Atom('Cu', [0.19649020014428978, 1.7891621064498946, 1.803181486480956], index=1), Atom('Cu', [1.7493171890008...
15 (Atom('Cu', [0.004994793789590358, 10.985055637636528, 10.904222762438215], index=0), Atom('Cu', [10.941729664004177, 1.8868614122932958, 1.8147512571785023], index=1), Atom('Cu', [1.8438031255437...
16 (Atom('Cu', [0.03645923830333788, 10.856010693932728, 10.970572990196315], index=0), Atom('Cu', [10.913522535008392, 1.8161914381204696, 1.5447581077411967], index=1), Atom('Cu', [1.77583933019795...
17 (Atom('Cu', [0.009767181825404037, 0.0071865231528328395, 11.0089023992238], index=0), Atom('Cu', [10.89374596605574, 1.9969194212313586, 1.595578837066423], index=1), Atom('Cu', [2.05442192913884...
18 (Atom('Cu', [0.0, 1.8049999999995918, 1.804999999999592], index=0), Atom('Cu', [1.8049999999995918, 1.1052437362302365e-16, 1.804999999999592], index=1), Atom('Cu', [1.8049999999995918, 1.80499999...
19 (Atom('Cu', [0.10390109091492504, 1.9580560553035629, 1.779188560767685], index=0), Atom('Cu', [1.3868099266682106, 10.93717630776342, 1.601790948781396], index=1), Atom('Cu', [1.7183987889409966,...
20 (Atom('Cu', [0.2223234793002756, 1.6999920633404135, 1.7623980235259114], index=0), Atom('Cu', [2.122882660879041, 0.18624238423025943, 2.030808683988878], index=1), Atom('Cu', [1.7334689484700414...
21 (Atom('Cu', [10.839434974930338, 1.9008464900018593, 1.6867963294684278], index=0), Atom('Cu', [1.5876598581358559, 0.15447557118789498, 1.715299994817798], index=1), Atom('Cu', [2.148606011735498...
22 (Atom('Cu', [10.827044041159013, 1.814885520198166, 2.1241909251750846], index=0), Atom('Cu', [1.6679142700199647, 0.1106240807045643, 1.629401459425781], index=1), Atom('Cu', [1.29418686613977, 2...
23 (Atom('Cu', [0.18579648605077317, 1.6025971043596021, 1.8725196193757527], index=0), Atom('Cu', [2.0480835165906024, 0.055238510607153124, 2.258841094259334], index=1), Atom('Cu', [1.8423446841272...
24 (Atom('Cu', [10.902653792490328, 1.9016481867720487, 1.712386801004505], index=0), Atom('Cu', [1.6843656295425262, 0.20454959542790652, 1.4940727709027473], index=1), Atom('Cu', [1.628967729295861...
25 (Atom('Cu', [0.2202511036922136, 1.5872348575607442, 1.7623998700282655], index=0), Atom('Cu', [1.8386689358546338, 10.988833155546024, 1.8571406735818983], index=1), Atom('Cu', [1.976390891645592...
26 (Atom('Cu', [10.746144724861097, 1.6561216261540705, 1.6676063346982197], index=0), Atom('Cu', [1.8697696006277247, 0.29566102043388925, 1.9071090181664805], index=1), Atom('Cu', [1.82013088394316...
27 (Atom('Cu', [0.17063059290766686, 1.8534187978406447, 1.7423748775395635], index=0), Atom('Cu', [1.8595651370150335, 10.90572322929213, 1.810598025463111], index=1), Atom('Cu', [1.934651223968069,...
28 (Atom('Cu', [10.866365842640102, 1.8491297818376022, 2.093244182315977], index=0), Atom('Cu', [1.7536272335648937, 10.898985481755824, 1.8241252890179567], index=1), Atom('Cu', [1.994555230114336,...
29 (Atom('Cu', [0.0, 1.4737763285740602, 9.024277317236803e-17], index=0), Atom('Cu', [2.5526554800834376, 1.4737763285740604, 2.4654784132287465e-16], index=1), Atom('Cu', [5.105310960166875, 1.4737...
30 (Atom('Cu', [0.4126496185424086, 0.9553642998076769, 0.12158924761653131], index=0), Atom('Cu', [2.831118842513476, 1.0700158216349893, 25.916922304272767], index=1), Atom('Cu', [5.314789299948389...
31 (Atom('Cu', [10.151562776611806, 1.6587733567107183, 26.43035938894712], index=0), Atom('Cu', [2.5212828819853748, 1.9070842851152785, 26.36203940098048], index=1), Atom('Cu', [4.715098279443367, ...
32 (Atom('Cu', [0.19573901040697333, 1.051460534941847, 26.530022925039237], index=0), Atom('Cu', [2.995726956631421, 1.1546751485293076, 26.840478692293868], index=1), Atom('Cu', [5.923947432763936,...
33 (Atom('Cu', [9.888379625890167, 1.4968159202602271, 26.58551059472236], index=0), Atom('Cu', [2.207544057015841, 1.290074245861123, 26.685466830386254], index=1), Atom('Cu', [4.939145903748478, 1....
34 (Atom('Cu', [0.3429326290376805, 1.5170285327525175, 0.14896315086845416], index=0), Atom('Cu', [3.129345868860857, 1.495102964861245, 0.01607848650845961], index=1), Atom('Cu', [5.714332108258016...
35 (Atom('Cu', [9.95801241508363, 1.4359511579313753, 26.639342243648862], index=0), Atom('Cu', [2.2681416259098204, 1.7861270127574713, 0.0041936446239185], index=1), Atom('Cu', [5.074253116948648, ...
36 (Atom('Cu', [10.225027496779227, 1.7848555655274232, 26.42388292769549], index=0), Atom('Cu', [2.4914869938632442, 1.861119175102061, 26.64826771541495], index=1), Atom('Cu', [4.968442272624181, 1...
37 (Atom('Cu', [10.188116701703345, 1.3482529143763475, 26.353847647582224], index=0), Atom('Cu', [2.4559442807081986, 1.4757747059762696, 26.57379282025388], index=1), Atom('Cu', [5.077086561123585,...
38 (Atom('Cu', [10.165259029706933, 1.7122531598094173, 26.335638965295193], index=0), Atom('Cu', [2.3513330869200098, 1.5487334168655387, 26.34258116233103], index=1), Atom('Cu', [4.95573138146394, ...
39 (Atom('Cu', [0.36893784059756035, 1.481831927531004, 26.53504700964859], index=0), Atom('Cu', [2.6965712181950883, 1.488812429574298, 26.730123522873537], index=1), Atom('Cu', [5.668661292604278, ...
40 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
41 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
42 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
43 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
44 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
45 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
46 (Atom('Cu', [0.0, 0.0, 0.0], index=0))
energy \
0 -3.142019
1 -3.338596
2 -3.416929
3 -3.409602
4 -3.330215
5 -3.195118
6 -3.035358
7 -347.182406
8 -348.253665
9 -345.424528
10 -346.758349
11 -344.603627
12 -346.849801
13 -345.015235
14 -346.569097
15 -344.892954
16 -347.628843
17 -345.776979
18 -342.906251
19 -343.569002
20 -343.317892
21 -341.057270
22 -342.067006
23 -342.528496
24 -342.900954
25 -340.983380
26 -342.479965
27 -340.174298
28 -343.805462
29 -400.111422
30 -399.591699
31 -398.422617
32 -395.110340
33 -396.833326
34 -400.444368
35 -397.843043
36 -399.776798
37 -399.168074
38 -396.984690
39 -399.581912
40 -3.142019
41 -3.338596
42 -3.416929
43 -3.409602
44 -3.330215
45 -3.195118
46 -3.035358
forces \
0 [[1.1869253621046177e-16, -1.7429070520896771e-16, -1.397277865277868e-16]]
1 [[-1.92404082484227e-16, 4.231084758750405e-17, 3.6193775346684653e-17]]
2 [[-2.9113397169423695e-17, 7.54965057835309e-17, -3.624419431643654e-17]]
3 [[3.771496125435321e-17, 3.412312546579927e-17, -2.4310047599025677e-17]]
4 [[-2.0545362501508919e-16, -3.5486130576273854e-17, 3.5486130576273854e-17]]
5 [[1.6101257219667079e-16, -4.2948421129906387e-17, 4.2948421129906387e-17]]
6 [[-5.946777565406637e-17, -1.0605082175909553e-16, -1.2946304704347008e-16]]
7 [[-1.2656542480726799e-14, -1.46965772884755e-14, -1.61017033040167e-14], [-1.3905543383430098e-14, 4.5310977192514186e-15, 4.8333732849403796e-15], [4.9682480351975795e-15, -1.4072076837123899e-1...
8 [[-0.21910202935187897, -0.37573419410584397, 0.43392575377979187], [0.16208168404695897, -0.00671505675904709, 1.03458554920361], [-1.2001630139266497, -0.40207322348963503, -0.45620473735655703]...
9 [[-0.023031834879881696, 0.042841438691562095, 0.5899774836434479], [-0.5418151518759569, 0.6754733604036028, -0.5582999589284809], [-0.6011411771360858, -0.355590065329821, -0.0035901986306415582...
10 [[-0.32237334386615796, 0.43406651671724894, -0.5886238546572939], [-0.6295919499998729, 0.07530471384300086, -0.12687342568230403], [-0.06506588733991228, 0.8782024477953109, -0.12243680387297393...
11 [[0.45078377546738896, -0.7167806257867769, -0.320969733282763], [0.5707773027838049, -0.5494069530705199, 0.510256621543289], [-0.36439749359274193, 0.17709586752044496, 0.23127352998569298], [0....
12 [[-0.38409855462219894, 0.12077975249818296, 0.024465771201292483], [-0.6560764999451358, -1.05845756801878, -0.658182913095082], [-0.5103420261962529, -0.35656271154938, 0.7090309519821769], [-0....
13 [[0.22044015995668098, -0.2607278388818459, -0.3855032322190499], [0.7754186544660099, -0.04652340102386694, -0.26232164996063695], [0.43147792874898694, -0.9840256256911009, 0.34987911571105595],...
14 [[-0.5020206209676749, 0.007307596544171969, 0.24586848661916993], [-1.1645196400331899, 0.1476285180684419, 0.6168850904586589], [0.7183114431792579, -0.5420093171036479, -0.06687387962480258], [...
15 [[0.04806202889719739, 0.48969724353819394, 1.29371057615331], [0.5538169933185199, -0.7855310261714289, -0.033081946412792815], [0.34832740609982993, 0.9937361742308158, 0.30650548838004904], [-0...
16 [[0.24033044872062098, 1.5305792677179897, -0.6791236163119347], [0.05903491332573559, 0.148151392595253, 0.542468964409148], [0.07921843405670739, 0.145966157214324, 0.7342269238916159], [0.77503...
17 [[-0.13926025211222698, -0.0920021629424733, 0.21001691285267599], [0.6767944835284789, -1.1148612203782198, 1.7165284718417098], [-0.7950973845960859, 0.2356681337270629, 0.13328556064538893], [0...
18 [[-1.3933298959045699e-14, -0.10827842091784899, -0.108278420917849], [-0.10827842091784899, -1.3877479054990188e-14, -0.108278420917849], [-0.10827842091784899, -0.108278420917849, -1.38424758326...
19 [[-0.45079778130218695, 0.19236747741170795, 0.23614131969524693], [1.2984317307784499, 0.04751568933291938, 0.005443425577977482], [0.48875760189522893, -0.5765163470127929, -0.5531364786691719],...
20 [[-0.6920262907044069, 0.3986975029533409, 0.10738641941643497], [-1.2097205794553298, -2.21423543020926, -0.8363385508172672], [-0.36839592956658596, 0.35919893904268096, 0.09738195090664269], [2...
21 [[0.5607305368018309, 0.07454461225822963, 0.17092757180402804], [0.7460358156721709, -0.9693709228665989, -0.357775642488428], [-1.4982109077380097, 1.0695224870660298, 0.17016025464137993], [1.1...
22 [[0.7768634672312369, 0.615614277472231, -0.6520778674544528], [0.5196497874591819, -0.7614150189249069, 0.33452284258026094], [1.0185593798470798, 0.11349094338622906, -1.1138567887728799], [0.39...
23 [[-1.2511641505681497, 0.045660252990561916, 0.39426999337691987], [-0.4923847861277789, -0.676187288680257, -1.3802167704923], [-0.12072100498159098, 0.5666924914439229, -0.8825937576849239], [0....
24 [[0.5080309295986539, -0.4875222169174689, 0.46898176405272696], [0.11031309252296198, -0.7243436014688799, 1.2808414836059598], [0.6855285827079979, 0.576817447055947, 0.31599931473888204], [0.50...
25 [[-0.6923371397061229, 0.9615117892959398, 0.396261839433264], [0.18083100499512797, -0.47103552335731996, 0.5072798013711759], [-0.22735248831930896, 0.37011177620569996, -1.1740345740817597], [0...
26 [[0.46940172398488794, 0.557542533896084, 0.861383405261689], [-0.16043498489103097, -1.0997839627759998, -0.013974118313924476], [-0.13554483762266598, 0.6363641149062679, 0.153788969879775], [1....
27 [[-1.1653987834207897, -0.07515193371140247, -0.13414295102360305], [0.17707911646472896, 0.37588362216028093, 0.10312993516925903], [0.6003632691780849, 0.3869695806628, 0.03431754153949555], [-0...
28 [[0.42819147658911194, -1.3404675072584398, -0.840042992949223], [0.47822853532413195, -0.07949121681390955, -0.36737406099153697], [-0.9172012989939929, 0.3239785862266829, -0.013009375610539234]...
29 [[-8.770761894538741e-15, 1.15657750043852e-09, 0.109956784695642], [-1.0824674490095302e-15, 1.15657515335765e-09, 0.10995678469564], [2.4308896909297503e-15, 1.1565748914144101e-09, 0.1099567846...
30 [[-0.570999988178131, 1.09833300989089, -0.566585257198732], [-0.0492000252908114, 0.597416506778632, 0.966635869516025], [-0.0024866801464792, -0.0674126479000064, 0.2546322145358], [0.2289085885...
31 [[-0.555658749547497, 0.42566314828364993, 0.466167261187443], [-1.39449792316952, -0.5017985009363372, 0.4456531170887249], [1.25410857633035, -0.33111996310077596, -0.24658722383829995], [0.3911...
32 [[0.550884754551829, 0.33865983742272204, 0.12042096866985205], [0.189727589275692, -0.524367356684999, -0.17886090450862402], [-1.6758650723099, -0.31030261483377614, 0.6946509585213989], [0.4453...
33 [[0.235449441284142, 0.601163461325591, 0.04737458109310825], [0.337344266123105, 0.66485729403382, 0.37768738132523805], [-0.171831038530166, -0.11286098093109101, -0.07415135874528352], [-0.1966...
34 [[1.15453322332565, 0.04603660924771737, -1.21282260887155], [-0.403390913673288, -0.18969536874868004, 0.030526533198225264], [-0.683024325114862, -0.967333273082708, 0.4114320467737619], [-0.867...
35 [[0.742004122721361, 0.22577315893502206, 0.12298868177971806], [0.771069504028052, -0.90014541931557, -0.660403448738781], [-0.462456173466872, 1.24796716628589, -0.4192010350460109], [0.08219110...
36 [[0.552749731038993, -0.46087407707755496, 0.177277816519943], [0.340079509783844, 0.23574679643440802, 0.26784307872713603], [0.388298578408562, 0.331969932822417, 0.34399524632239104], [-0.59826...
37 [[0.570532228156976, 0.17193739345012202, 0.796311675035985], [0.67297011060888, -0.81773224395498, 0.207420342553107], [0.391385096561351, -0.862073619446019, 0.597813478897486], [-0.270452726779...
38 [[-1.11093024791963, -0.6986058376048401, 0.44674121624886787], [0.0416051560041239, -0.0424634970331458, -0.0874515615419252], [-0.135122617155289, -0.778975629913174, -1.04402814519501], [0.8442...
39 [[-0.645092069902244, 0.04920122139904896, 0.21081031345366397], [1.14893686034324, -0.6114894792387109, -0.40665475671972495], [-0.287092609914331, 0.292443458702414, -0.801010316546939], [-0.184...
40 [[1.1869253621046177e-16, -1.7429070520896771e-16, -1.397277865277868e-16]]
41 [[-1.92404082484227e-16, 4.231084758750405e-17, 3.6193775346684653e-17]]
42 [[-2.9113397169423695e-17, 7.54965057835309e-17, -3.624419431643654e-17]]
43 [[3.771496125435321e-17, 3.412312546579927e-17, -2.4310047599025677e-17]]
44 [[-2.0545362501508919e-16, -3.5486130576273854e-17, 3.5486130576273854e-17]]
45 [[1.6101257219667079e-16, -4.2948421129906387e-17, 4.2948421129906387e-17]]
46 [[-5.946777565406637e-17, -1.0605082175909553e-16, -1.2946304704347008e-16]]
number_of_atoms
0 1.0
1 1.0
2 1.0
3 1.0
4 1.0
5 1.0
6 1.0
7 108.0
8 108.0
9 108.0
10 108.0
11 108.0
12 108.0
13 108.0
14 108.0
15 108.0
16 108.0
17 108.0
18 107.0
19 107.0
20 107.0
21 107.0
22 107.0
23 107.0
24 107.0
25 107.0
26 107.0
27 107.0
28 107.0
29 128.0
30 128.0
31 128.0
32 128.0
33 128.0
34 128.0
35 128.0
36 128.0
37 128.0
38 128.0
39 128.0
40 1.0
41 1.0
42 1.0
43 1.0
44 1.0
45 1.0
46 1.0
name atoms energy \
0 job_a_3_4 (Atom('Cu', [0.0, 0.0, 0.0], index=0)) -3.142019
1 job_a_3_5 (Atom('Cu', [0.0, 0.0, 0.0], index=0)) -3.338596
2 job_a_3_6 (Atom('Cu', [0.0, 0.0, 0.0], index=0)) -3.416929
3 job_a_3_7 (Atom('Cu', [0.0, 0.0, 0.0], index=0)) -3.409602
4 job_a_3_8 (Atom('Cu', [0.0, 0.0, 0.0], index=0)) -3.330215
5 job_a_3_9 (Atom('Cu', [0.0, 0.0, 0.0], index=0)) -3.195118
6 job_a_4_0 (Atom('Cu', [0.0, 0.0, 0.0], index=0)) -3.035358
forces \
0 [[1.1869253621046177e-16, -1.7429070520896771e-16, -1.397277865277868e-16]]
1 [[-1.92404082484227e-16, 4.231084758750405e-17, 3.6193775346684653e-17]]
2 [[-2.9113397169423695e-17, 7.54965057835309e-17, -3.624419431643654e-17]]
3 [[3.771496125435321e-17, 3.412312546579927e-17, -2.4310047599025677e-17]]
4 [[-2.0545362501508919e-16, -3.5486130576273854e-17, 3.5486130576273854e-17]]
5 [[1.6101257219667079e-16, -4.2948421129906387e-17, 4.2948421129906387e-17]]
6 [[-5.946777565406637e-17, -1.0605082175909553e-16, -1.2946304704347008e-16]]
number_of_atoms
0 1.0
1 1.0
2 1.0
3 1.0
4 1.0
5 1.0
6 1.0
%% Cell type:markdown id:imperial-belarus tags:
%% Cell type:markdown id:ultimate-duncan tags:
## **Add structures from the MD**
We also add some structures obtained from the MD simulations
%% Cell type:code id:healthy-structure tags:
%% Cell type:code id:disabled-computer tags:
``` python
# Reloading the MD job
job_md = pr_fs["lammps_job"]
```
%% Cell type:code id:outside-bhutan tags:
%% Cell type:code id:aggregate-wilderness tags:
``` python
# Iterate over the MD-trajectory to append structures
traj_length = len(job_md["output/generic/positions"])
stride = 10 # append structures every 10 steps
for i in range(0, traj_length, stride):
container.include_job(job_md, iteration_step=i)
```
%% Cell type:markdown id:minus-blink tags:
%% Cell type:markdown id:welsh-commercial tags:
## **Add some defect structures (vacancies, surfaces, etc)**
It's necessary to also include some defect structures, and surfaces to the training dataset
%% Cell type:code id:loaded-sheriff tags:
%% Cell type:code id:continuing-upset tags:
``` python
# Setup a MD calculation for a structure with a vacancy
job_lammps = pr.create.job.Lammps("lammps_job_vac")
job_lammps.structure = pr.create_ase_bulk('Cu', cubic=True, a=3.61).repeat([3, 3, 3])
del job_lammps.structure[0]
job_lammps.potential = '2012--Mendelev-M-I--Cu--LAMMPS--ipr1'
job_lammps.calc_md(temperature=800, pressure=0, n_ionic_steps=10000)
job_lammps.run()
```
%%%% Output: stream
2021-03-08 11:55:40,043 - pyiron_log - WARNING - The job lammps_job_vac is being loaded instead of running. To re-run use the argument 'delete_existing_job=True in create_job'
The job lammps_job_vac was saved and received the ID: 303
%% Cell type:code id:billion-shade tags:
%% Cell type:code id:listed-occurrence tags:
``` python
# Setup a MD calculation for a surface structure
job_lammps = pr.create.job.Lammps("lammps_job_surf")
job_lammps.structure = pr.create_surface("Cu", surface_type="fcc111", size=(4, 4, 8), vacuum=12, orthogonal=True)
job_lammps.potential = '2012--Mendelev-M-I--Cu--LAMMPS--ipr1'
job_lammps.calc_md(temperature=800, pressure=0, n_ionic_steps=10000)
job_lammps.run()
```
%%%% Output: stream
2021-03-08 11:56:36,874 - pyiron_log - WARNING - The job lammps_job_surf is being loaded instead of running. To re-run use the argument 'delete_existing_job=True in create_job'
The job lammps_job_surf was saved and received the ID: 304
%% Cell type:code id:constitutional-throw tags:
%% Cell type:code id:sound-bathroom tags:
``` python
pr
```
%%%% Output: execute_result
{'groups': ['tc'], 'nodes': ['lammps_job_vac', 'lammps_job_surf', 'dataset_example']}
{'groups': [], 'nodes': ['lammps_job_vac', 'lammps_job_surf']}
%% Cell type:markdown id:alpine-cooking tags:
%% Cell type:markdown id:processed-liability tags:
We now add these structures to the dataset
%% Cell type:code id:italian-cleanup tags:
%% Cell type:code id:trained-target tags:
``` python
for job_name in ["lammps_job_vac", "lammps_job_surf"]:
job_md = pr.load(job_name)
for job_md in pr.iter_jobs(status="finished"):
pos = job_md["output/generic/positions"]
traj_length = len(pos)
stride = 10
for i in range(0, traj_length, stride):
container.include_job(job_md, iteration_step=i)
if pos is not None:
traj_length = len(pos)
stride = 10
for i in range(0, traj_length, stride):
container.include_job(job_md, iteration_step=i)
```
%% Cell type:code id:exotic-asset tags:
%% Cell type:code id:attended-drama tags:
``` python
# We run the job sto store this dataset in the pyiron database
container.run()
```
%%%% Output: stream
2021-03-08 11:59:00,874 - pyiron_log - WARNING - The job dataset_example is being loaded instead of running. To re-run use the argument 'delete_existing_job=True in create_job'
The job dataset_example was saved and received the ID: 306
%%%% Output: stream
/opt/conda/lib/python3.8/site-packages/pandas/core/generic.py:2606: PerformanceWarning:
your performance may suffer as PyTables will pickle object types that it cannot
map directly to c-types [inferred_type->mixed,key->block1_values] [items->Index(['name', 'atoms', 'forces'], dtype='object')]
pytables.to_hdf(
%% Cell type:code id:british-kelly tags:
%% Cell type:code id:signal-establishment tags:
``` python
pr.job_table()
```
%%%% Output: execute_result
id status chemicalformula job subjob \
0 4332 finished Cu107 lammps_job_vac /lammps_job_vac
1 4333 finished Cu128 lammps_job_surf /lammps_job_surf
2 4334 finished None dataset_example /dataset_example
projectpath project \
0 /home/surendralal/ notebooks/pyiron_potentialfit/day_1/creating_datasets/
1 /home/surendralal/ notebooks/pyiron_potentialfit/day_1/creating_datasets/
2 /home/surendralal/ notebooks/pyiron_potentialfit/day_1/creating_datasets/
timestart timestop totalcputime \
0 2021-03-04 15:54:10.622737 2021-03-04 15:54:15.859551 5.0
1 2021-03-04 15:54:16.720902 2021-03-04 15:54:21.579389 4.0
2 2021-03-04 15:54:23.919785 NaT NaN
computer hamilton hamversion parentid masterid
0 pyiron@cmdell17#1 Lammps 0.1 None None
1 pyiron@cmdell17#1 Lammps 0.1 None None
2 pyiron@cmdell17#1 TrainingContainer 0.4 None None
id status chemicalformula job subjob \
0 303 finished Cu107 lammps_job_vac /lammps_job_vac
1 304 finished Cu128 lammps_job_surf /lammps_job_surf
2 306 finished None dataset_example /dataset_example
projectpath project timestart \
0 /home/pyiron/ day_1/creating_datasets/ 2021-03-09 09:38:28.337496
1 /home/pyiron/ day_1/creating_datasets/ 2021-03-09 09:38:34.181033
2 /home/pyiron/ day_1/creating_datasets/ 2021-03-09 09:38:48.660175
timestop totalcputime computer \
0 2021-03-09 09:38:33.222851 4.0 pyiron@jupyter-sudarsan#1
1 2021-03-09 09:38:39.609826 5.0 pyiron@jupyter-sudarsan#1
2 NaT NaN pyiron@jupyter-sudarsan#1
hamilton hamversion parentid masterid
0 Lammps 0.1 None None
1 Lammps 0.1 None None
2 TrainingContainer 0.4 None None
%% Cell type:markdown id:ideal-volunteer tags:
%% Cell type:markdown id:lyric-blair tags:
## **Reloading the dataset**
This dataset can ow be reloaded anywhere to use in the potential fitting procedures
%% Cell type:code id:numeric-museum tags:
%% Cell type:code id:swiss-catering tags:
``` python
dataset = pr["dataset_example"]
dataset.to_pandas()
```
%%%% Output: execute_result
name \
0 None
1 None
2 None
3 None
4 None
5 None
6 None
7 None
8 None
9 None
10 None
11 None
12 None
13 None
14 None
15 None
16 None
17 None
18 None
19 None
20 None
21 None
22 None
23 None
24 None
25 None
26 None
27 None
28 None
29 None
30 None
31 None
32 None
33 None
34 None
35 None
36 None
37 None
38 None
39 None