orex / supercell

The program allows you to create regular structure supercell from cif file with partial occupancy and/or substitutions.
GNU General Public License v2.0
91 stars 56 forks source link

Ox charge is nan #6

Closed joellohyy closed 7 years ago

joellohyy commented 7 years ago

Hi, when I tried to run the supercell.exe on In2O3 2310009.cif (as shown below), ./supercell -d -i 2310009.cif, it outputs

Current charge balance option is "try"
Total charge oxidation state (cif):  nan
Total charge cell:   0
Charge balancing:   yes
----------------------------------------------------------------
| Atom Label    |   charge      | mult  | occup x mult
|       | Ox. state | Used  | (cif) |        
----------------------------------------------------------------
|  In1      |  nan      |  0    |  8    |  8
|  In2      |  nan      |  0    |  24   |  24
|  O1       |  nan      |  0    |  48   |  48
----------------------------------------------------------------

Chemical formula of the supercell: In32 O48
Total charge of supercell: 0

If I manually set the charge ./supercell -d -p "In1:c=+3" -p "In2:c=+3" -p "O1:c=-2" -i 2310009.cif I still get nan in the ox.state table.

----------------------------------------------------------------
| Atom Label    |   charge      | mult  | occup x mult
|       | Ox. state | Used  | (cif) |        
----------------------------------------------------------------
|  In1      |  nan      |  3    |  8    |  8
|  In2      |  nan      |  3    |  24   |  24
|  O1       |  nan      |  -2   |  48   |  48
----------------------------------------------------------------

I've managed to run the examples in the tutorials without any problems, the Ox.state column would show the correct values.

I don't see a problem in the cif. file below. How do I set the Ox charge properly?

#------------------------------------------------------------------------------
#$Date: 2016-02-21 11:56:54 +0200 (Sun, 21 Feb 2016) $
#$Revision: 176809 $
#$URL: svn://www.crystallography.net/cod/cif/2/31/00/2310009.cif $
#------------------------------------------------------------------------------
#
# This file is available in the Crystallography Open Database (COD),
# http://www.crystallography.net/. The original data for this entry
# were provided by IUCr Journals, http://journals.iucr.org/.
#
# The file may be used within the scientific community so long as
# proper attribution is given to the journal article from which the
# data were obtained.
#
data_2310009
loop_
_publ_author_name
'Marezio, M.'
_publ_section_title
;
 Refinement of the crystal structure of In2O3 at two wavelengths
