prisms-center / CASMcode

First-principles statistical mechanical software for the study of multi-component crystalline solids
Other
105 stars 69 forks source link

Error while importing DFT data #320

Open darjaved opened 11 months ago

darjaved commented 11 months ago

Hii, i am using CASM version 1.2.0, i have i have done my DFT calculations (Not within the CASM). now i am trying to import the DFT data, i am facing problem for few compositions. although all my configurations are of the type SCEL8XXXXXX, but for structures (at some compositions ) its trying to copy the data to type SCEL4 , SCEL2 etc. and it gives the error as: Copy calculation files: SCEL4_2_2_1_1_1_1/2 -- ERROR: boost::filesystem::directory_iterator::construct: No such file or directory: "prim:/Users/dar/Desktop/Na_Sn_data/casm_0.625/I21"

note: my supercells are of the size 222 only

xivh commented 11 months ago

Are you using the settings flag to copy your DFT relaxation data itself (not just the properties) into the CASM project? If so, I am not sure if that is working right now but I can take a look at it if you want to use it.

As for why it is making that "prim:" entry and the smaller cells, that is because when you have a supercell which CASM can map into an equivalent primitive cell, CASM will make the primitive one as well. There is a flag "primitive_only" which will make only the primitive cells and not the volume 8 ones, but I don't think that you can keep only the non-primitive ones unless you delete them yourself.

darjaved commented 11 months ago

settings.json is as:

{ "data" : {

"copy_additional_files" : true,
"copy_structure_files" : true,
"import_properties" : true,
"overwrite" : true

}, "mapping" : { "cost_tol" : 0.000010000000, "fix_lattice" : false, "fix_volume" : false, "ideal" : false, "k_best" : 1, "lattice_weight" : 0.500000000000, "max_va_frac" : 0.500000000000, "max_vol_change" : 0.300000000000, "min_va_frac" : 0.000000000000, "primitive_only" : false, "robust" : false, "strict" : false } }

i don't have the data for cells other than type SCEL8.

when i try to import by using casm import --batch filename, its showing the structures have been imported successfully, but there is no configuration in training data. only the reports folders contains the information about the mappings

darjaved commented 11 months ago

i tried this fix, its giving the same error. i just want to not to include the reduced cells of the supercell.

xivh commented 11 months ago

CASM always makes primitive cells, but if you import with just these settings:

