prisms-center / CASMcode

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

enumerate conventional unit cell #348

Open WalterWhite1611 opened 8 months ago

WalterWhite1611 commented 8 months ago

how to enumerate conventional unit cell instead of starting with primitive cell?

suppose I have a vesta cif file for a conventional unit cell, now I want to enumerate that structure for 222 supercell after writing json file for that structure, how to do this?

I have just started learning this package. please guide me.

xivh commented 8 months ago

Can you be more specific about why you want to use the conventional cell?

If you want to use the conventional cell as the starting point for enumeration, there are a few ways to do it. If you already know which supercell corresponds to your conventional cell, I think that this will work. Find the supercell name SCELXXXX and make this settings.json file:

{
  "scelnames": [ "SCELXXXXX" ],
  "fill": {
    "supercells": {
      "min": 8,
      "max": 8,
      "fixed_shape": true,
    }
  },
  "output_configurations": true,
  "output_configurations_options":
  {
    "path": "conventional.enum.json",
    "properties": [ "poscar" ],
    "json" : true
  }
}

Then you can enumerate all occupations with ccasm enum --method ConfigEnumAllOccupations --settings settings.json. This should enumerate in the 2x2x2 supercell (volume 8) of the supercell that is inside scelnames. However, it will save the primitive versions of each supercell. If you want to save the conventional cells, then add the line "primitive_only": false. You may get some errors related to the supercell database/supercell master selection file (see #333). You can see the enumeration results inside conventional.enum.json.

If you do not have the conventional supercell inside CASM yet, you can pass a transformation matrix into the fill settings. See casm enum --desc ConfigEnumAllOccupations for more info.

WalterWhite1611 commented 8 months ago

The reason is, I have to deal with non stoichiometric compound. I want some suggestion from you regarding this, suppose the conventional unit cell cif file looks like this way, and I want to enumerate this structure and to know which supercell will appropriate for my desirable compound ? The cif file, data_VESTA_phase_1

loop_ _atom_site_label _atom_site_occupancy _atom_site_fract_x _atom_site_fract_y _atom_site_fract_z _atom_site_adp_type _atom_site_B_iso_or_equiv _atom_site_type_symbol A 0.5000 0.000000 0.000000 0.000000 Biso 1.000000 A B 0.7500 0.333333 0.666667 0.000000 Biso 1.000000 B C 1.0 0.333333 0.000000 0.250000 Biso 1.000000 C

Can you be more specific about why you want to use the conventional cell?

If you want to use the conventional cell as the starting point for enumeration, there are a few ways to do it. If you already know which supercell corresponds to your conventional cell, I think that this will work. Find the supercell name SCELXXXX and make this settings.json file:

{
  "scelnames": [ "SCELXXXXX" ],
  "fill": {
    "supercells": {
      "min": 8,
      "max": 8,
      "fixed_shape": true,
    }
  },
  "output_configurations": true,
  "output_configurations_options":
  {
    "path": "conventional.enum.json",
    "properties": [ "poscar" ],
    "json" : true
  }
}

Then you can enumerate all occupations with ccasm enum --method ConfigEnumAllOccupations --settings settings.json. This should enumerate in the 2x2x2 supercell (volume 8) of the supercell that is inside scelnames. However, it will save the primitive versions of each supercell. If you want to save the conventional cells, then add the line "primitive_only": false. You may get some errors related to the supercell database/supercell master selection file (see #333). You can see the enumeration results inside conventional.enum.json.

If you do not have the conventional supercell inside CASM yet, you can pass a transformation matrix into the fill settings. See casm enum --desc ConfigEnumAllOccupations for more info.

xivh commented 8 months ago

You can export from VESTA to a POSCAR, use casm init --prim POSCAR --write-prim, and then add vacancies on those sites like in the first example here. For the purposes of the cluster expansion, the first occupant in each site is treated as the default occupant. So for example if you want to have dilute vacancies, make Va the second occupant on the site. You can let CASM primify your CIF for prim.json, and then import your original structure into the project. By default, it will import both the primitive and non-primitive structures, and then you can get the transformation matrix for that supercell.

WalterWhite1611 commented 8 months ago

Ok, I got your point. I started from conventional cell POSCAR file. Now, I abled to print new .json file , but facing this issue,

ccasm init --prim POSCAR --write-prim --force WARNING: "POSCAR" failed the following check(s): The structure in the provided file is not the Niggli cell in the CASM standard orientation.

{ "basis" : [ { "coordinate" : [ 0.000000000000, 0.000000000000, 0.000000000000 ], "occupants" : [ "A" ] }, { "coordinate" : [ 0.000000000000, 0.000000000000, 0.500000000000 ], "occupants" : [ "A" ] }, .......

xivh commented 8 months ago

Everything should work if you do not use the Niggli reduced cell, but you may get unintuitive transformation matrices. For example, the transformation matrix to your primitive cell will not be the identity matrix. Since you are interested in enumerating in a particular supercell, I recommend using the CASM default unless it makes the orientation of your structure too confusing.

For the second error, CASM will symmetrize for you if you do not use --force (I think it makes the Niggli cell first, then if you use that it will make the symmetrized cell). When you are inside the project, you can check the symmetrically equivalent sites with casm info --method PrimInfo -i '{"properties": "asymmetric_unit"}'. You should see the symmetrically equivalent sites grouped together (the site indices are the order in prim.json).

WalterWhite1611 commented 8 months ago

You can export from VESTA to a POSCAR, use casm init --prim POSCAR --write-prim, and then add vacancies on those sites like in the first example here. For the purposes of the cluster expansion, the first occupant in each site is treated as the default occupant. So for example if you want to have dilute vacancies, make Va the second occupant on the site. You can let CASM primify your CIF for prim.json, and then import your original structure into the project. By default, it will import both the primitive and non-primitive structures, and then you can get the transformation matrix for that supercell.

Thank u so much for your reply. I did as u said. As I mentioned, suppose at a particular site occupancy of B occupant is 0.75, is it appropriate way to write occupants tag , { "coordinate" : [ 0.000000000000, 0.000000000000, 0.500000000000 ], "occupants" : [ "B", "0.25" ] }

xivh commented 8 months ago

It should be [ "B", "Va" ] and then you control the occupancy during enumeration or using casm select.

WalterWhite1611 commented 8 months ago

It should be [ "B", "Va" ] and then you control the occupancy during enumeration or using casm select.

Ok that I corrected earlier. Kindly say during enumeration how to control occupancy (Va=0.5 for A, Va =0.25 for B) value? or how to use ccasm select --set-on for changing occupation?

xivh commented 8 months ago

Is the settings file from #350 working?

WalterWhite1611 commented 8 months ago

Is the settings file from #350 working?

No sir. Please check my last reply on #350.

WalterWhite1611 commented 8 months ago

Everything should work if you do not use the Niggli reduced cell, but you may get unintuitive transformation matrices. For example, the transformation matrix to your primitive cell will not be the identity matrix. Since you are interested in enumerating in a particular supercell, I recommend using the CASM default unless it makes the orientation of your structure too confusing.

For the second error, CASM will symmetrize for you if you do not use --force (I think it makes the Niggli cell first, then if you use that it will make the symmetrized cell). When you are inside the project, you can check the symmetrically equivalent sites with casm info --method PrimInfo -i '{"properties": "asymmetric_unit"}'. You should see the symmetrically equivalent sites grouped together (the site indices are the order in prim.json).

I think my space group symmetry problem is happening due to this issue, what do u meant by CASM default? I copied prim.symmetrized.json file to , prim.json. There I found the lattice vectors matrix like, "lattice_vectors" : [ [ -0.000000000000, -0.000000000000, 6.030200004600 ], [ 3.230200052222, 5.594870609119, 0.000000000000 ], [ -6.460400104495, -0.000000000029, -0.000000000000 ] ], But my initial CIF file POSCAR it was like,

6.4604001045 0.0000000000 0.0000000000 -3.2302000523 5.5948706091 0.0000000000 0.0000000000 0.0000000000 6.0302000046

Can I edit manually this matrix in prim.json file. How to solve?

No, edit manually will not help. Using prim.symmetrized.json file, I'm getting configurations of α =120° , β = 90°, γ =90°, where original initial CIF file was, α = β = 90°, γ =120°

xivh commented 8 months ago

If you want to specify your own lattice vectors, you can use casm init --force.

But make sure you change the atom positions as well.