Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Changed scripts to run in Python 3 #2

Open
wants to merge 5 commits into
base: master
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Python stuff
__pycache__
*.egg-info/
*.pyc
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ The remaining options determine the sensitivity of the construction and are hype

Once you have generated the folder "wdir", check inside and find the shaketraj.xyz, you will need that to compute
the last element needed to run the gch with : shaketraj.ker .
Use your kernel calculator to produce a kernel matrix of similarity between the nshaken*nref rattled structures and your
set structures, it will have (nshaken*nref) * N entries.
Use your kernel calculator to produce a kernel matrix of similarity between the (nshaken + 1) *nref rattled structures and your
set structures, it will have ((nshaken + 1)*nref) * N entries.

Pass only the wdir and the freshly calculated shaketraj.ker to the gch_run.py to start the gch sampling.
The outputs "vprobprune.dat" and "vlist.dat" will be stored in wdir, and will contain respectively :
Expand Down
46 changes: 46 additions & 0 deletions folder_of_examples/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
In this examples folder, you should find :

1) A set of example structures as a zip file containing the individual structure res files: 'example_set.zip'
2) An extended xyz file containing all the example structures: 'example_set.xyz'
3) A file containing an example NxN SOAP kernel matrix for the example set: 'example_kernel.ker'
4) A file containing an ordered list of all the enegies per atom for each structure in the example set (in meV): 'example_energies.txt'
5) A further folder containing example output files from the script 'gch_init.py' along with an explanation file: 'example_outputs'
6) A file containing an example ((Nshaken + 1)* Nref) x N SOAP kernel matrix comparing the example shaken structures to the original example set: 'example_shaken_kernel.ker'
7) A Python script 'kernel_generation.py' designed to show how the original kernel, structure sets, and energy files were generated. This is not a finalised generalisable script but is set up so if run, it will generate a set of test
files like those in this examples folder
8) A Python script 'shaken_kernel_generation.py' designed to show how the shaken kernel file was generated. Like 7, This is not a finalised generalisable script but is set up so if run, it will generate a test shaken kernel like that in this example folder


USING THE EXAMPLE FILES
---------------------------------------------------------------------

Running gch_init.py : Files 2-4 are required when running gch_init.py

Running gch_run.py : File 6 is needed to run gch_run.py

Starting in a directory containing atleast the files 'gch_init.py', 'gch_run.py', 'gch_utils.py', and 'lib_gch.py' and using a Python environment set up as outlined on the GCH github:



Copy files 2-4 and file 6 into your starting directory and run the command:

python3 gch_init.py example_kernel.ker -ixyz example_set.xyz -nrg example_energies.txt --nshake 10 --nref 10 -wdir [output folder name]

([output folder name] is the name you wish to give to your output folder. This can be whatever you choose, but must not already be an existing sub-directory.)


When this has finished, go to the output folder to check that it is generating the expected files - it should have the appearance of 5)

Return to your starting directory and run the command: python gch_run.py example_shaken_kernel.ker -wdir [output folder name]
([output folder name] must be the same as before)

When this has run, enter the output folder and read 'vlist.idx' this should give a list of the indices of structures selected as GCH vertices


NOTE
--------------------------------------------------------------------

Running gch_init.py using these examples will generate its own set of outputs. Due to the different random selection and rattling of reference structures,
these examples will differ from the example outputs contained here. As such, running the two scripts with the example files as outlined here is not a test of
a single run of the process from start to finish, but rather individual tests of the two scripts.