;
_journal_issue                   6
_journal_name_full               'Acta Crystallographica'
_journal_page_first              723
_journal_page_last               728
_journal_volume                  66
_journal_year                    1966
_chemical_formula_structural     'In2 O3'
_chemical_formula_sum            'In2 O3'
_chemical_name_systematic        'Indium Oxide'
_space_group_IT_number           206
_symmetry_Int_Tables_number      206
_symmetry_space_group_name_Hall  '-I 2b 2c 3'
_symmetry_space_group_name_H-M   'I a -3'
_cell_angle_alpha                90.
_cell_angle_beta                 90.
_cell_angle_gamma                90.
_cell_formula_units_Z            16
_cell_length_a                   10.117(1)
_cell_length_b                   10.117(1)
_cell_length_c                   10.117(1)
_cell_volume                     1035.51(18)
_cod_data_source_file            In2O3_Ia-3_DC235.cif
_cod_data_source_block           chateigner_1508504
_cod_original_cell_volume        1035.51
_cod_database_code               2310009
loop_
_symmetry_equiv_pos_site_id
_symmetry_equiv_pos_as_xyz
1 '-z, x, y+1/2'
2 'z, x+1/2, -y'
3 'z+1/2, -x, y'
4 '-z, -x, -y'
5 'y+1/2, -z, x'
6 '-y, z, x+1/2'
7 'y, z+1/2, -x'
8 '-y, -z, -x'
9 'x, y+1/2, -z'
10 'x+1/2, -y, z'
11 '-x, y, z+1/2'
12 '-x, -y, -z'
13 'z, -x, -y+1/2'
14 '-z, -x+1/2, y'
15 '-z+1/2, x, -y'
16 'z, x, y'
17 '-y+1/2, z, -x'
18 'y, -z, -x+1/2'
19 '-y, -z+1/2, x'
20 'y, z, x'
21 '-x, -y+1/2, z'
22 '-x+1/2, y, -z'
23 'x, -y, -z+1/2'
24 'x, y, z'
25 '-z+1/2, x+1/2, y'
26 'z+1/2, x, -y+1/2'
27 'z, -x+1/2, y+1/2'
28 '-z+1/2, -x+1/2, -y+1/2'
29 'y, -z+1/2, x+1/2'
30 '-y+1/2, z+1/2, x'
31 'y+1/2, z, -x+1/2'
32 '-y+1/2, -z+1/2, -x+1/2'
33 'x+1/2, y, -z+1/2'
34 'x, -y+1/2, z+1/2'
35 '-x+1/2, y+1/2, z'
36 '-x+1/2, -y+1/2, -z+1/2'
37 'z+1/2, -x+1/2, -y'
38 '-z+1/2, -x, y+1/2'
39 '-z, x+1/2, -y+1/2'
40 'z+1/2, x+1/2, y+1/2'
41 '-y, z+1/2, -x+1/2'
42 'y+1/2, -z+1/2, -x'
43 '-y+1/2, -z, x+1/2'
44 'y+1/2, z+1/2, x+1/2'
45 '-x+1/2, -y, z+1/2'
46 '-x, y+1/2, -z+1/2'
47 'x+1/2, -y+1/2, -z'
48 'x+1/2, y+1/2, z+1/2'
loop_
_atom_site_label
_atom_site_type_symbol
_atom_site_symmetry_multiplicity
_atom_site_Wyckoff_symbol
_atom_site_fract_x
_atom_site_fract_y
_atom_site_fract_z
_atom_site_occupancy
_atom_site_attached_hydrogens
_atom_site_B_iso_or_equiv
In1 In3+ 8 b 0.25 0.25 0.25 1. 0 0.46
In2 In3+ 24 d 0.4663(1) 0 0.25 1. 0 0.41
O1 O2- 48 e 0.3912(12) 0.1558(11) 0.3796(13) 1. 0 0.45
loop_
_atom_type_symbol
_atom_type_oxidation_number
In3+ +3
O2- -2

Precompiled supercell program in Ubuntu 14.04.

orex commented 7 years ago

Hi! Thank you for reporting the issue. Your problem can be spitted into two problems. 1) The "Ox. state" field is always shows charges in CIF file, doesn't matter your command line. Therefore you should look to net column "Used". There you can find charges, which will be processed in the program. If you run, for example, your command with -q option without dry-run (the run will take around 30 seconds) supercell -q -p "In1:c=+3" -p "In2:c=+3" -p "O1:c=-2" -i 2310009.cif or in short form supercell -q -p "In*:c=+3" -p "O*:c=-2" -i 2310009.cif You can see supercell_coulomb_energy.txt file with proper electrostatic energy inside. As you can see, the program got your charges. 2) The second problem is why the oxidation number is NaN in supercell, despite it is specified in CIF file. The reason is that supercell program requires full matching for labels in _atom_site_label and _atom_type_oxidation_number. If you change last 5 lines of your CIF file to

loop_
_atom_type_symbol
_atom_type_oxidation_number
In1 +3
In2 +3
O1 -2

and run supercell program, you will get an expected result

----------------------------------------------------------------
| Atom Label    |   charge      | mult  | occup x mult
|       | Ox. state | Used  | (cif) |        
----------------------------------------------------------------
|  In1      |  3        |  3    |  8    |  8
|  In2      |  3        |  3    |  24   |  24
|  O1       |  -2       |  -2   |  48   |  48
----------------------------------------------------------------
joellohyy commented 7 years ago

Ah I see! Thanks!