{{"data":{"import_properties":true}, "mapping":{"primitive_only":false}}

then find the non-primitive cells

casm query -k is_primitive

and compare with the import report, you should be able to turn off or delete the primitive ones that were created. If you know that you only have volume 8, you can also try filtering by size

casm select -c ALL --set 'eq(scel_size,8)'

You said that you successfully imported but don't see configurations in training data. If you query, do you have data?

casm query -c ALL -k energy

If so (there are configs and energy is not unknown), then the import was successful, and only the data copying part failed. You can regenerate the POSCARs in training data with

casm select -c ALL --set selected
casm query --write-pos

Could you upload a copy of your CASM project (.casm folder) and one of the properties.calc.json that failed? Then I can see what is happening with the data copying.

darjaved commented 11 months ago

when i did casm query -c ALL -k energy, i got this

SCEL4_2_2_1_1_0_0/0 1 unknown SCEL4_2_2_1_1_1_1/0 1 unknown SCEL4_2_2_1_1_1_1/1 1 unknown SCEL4_2_2_1_1_1_1/2 1 unknown SCEL8_2_2_2_0_0_0/0 1 -4.79335147 SCEL8_2_2_2_0_0_0/1 1 -4.77122088 SCEL8_2_2_2_0_0_0/2 1 -4.71120409 SCEL8_2_2_2_0_1_1/0 1 -4.79308124 SCEL8_2_2_2_0_1_1/1 1 -4.78762422 SCEL8_2_2_2_0_1_1/2 1 -4.78308916 SCEL8_2_2_2_0_1_1/3 1 -4.84719499

i can easily remove the SCEL4 ones, and i can write the POS. for the training purpose we need to have the properties.calc.json also in the training data folders? moreover i could generate the casm_learn_input file. so, it seems there is no need to have the properties.calc.json file in the training data folders?. i only wrote the structures i.e POS for the corresponding configurations and are in the training data folders. energies information is in the reports folder. proj1.zip

xivh commented 11 months ago

I don't think you need properties.calc.json for casm learn as long as the data is in the database. All the data is in .casm/jsonDB/calctype.default/config_props.json. You can see it by casm query -k properties e.g.

 {
    "properties" : {
      "global" : {
        "Ustrain" : [
          [ 1.022161507617 ],
          [ 0.967256650217 ],
          [ 1.091360342534 ],
          [ 0.089268381784 ],
          [ -0.002597476018 ],
          [ 0.067785098974 ]
        ],
        "atomic_deformation_cost" : [
          [ 0.318849915720 ]
        ],
        "energy" : [
          [ -38.316375460000 ]
        ],
        "isometry" : [
          [ 0.716933095642 ],
          [ 0.696691744071 ],
          [ 0.025050950386 ],
          [ 0.696344134734 ],
          [ -0.717368785003 ],
          [ 0.022065183566 ],
          [ -0.033343401063 ],
          [ -0.001624822011 ],
          [ 0.999442633451 ]
        ],
        "lattice_deformation_cost" : [
          [ 0.006616383146 ]
        ],
        "latvec" : [
          [ 0.011688713368, 5.966067955499, -0.553130486366 ],
          [ -0.401710167990, 0.078632337530, -11.481001850969 ],
          [ -6.945417049199, -3.483418280663, -4.208840513079 ]
        ],
        "total_cost" : [
          [ 0.162733149433 ]
        ]
      },
      "init" : "import",
      "origin" : "/Users/dar/Desktop/Na_Sn_data/casm_0.625/I13/properties.calc.json",
      "path" : "/Users/dar/Desktop/Na_Sn_data/casm_0.625/I13/properties.calc.json",
      "site" : {
        "coordinate" : [
          [ 4.468554771904, 4.025597528010, 5.045378303140, 3.072015829682, 4.186660790511, 3.961007445479, 5.041786547832, 3.255101427995, 0.066871024386, 1.326959685990, 0.879923433280, 2.115478329853, 0.118669728558, 2.104731087390, 1.000726331960, 2.151039280941 ],
          [ -11.408044808045, -3.013971274832, -5.808646305342, -8.901935674176, -11.562539295983, -2.988769982969, -5.686409294282, -8.865348254247, -8.899558806657, -11.382022412324, -2.643659206814, -6.168719790953, -8.563661826512, -0.302679326579, -3.130059707220, -5.784192999492 ],
          [ -7.457499980224, -4.659768646987, -9.720815397678, -6.095028268504, -11.281263140638, -8.281430375475, -6.245883582773, -9.528007652799, -7.666344903111, -5.547895028435, -2.914733523799, -7.914218306871, -4.317442340682, -4.835270638888, -6.433447279203, -4.520364092140 ]
        ],
        "disp" : [
          [ -0.924751331486, 1.158553659871, -0.642972112137, 0.504863415622, -1.210751436697, 1.077766381442, -0.636909913141, 0.667239968198, 0.466307911646, -1.082681746676, 0.979055542431, -0.574896879864, 0.515677821186, -0.858414436889, 1.105539200494, -0.543626044002 ],
          [ 0.026120080453, -0.135712906317, 0.127804204599, -0.296323015798, 0.109560522124, 0.111849306186, 0.045781162372, -0.060392015319, -0.052276662966, 0.091721977519, 0.298135173932, -0.212356151461, 0.092835581871, -0.126434969214, -0.001739037396, -0.018573250586 ],
          [ 0.212039563200, 0.686644365716, 0.977530197848, -0.283022698653, -0.114934825584, 0.535705881226, 0.984321635741, -0.259991924159, -0.946387427651, -0.433679639791, -0.131203118384, 0.261275061650, -1.068139240598, -0.442224136901, -0.155800105060, 0.177866411400 ]
        ]
      },
      "timestamp" : 1698231520,
      "to" : "SCEL8_2_4_1_3_0_1/0"
    }

Did you still have this problem or was it fixed?

ERROR: boost::filesystem::directory_iterator::construct: No such file or directory: "prim:/Users/dar/Desktop/Na_Sn_data/casm_0.625/I21"

darjaved commented 11 months ago

Thank you for the response. Yes you are right the data is in the mentioned folder. although when importing the data, casm has created some reduced cells of type "SCEL4" and also these are enlisted in "scel_list" file, but i can easily delete these from the train file since i don't actually have these in my DFT data. Is that the right approach? also while we construct the convex hull casm will only consider the configurations which are in the train file? the above error comes only if i try to copy the additional files.

thanks

xivh commented 11 months ago

I recommend that you create a selection of the configs that you want using casm select and write it to a selection file using casm query -k -o train. Then you can use this file both for casm-learn and for the DFT/cluster expansion convex hull, e.g. casm query -c train on_hull, casm select -c train --set on_hull, casm query -c train -k on_clex_hull. Also note that the convex hull created by CASM can include the upper convex hull as well, so if you only want groundstates you should filter by hull_dist (see #3). If you use --checkhull, #152 might be relevant as well since you have non-primitive configs.

darjaved commented 11 months ago

You are right!!, I created a separate folder to do the fitting and in that folder i have the train file and on_hull file will contain the data of only the structures which are in train file and subsequently i can use the same data for MC also.

Thanks