200 changes: 200 additions & 0 deletions folder_of_examples/example_energies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
-6.847304461109503393e+01
-6.739511899884861634e+01
-6.470248595478727793e+01
-6.423908029673191322e+01
-6.410735734639929717e+01
-6.371983274530602159e+01
-6.319488439734115559e+01
-6.291407697994357306e+01
-6.256179366654583873e+01
-6.246842152929367131e+01
-6.236261129050191698e+01
-6.222605130068167512e+01
-6.219474010756983517e+01
-6.218878018391544060e+01
-6.216589062205436278e+01
-6.212032743759505138e+01
-6.210892584451708132e+01
-6.202777586954167077e+01
-6.198640190678146666e+01
-6.191924479603812870e+01
-6.184699151869174472e+01
-6.163368671485805805e+01
-6.156527715639023768e+01
-6.147147314061239598e+01
-6.134342115774807525e+01
-6.128049645655639210e+01
-6.126861979710017181e+01
-6.113961768147935771e+01
-6.088891219732172289e+01
-6.087789929491685825e+01
-6.086312904933858903e+01
-6.084131918379171111e+01
-6.077757391340123405e+01
-6.071896799746637186e+01
-6.067426857005842322e+01
-6.066394667329465307e+01
-6.057700952607513756e+01
-6.047003321526402431e+01
-6.039220870493636539e+01
-6.032233075948123258e+01
-6.030255072300506214e+01
-6.027123952989321509e+01
-6.021582951504837666e+01
-6.012997206414306817e+01
-6.011597919991100269e+01
-6.001193966307453564e+01
-6.000770725352285950e+01
-5.999237556586119524e+01
-5.991912896790575616e+01
-5.982601595776900183e+01
-5.965671957570217643e+01
-5.965589900650337540e+01
-5.965348048675956250e+01
-5.961202014829420648e+01
-5.959280155390142397e+01
-5.956719115732856551e+01
-5.954538129178168759e+01
-5.951165157892603474e+01
-5.950379138975863214e+01
-5.950024998584805758e+01
-5.949610395200152624e+01
-5.948154964568607994e+01
-5.945447086212590904e+01
-5.944773355712528939e+01
-5.939504437699223871e+01
-5.932840552047970561e+01
-5.929895140502828355e+01
-5.924876712034419057e+01
-5.921970169556588104e+01
-5.917526139527334550e+01
-5.914913274446965374e+01
-5.911618041296022596e+01
-5.911315726328046338e+01
-5.910451969276684991e+01
-5.910119422811910539e+01
-5.906876015084048959e+01
-5.903757852128634198e+01
-5.900859947221316304e+01
-5.900466937762947595e+01
-5.897858391467836725e+01
-5.893038627121239159e+01
-5.889708843688241302e+01
-5.882284851831791173e+01
-5.879037125318672707e+01
-5.878410901456434345e+01
-5.878389307530151342e+01
-5.871185573721797368e+01
-5.871163979795512233e+01
-5.868326537881791438e+01
-5.867972397490733272e+01
-5.866663805557920597e+01
-5.866508329288675583e+01
-5.866244883388010578e+01
-5.864569194708369793e+01
-5.850986615075711228e+01
-5.850744763101330648e+01
-5.847047882921503970e+01
-5.846711017671473343e+01
-5.841144103475448190e+01
-5.834864589712051242e+01
-5.830576035952041991e+01
-5.826654578938862272e+01
-5.823329114291120590e+01
-5.821398617281327148e+01
-5.819865448515162143e+01
-5.817537623261743818e+01
-5.813620485033818852e+01
-5.813093593232488132e+01
-5.811296978565657412e+01
-5.809046891446860172e+01
-5.807578504459546309e+01
-5.806127392613258564e+01
-5.795533412378311766e+01
-5.793810217060845957e+01
-5.793749754067250990e+01
-5.792078384172866379e+01
-5.787379545813460169e+01
-5.784619842034361881e+01
-5.784278657999072948e+01
-5.784226832575992461e+01
-5.783924517608015492e+01
-5.782689345024568439e+01
-5.778305777988909853e+01
-5.772380404616571070e+01
-5.770022347866354551e+01
-5.768597148731607405e+01
-5.767396526430216142e+01
-5.764692966859455225e+01
-5.764511577878669613e+01
-5.764317232542112635e+01
-5.760542614227662739e+01
-5.759985490929534535e+01
-5.757843373442158708e+01
-5.754409939162997745e+01
-5.752198721111513180e+01
-5.750782159547279804e+01
-5.750069559979906586e+01
-5.749922721281174631e+01
-5.742390759793304511e+01
-5.741414714325265578e+01
-5.740602782696986139e+01
-5.734068460603437245e+01
-5.733714320212379789e+01
-5.731399451314730698e+01
-5.730630707539019397e+01
-5.730030396388323055e+01
-5.726886320721366985e+01
-5.726786988660460764e+01
-5.726078707878344431e+01
-5.722040643663230242e+01
-5.720619763313741402e+01
-5.720269941707939410e+01
-5.716637843306966005e+01
-5.715242875669017053e+01
-5.712362245902725988e+01
-5.711770572322544126e+01
-5.710099202428159515e+01
-5.709701874184533210e+01
-5.696309321103175449e+01
-5.695773791731331670e+01
-5.692046680054707508e+01
-5.688444813150530166e+01
-5.687481724038261888e+01
-5.679876343201026145e+01
-5.677276434476428335e+01
-5.675458225883312480e+01
-5.671817489911823884e+01
-5.671195584834844539e+01
-5.668647501533327215e+01
-5.663646348205945458e+01
-5.661024845555064644e+01
-5.660618879740925280e+01
-5.659418257439531885e+01
-5.652996223762659866e+01
-5.652702546365198089e+01
-5.652331130833112383e+01
-5.649381400502713291e+01
-5.645062615245905846e+01
-5.644164307912490131e+01
-5.636930342607337963e+01
-5.633885599001290245e+01
-5.633255056353796419e+01
-5.626051322545441735e+01
-5.625982221981332998e+01
-5.624872294170333475e+01
-5.622069402538666338e+01
-5.620708985182771755e+01
-5.620518958631473083e+01
-5.620208006092981634e+01
-5.618549592554369099e+01
-5.617642647650439613e+01
-5.617461258669654001e+01
-5.616502488342643318e+01
-5.611121281912660663e+01
-5.610309350284381225e+01
-5.609765183342024386e+01
-5.608625024034226669e+01
-5.608365896918818549e+01
-5.607135043120628382e+01
-5.603572045283762293e+01
Loading