Author Topic: Occupancy number per particle type: Defects in binary system (SiC)  (Read 481 times)

Xtof

  • Jr. Member
  • **
  • Posts: 63
Dear Alex and OVITO users,

I am trying to determine defects (including antisites) in a binary system such as SiC.
Using the SelectExpressionModifier, it works well.
For instance, to determine the number of Si vacancies (type=1) I proceed as follows:


Code: [Select]

    node = import_file(file_coord_final)
   
    # Construct the modifier for Wigner Seitz analysis of SIA and V
    ws_mod = WignerSeitzAnalysisModifier(eliminate_cell_deformation = True)

    # Load the reference crystal   
    ws_mod.reference.load(file_coord_init)
   
    # Add the modifier to the modification pipeline
    node.modifiers.append(ws_mod)

# Select vacancies of type Si (type=1)
    select_vacancies_mod = SelectExpressionModifier(expression = 'Occupancy == 0 && ParticleType == 1')
    node.modifiers.append(select_vacancies_mod)
   
   
    node.compute()



This works fine and for a given cascade I obtain 31 Si vacancies.

Now, I wish to determine antisites, i.e., Si atoms that are in C vacancies and vice-versa. To do so, I took the example given in OVITO website on a binary system (https://ovito.org/manual/python/modules/ovito_modifiers.html#ovito.modifiers.WignerSeitzAnalysisModifier).
Following this example, I simply extended my script to take into account the occupancy number per particle type.

The resulting script is similar to the previous one, except that the WS modifier takes into account the occupancy number per particle type. Also, in the SelectExpressionModifier, one has to take into account that Occupancy has now 2 components. If for instance, I want to select Si vacancies (type 1), I do the following:

Code: [Select]

...
    ws_mod = WignerSeitzAnalysisModifier(per_type_occupancies = True, eliminate_cell_deformation = True)
...

# Select vacancies of type Si (type=1)
    select_vacancies_mod = SelectExpressionModifier(expression = 'Occupancy.1 == 0 && ParticleType == 1')
    node.modifiers.append(select_vacancies_mod)
   

    node.compute()



This works. However, this time, I get 49 Si vacancies.
Clearly, there is something that I am doing wrong.


I also find a problem with determining the SIA of Si type when I use Occupancy.x. I use the following SelectExpressionModifier to find Si SIAs:


Code: [Select]

    select_SIA_mod = SelectExpressionModifier(expression = 'Occupancy.1 == 2 && ParticleType == 1')


The number of Si SIA I obtain this way is too small and clearly not correct.

Do I use correctly Occupancy.1 in the SelectExpressionModifier?

Any help is appreciated.
Many thanks in advance and best regards,
Christophe

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 515
Re: Occupancy number per particle type: Defects in binary system (SiC)
« Reply #1 on: February 13, 2018, 08:36:51 PM »
Christophe,

After your activate the WignerSeitzAnalysisModifier.per_type_occupancies option, the occupancy numbers will be calculated element-wise. Instead of a total "Occupancy" number for a site, partial numbers "Occupancy.1", "Occupancy.2", etc. are calculated. The sum of all partial occupancy numbers for a site is always equal to the total number computed without the per_type_occupancies option.

Given that you have two atom types in your simulation, you need to make sure that both partial occupancy numbers are zero for a Si-site to detect vacancies:

  Occupancy.1 == 0 && Occupancy.2 == 0 && ParticleType == 1

This expression will make sure that Si-sites now occupied by a C-atom in the displaced configuration are excluded from the selection.
Regarding your second question: The expression

  Occupancy.1 == 2 && ParticleType == 1

will select Si-sites that are occupied by exactly two Si-atoms, regardless of how many C-atoms are on the same site. The question is: what exactly do you consider a "Si SIA"? Maybe a site that was originally occupied by a C-atom and is now occupied by two Si-atoms should also count as a "Si SIA". To catch those kinds of sites as well, you might have to extend the expression with additional criteria that are combined with a logical OR operator (||).

-Alex 
« Last Edit: February 13, 2018, 08:39:17 PM by Alexander Stukowski »

Xtof

  • Jr. Member
  • **
  • Posts: 63
Re: Occupancy number per particle type: Defects in binary system (SiC)
« Reply #2 on: February 14, 2018, 09:45:32 AM »
Hi Alex,

Thanks for the explanation. Clearly, something was missing in my reasoning. Indeed, I did not take into account that a Si vacancy could be occupied by a C atom.
I tried what you said and now it works (version dev105). For a given cascade in SiC, if I compare what I obtain with the global occupancy with what I obtain when using the per-type occupancies, I get the following:

Global occupancy
-------------------

V(Si): ParticleType==1 && Occupancy==0    31 V
V(C): ParticleType==2 && Occupancy==0    61 V


Per-type occupancies
-----------------------

V(Si): ParticleType==1 && Occupancy.1==0 && Occupancy.2==0   31 V
C(Si): ParticleType==2 && Occupancy.1==0 && Occupancy.2==0   61 V


Results are now consistent. All results above were obtained with the Python script (dev105).

However, I noticed a discrepancy between what gives the GUI and what I obtain with the Python script. It occurs when I do it the way I was doing it before, ie without taking into account that C atom could be in a Si vacancy, and vice-versa.

GUI
----

V(Si): ParticleType==1 && Occupancy.1==0   32 V. Here we can see that it is not 31. Means that there is 1 C atom in 1 V(Si)
V(C): ParticleType==2 && Occupancy.2==0   61 V


Python Script
---------------

V(Si): ParticleType==1 && Occupancy.1==0   49 V.
V(C): ParticleType==2 && Occupancy.2==0   74 V

This is very different from what the GUI gives.

Best regards,
Christophe

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 515
Re: Occupancy number per particle type: Defects in binary system (SiC)
« Reply #3 on: February 16, 2018, 04:11:07 PM »
I can only guess, but the discrepancy between the results obtained within the GUI and with ovitos are likely due to different modifier settings. In general, when you use a modifier in a script executed with ovitos, its parameters are initialized to hard-coded default values, which are all documented in the Python scripting reference. In contrast to that, when you insert a modifier into the pipeline using the GUI, some its parameters are typically initialized the most-recently used values (Ovito memorizes them in a config file in the user's home directory). Remaining parameter are always initialized to the same hard-coded values as in ovitos.

So please make sure that the WignerSeitzAnalysisModifier.eliminate_cell_deformation setting has been set consistently in the GUI and in the script. Note that, in Ovito 3.0, this parameter has been deprecated and replaced by the ReferenceConfigurationModifier.affine_mapping parameter.