Spacegroup Trouble

Hi everyone,

I’m trying to create an input.xml file for bulk MoS2 in the 2H crystal phase however I’m having trouble with creating the unit cell for a calculation. I think I’m using the spacegroup command wrong. I tried using spacegroup to create the input.xml file with the following spacegroup.xml file:

<?xml version="1.0" encoding="UTF-8" ?>
    <symmetries HermannMauguinSymbol="P63/mmc">
        <lattice a="5.9733279640198" b="5.9733279640198" c="23.23406024415133" ab="90"
            ac="90" bc="120" ncell="1 1 1" />
            <wspecies speciesfile="Mo.xml">
                <wpos coord="0.3333    0.6666    0.25 " />
            <wspecies speciesfile="S.xml">
                <wpos coord=" 0.3333    0.6666    0.6275" />

I then use the command spacegroup spacegroup.xml, however I do not get a geometry.xml file to use as input.xml. If I just type in spacegroup then I am asked for the different lattice parameters and atoms etc, however the amount of atoms that I need to write down does not match the actual amount of atoms found in the unit cell of MoS2.

Any help would be highly appreciated and thanks in advance,

Hi Louis,

If you want to just convert some cell parameters into an input.xml, you can use excitingtools (packaged in tools/):

from excitingtools.input.ground_state import ExcitingGroundStateInput
from excitingtools.input.structure import ExcitingStructure
from excitingtools.input.input_xml import exciting_input_xml_str

gs_input = ExcitingGroundStateInput(rgkmax=8.0)
cubic_lattice = [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]
arbitrary_atoms = [{'species': 'H', 'position': [0, 0, 0]},
                              {'species': 'H', 'position': [1, 0, 0]},
                              {'species': 'He', 'position': [2, 0, 0]}]
structure = ExcitingStructure(arbitrary_atoms, cubic_lattice, species_path='./')
input_str = exciting_input_xml_str(structure, gs_input)

If you need to generate your cell from lattice constants, I suggest you look at ASE and SPGLib. ExcitingStructure() will also accept ASE’s Atoms object.

I doubt anyone in the group has experience with the Spacegroup program.