Exemplo n.º 1
0
def tio2_rutile() -> dict:
    """
    TiO2 Rutile.

    Notes
      Space group P42/mnm (136)
      Direct band gap: 1.781 eV
      Ref: https://materialsproject.org/materials/mp-2657/
    """
    positions = [[0.000000, 0.000000,
                  0.000000], [0.500000, 0.500000, 0.500000],
                 [0.695526, 0.695526,
                  0.000000], [0.304474, 0.304474, 0.000000],
                 [0.195526, 0.804474, 0.500000],
                 [0.804474, 0.195526, 0.500000]]
    species = ['Ti', 'Ti', 'O', 'O', 'O', 'O']
    bravais = 'tetragonal'
    space_group = 136
    lattice_parameters = {
        'a': Set(4.6068, 'angstrom'),
        'c': Set(2.9916, 'angstrom')
    }
    data = {
        'fractional': positions,
        'species': species,
        'lattice_parameters': lattice_parameters,
        'space_group': ('', space_group),
        'n_atoms': len(species)
    }

    return data
Exemplo n.º 2
0
def tio2_anatase() -> dict:
    """
    TiO2 Anatase. Space group:  I4_1/amd (141)

    Notes
      Indirect band gap: 2.062 eV
      Ref: https://materialsproject.org/materials/mp-390/#

      SPGLib confirms that this is the primitive cell and is space group 141,
      however, it looks body-centred cubic rather than body-centred tetragonal
      from visual inspection of the lattice vectors and parameters.
    """
    positions = [[0.500000, 0.500000,
                  0.000000], [0.250000, 0.750000, 0.500000],
                 [0.456413, 0.956413,
                  0.500000], [0.706413, 0.706413, 0.000000],
                 [0.043587, 0.543587, 0.500000],
                 [0.293587, 0.293587, 0.000000]]
    species = ['Ti', 'Ti', 'O', 'O', 'O', 'O']
    bravais = 'body_centred_tetragonal'
    space_group = 141
    lattice_parameters = {
        'a': Set(5.55734663, 'angstrom'),
        'c': Set(5.55734663, 'angstrom')
    }
    data = {
        'fractional': positions,
        'species': species,
        'lattice_parameters': lattice_parameters,
        'space_group': ('', space_group),
        'n_atoms': len(species)
    }

    return data
Exemplo n.º 3
0
def boron_nitride():
    """
    hexagonal boron nitride.

    Notes
      Space group: P63/mmc [194]
      Primitive lattice vectors and atomic basis
      Indirect and gap: 4.482 eV
      https://materialsproject.org/materials/mp-984/
    """

    positions = [[1 / 3, 2 / 3, 1 / 4], [2 / 3, 1 / 4, 3 / 4],
                 [1 / 3, 2 / 3, 3 / 4], [2 / 3, 1 / 3, 1 / 4]]
    species = ['B', 'B', 'N', 'N']
    bravais = 'hexagonal'
    space_group = 194
    lattice_parameters = {
        'a': Set(2.51242804, 'angstrom'),
        'c': Set(7.70726501, 'angstrom')
    }
    data = {
        'fractional': positions,
        'species': species,
        'lattice_parameters': lattice_parameters,
        'space_group': ('', space_group),
        'bravais': bravais,
        'n_atoms': 4
    }
    return data
Exemplo n.º 4
0
def xtb_symmetry_test_string(crystal: Optional[dict] = None,
                             sub_commands: Optional[dict] = None,
                             options: Optional[dict] = None,
                             assertions: Optional[dict] = None,
                             named_result: Optional[str] = None,
                             comments='') -> str:

    #keys = [key for key in options.keys()]

    options['symmetry_reduction'] = Set(False)
    input_no_symmetry = qcore_input.xtb_input_string_cleaner(
        crystal=crystal,
        options=options,
        assertions=assertions,
        named_result=named_result + "_no_symmetry",
        comments=comments)

    options['symmetry_reduction'] = Set(True)
    input_symmetry = qcore_input.xtb_input_string_cleaner(
        crystal=crystal,
        options=options,
        assertions=assertions,
        named_result=named_result + "_no_symmetry",
        comments=comments)

    return input_no_symmetry + input_symmetry
Exemplo n.º 5
0
def boron_nitride_hex(named_result='boron_nitride') -> str:
    """
     Hexagonal
    :param named_result: named result string
    :return: Input for testing symmetry reduction of MP grid
    """

    crystal = hexagonal.boron_nitride()
    assert crystal['bravais'] == 'hexagonal', "crystal not hexagonal"

    options = OrderedDict([('h0_cutoff', Set(40, 'bohr')),
                           ('overlap_cutoff', Set(40, 'bohr')),
                           ('repulsive_cutoff', Set(40, 'bohr')),
                           ('ewald_real_cutoff', Set(10, 'bohr')),
                           ('ewald_reciprocal_cutoff', Set(1)),
                           ('ewald_alpha', Set(0.5)),
                           ('monkhorst_pack', Set([2, 2, 2])),
                           ('symmetry_reduction', Set(True)),
                           ('temperature', Set(0, 'kelvin')),
                           ('potential_type',
                            Set(xtb_potential_str(potential_type)))])

    assertions = {
        PotentialType.TRUNCATED:
        OrderedDict([("n_iter", SetAssert(0)), ("energy", SetAssert(0,
                                                                    1.e-6))]),
        PotentialType.FULL:
        OrderedDict([("n_iter", SetAssert(0)), ("energy", SetAssert(0, 0))])
    }

    return xtb_symmetry_test_string(
        crystal=crystal,
        options=options,
        assertions=assertions[PotentialType.TRUNCATED],
        named_result=named_result)
Exemplo n.º 6
0
def convention_sodium_chloride(supercell_coefficients, named_result):

    fname = '../' + cubic.conventional_fcc_cifs['sodium_chloride'].file
    crystal = cif_parser_wrapper(
        fname,
        is_primitive_cell=False,
        fractional=True,
        bravais=get_supercell_bravais(supercell_coefficients),
        supercell_coefficients=supercell_coefficients)

    options = OrderedDict([('h0_cutoff', Set(40, 'bohr')),
                           ('overlap_cutoff', Set(40, 'bohr')),
                           ('repulsive_cutoff', Set(40, 'bohr')),
                           ('ewald_real_cutoff', Set(10, 'bohr')),
                           ('ewald_reciprocal_cutoff', Set(1)),
                           ('ewald_alpha', Set(0.5)),
                           ('monkhorst_pack', Set([4, 4, 4])),
                           ('symmetry_reduction', Set(True)),
                           ('temperature', Set(0, 'kelvin')),
                           ('potential_type',
                            Set(xtb_potential_str(potential_type)))])

    assertions = {
        PotentialType.TRUNCATED:
        OrderedDict([("n_iter", SetAssert(0)), ("energy", SetAssert(0, 0))]),
        PotentialType.FULL:
        OrderedDict([("n_iter", SetAssert(0, 0)), ("energy", SetAssert(0, 0))])
    }

    return xtb_input_string_cleaner(crystal=crystal,
                                    options=options,
                                    assertions=assertions[potential_type],
                                    named_result=named_result)
Exemplo n.º 7
0
def calcium_titanate():
    """
    calcium titanate

    Notes
      Ref: https://materialsproject.org/materials/mp-4019/
      Space group: Pnma [62]
    """

    positions = [[0.991521, 0.044799,
                  0.750000], [0.491521, 0.455201, 0.250000],
                 [0.508479, 0.544799,
                  0.750000], [0.008479, 0.955201, 0.250000],
                 [0.500000, 0.000000,
                  0.500000], [0.000000, 0.500000, 0.500000],
                 [0.000000, 0.500000,
                  0.000000], [0.500000, 0.000000, 0.000000],
                 [0.921935, 0.520580,
                  0.250000], [0.421935, 0.979420, 0.750000],
                 [0.578065, 0.020580,
                  0.250000], [0.078065, 0.479420, 0.750000],
                 [0.707456, 0.291917,
                  0.959281], [0.207456, 0.208083, 0.040719],
                 [0.792544, 0.791917,
                  0.540719], [0.292544, 0.708083, 0.459281],
                 [0.707456, 0.291917,
                  0.540719], [0.207456, 0.208083, 0.459281],
                 [0.292544, 0.708083, 0.040719],
                 [0.792544, 0.791917, 0.959281]]

    species = [
        'Ca', 'Ca', 'Ca', 'Ca', 'Ti', 'Ti', 'Ti', 'Ti', 'O ', 'O ', 'O ', 'O ',
        'O ', 'O ', 'O ', 'O ', 'O ', 'O ', 'O ', 'O '
    ]

    bravais = 'orthorhombic'

    space_group = 62
    lattice_parameters = {
        'a': Set(5.40444906, 'angstrom'),
        'b': Set(5.51303112, 'angstrom'),
        'c': Set(7.69713264, 'angstrom')
    }
    data = {
        'fractional': positions,
        'species': species,
        'lattice_parameters': lattice_parameters,
        'space_group': ('', space_group),
        'n_atoms': len(species)
    }

    return data
Exemplo n.º 8
0
def sio2_zeolite_gamma_point(named_result='SiO2') -> str:
    """
    BCC structure
    :param named_result: named result string
    :return: Input for testing translational invariance
    """
    fname = '../' + cubic.bcc_cifs['sio2'].file
    crystal = cif_parser_wrapper(fname)
    assert crystal['bravais'] == 'bcc', "crystal not simple cubic"

    arbitrary_shifts = [0., 0.1, 0.2, 0.24, 0.25]

    options = OrderedDict([
        ('h0_cutoff',               Set(60, 'bohr')),
        ('overlap_cutoff',          Set(60, 'bohr')),
        ('repulsive_cutoff',        Set(60, 'bohr')),
        ('dispersion_cutoff',       Set(60, 'bohr')),
        ('ewald_real_cutoff',       Set(60, 'bohr')),
        ('ewald_reciprocal_cutoff', Set(1)),
        ('ewald_alpha',             Set(0.5)),
        ('potential_type',          Set(xtb_potential_str(potential_type))),
    ])

    assertions = {
        PotentialType.TRUNCATED: OrderedDict([("n_iter", SetAssert(14)),
                                              ("energy", SetAssert(-69.074350228, 5.e-6))]),
        PotentialType.FULL:      OrderedDict([("n_iter", SetAssert(0, 0)),
                                              ("energy", SetAssert(0, 0))])
    }

    comments = ['! Fractional shift of '] * len(arbitrary_shifts)

    return translation_string(crystal, options, assertions[potential_type],
                              arbitrary_shifts, named_result,
                              comments=[x + str(arbitrary_shifts[i]) for i, x in enumerate(comments)])
Exemplo n.º 9
0
def silicon():
    """
    Silicon Crystal

    Notes
      Ref: https://doi.org/10.1103/PhysRevB.24.6121
      Experimental value in Table I

    """

    positions = [[0.00, 0.00, 0.00], [0.25, 0.25, 0.25]]
    species = ['Si', 'Si']
    bravais = 'fcc'
    space_group = 227
    lattice_parameters = {'a': Set(5.429, 'angstrom')}

    data = {
        'fractional': positions,
        'species': species,
        'lattice_parameters': lattice_parameters,
        'space_group': ('', space_group),
        'bravais': bravais,
        'n_atoms': 2
    }

    return data
Exemplo n.º 10
0
def tio2_rutile_gamma(named_result='rutile') -> str:
    """
    Simple tetragonal
    :param named_result: named result string
    :return: Input for testing translational invariance
    """

    crystal = tetragonal.tio2_rutile()
    arbitrary_shift = 0.24  #0.134

    options = OrderedDict([
        ('h0_cutoff',               Set(40, 'bohr')),
        ('overlap_cutoff',          Set(40, 'bohr')),
        ('repulsive_cutoff',        Set(40, 'bohr')),
        ('ewald_real_cutoff',       Set(40, 'bohr')),
        ('ewald_reciprocal_cutoff', Set(1)),
        ('ewald_alpha',             Set(0.5)),
        ('potential_type',          Set(xtb_potential_str(potential_type)))
    ])

    assertions = {PotentialType.TRUNCATED: OrderedDict([("n_iter", SetAssert(12)),
                                                        ("energy", SetAssert(-22.578519079, 1.e-6))]),
                  PotentialType.FULL:      OrderedDict([("n_iter", SetAssert(0, 0)),
                                                        ("energy", SetAssert(0, 0))])
                  }

    return translation_string(crystal, options, assertions[potential_type],
                              arbitrary_shift, named_result)
Exemplo n.º 11
0
def aluminum_hexathiohypodiphosphate():
    """
    AlPS4.

    Notes
      Simple orthorhombic. Space group: P222 [16]
      Indirect band gap: 2.634 eV
      Ref: https://materialsproject.org/materials/mp-27462/
    """

    positions = [[0.000000, 0.000000,
                  0.000000], [0.500000, 0.000000, 0.500000],
                 [0.000000, 0.500000,
                  0.000000], [0.000000, 0.000000, 0.500000],
                 [0.197847, 0.276435,
                  0.101916], [0.197847, 0.723565, 0.898084],
                 [0.802153, 0.276435,
                  0.898084], [0.802153, 0.723565, 0.101916],
                 [0.776404, 0.800507,
                  0.601208], [0.776404, 0.199493, 0.398792],
                 [0.223596, 0.800507, 0.398792],
                 [0.223596, 0.199493, 0.601208]]

    species = ['Al', 'Al', 'P', 'P', 'S', 'S', 'S', 'S', 'S', 'S', 'S', 'S']

    bravais = 'orthorhombic'

    space_group = 16
    lattice_parameters = {
        'a': Set(5.71230345, 'angstrom'),
        'b': Set(5.71644625, 'angstrom'),
        'c': Set(11.46678755, 'angstrom')
    }
    data = {
        'fractional': positions,
        'species': species,
        'lattice_parameters': lattice_parameters,
        'space_group': ('', space_group),
        'n_atoms': len(species)
    }

    return data
Exemplo n.º 12
0
def convention_sodium_chloride(named_result, ewald):
    fname = '../' + cubic.conventional_fcc_cifs['sodium_chloride'].file
    crystal = cif_parser_wrapper(fname, is_primitive_cell=False, fractional=True, bravais='cubic')
    settings = collections.OrderedDict([
        ('h0_cutoff',               Set(40, 'bohr')),
        ('overlap_cutoff',          Set(40, 'bohr')),
        ('repulsive_cutoff',        Set(40, 'bohr')),
        ('ewald_real_cutoff',       Set(ewald['real'], 'bohr')),
        ('ewald_reciprocal_cutoff', Set(ewald['reciprocal'])),
        ('ewald_alpha',             Set(ewald['alpha'])),
        ('monkhorst_pack',          Set([4, 4, 4])),
        ('symmetry_reduction',      Set(True)),
        ('temperature',             Set(0, 'kelvin'))
    ])

    input_string = qcore_input.xtb_input_string(crystal, settings, named_result=named_result)
    return input_string
Exemplo n.º 13
0
def primitive_sodium_chloride():

    named_result = 'primitive_nacl'
    fname = '../' + cubic.fcc_cifs['sodium_chloride'].file
    crystal = cif_parser_wrapper(fname,  is_primitive_cell=True, fractional=True)
    settings = collections.OrderedDict([
        ('h0_cutoff',               Set(40, 'bohr')),
        ('overlap_cutoff',          Set(40, 'bohr')),
        ('repulsive_cutoff',        Set(40, 'bohr')),
        ('ewald_real_cutoff',       Set(10, 'bohr')),
        ('ewald_reciprocal_cutoff', Set(1)),
        ('ewald_alpha',             Set(0.5)),
        ('monkhorst_pack',          Set([4, 4, 4])),
        ('symmetry_reduction',      Set(True)),
        ('temperature',             Set(0, 'kelvin'))
    ])

    input_string = qcore_input.xtb_input_string(crystal, settings, named_result=named_result)
    return input_string
Exemplo n.º 14
0
def nickel_triphosphide(named_result='nickel_triphosphide') -> str:
    """
     BCC
     Won't converge with these settings
    :param named_result: named result string
    :return: Input for testing symmetry reduction of MP grid
    """

    fname = '../' + cubic.bcc_cifs[named_result].file
    crystal = cif_parser_wrapper(fname)
    assert crystal['bravais'] == 'bcc', "crystal not bcc"

    options = OrderedDict([('h0_cutoff', Set(40, 'bohr')),
                           ('overlap_cutoff', Set(40, 'bohr')),
                           ('repulsive_cutoff', Set(40, 'bohr')),
                           ('ewald_real_cutoff', Set(10, 'bohr')),
                           ('ewald_reciprocal_cutoff', Set(1)),
                           ('ewald_alpha', Set(0.5)),
                           ('monkhorst_pack', Set([2, 2, 2])),
                           ('symmetry_reduction', Set(True)),
                           ('temperature', Set(0, 'kelvin')),
                           ('potential_type',
                            Set(xtb_potential_str(potential_type)))])

    assertions = {
        PotentialType.TRUNCATED:
        OrderedDict([("n_iter", SetAssert(0)), ("energy", SetAssert(0,
                                                                    1.e-6))]),
        PotentialType.FULL:
        OrderedDict([("n_iter", SetAssert(0)), ("energy", SetAssert(0, 0))])
    }

    return xtb_symmetry_test_string(
        crystal=crystal,
        options=options,
        assertions=assertions[PotentialType.TRUNCATED],
        named_result=named_result)
Exemplo n.º 15
0
def MoS2():

    """
    Molybdenum disulfide

    Notes
      Rhombohedral setting. Space group: 160
      Indirect band gap: 1.228 eV
      https://materialsproject.org/materials/mp-1434/
    """

    positions = [[0.000000, 0.000000, 0.000000],
                 [0.254176, 0.254176, 0.254176],
                 [0.412458, 0.412458, 0.412458]]
    species = ['Mo', 'S', 'S']
    bravais = 'rhombohedral'
    space_group = 160
    lattice_parameters = {'a': Set(6.856, 'angstrom'), 'alpha': Set(26.94, 'degree')}
    data = {'fractional': positions,
            'species': species,
            'lattice_parameters': lattice_parameters,
            'space_group': ('',space_group),
            'n_atoms': len(species)}
    return data
Exemplo n.º 16
0
def conventional_copper():

    named_result = 'conventional_copper'
    fname = '../' + cubic.conventional_fcc_cifs['copper'].file
    crystal = cif_parser_wrapper(fname,
                                 is_primitive_cell=False,
                                 fractional=True,
                                 bravais='cubic')
    settings = OrderedDict([('h0_cutoff', Set(40, 'bohr')),
                            ('overlap_cutoff', Set(40, 'bohr')),
                            ('repulsive_cutoff', Set(40, 'bohr')),
                            ('ewald_real_cutoff', Set(10, 'bohr')),
                            ('ewald_reciprocal_cutoff', Set(1)),
                            ('ewald_alpha', Set(0.5)),
                            ('monkhorst_pack', Set([4, 4, 4])),
                            ('symmetry_reduction', Set(False)),
                            ('temperature', Set(0, 'kelvin'))])

    input_string = qcore_input.xtb_input_string(crystal,
                                                settings,
                                                named_result=named_result)
    return input_string
Exemplo n.º 17
0
def primitive_silicon(named_result='primitive_cell_si') -> str:
    """
    Primitive silicon

    Note, this will likely give slightly difference results to using
    cubic.silicon, which (probably) has a slightly different lattice
    parameter

    :param named_result: named_result
    :return: input string
    """

    fname = '../' + cubic.conventional_fcc_cifs['silicon'].file
    crystal = cif_parser_wrapper(fname,
                                 is_primitive_cell=True,
                                 fractional=True,
                                 bravais='fcc')
    assert crystal['n_atoms'] == 2, "Expect 2-atom basis for primitive si"

    options = OrderedDict([('h0_cutoff', Set(40, 'bohr')),
                           ('overlap_cutoff', Set(40, 'bohr')),
                           ('repulsive_cutoff', Set(40, 'bohr')),
                           ('ewald_real_cutoff', Set(10, 'bohr')),
                           ('ewald_reciprocal_cutoff', Set(1)),
                           ('ewald_alpha', Set(0.5)),
                           ('monkhorst_pack', Set([2, 2, 2])),
                           ('potential_type',
                            Set(xtb_potential_str(potential_type)))])

    assertions = {
        PotentialType.TRUNCATED:
        OrderedDict([("n_iter", SetAssert(0)), ("energy", SetAssert(0,
                                                                    1.e-6))]),
        PotentialType.FULL:
        OrderedDict([("n_iter", SetAssert(0)), ("energy", SetAssert(0, 0))])
    }

    return qcore_input.xtb_input_string_cleaner(
        crystal=crystal,
        options=options,
        assertions=assertions[potential_type],
        named_result=named_result)
Exemplo n.º 18
0
def lattice_parameters_from_cif(structure, length_unit='angstrom', angle_unit='degree') \
        -> typing.Dict:

    """
    Get lattice constants and angles from pymatgen structure object
    and assign units to them.

    Parameters
    ----------
    structure : str
    length_unit : str, optional,
        Unit of lattice constants. Valid options = ['angstrom', 'bohr']
        cif file lattice constants are angstrom by default (verify)
    angle_unit : str : optional
        Unit of lattice angles. Valid options = ['degree', 'radian']
        cif file lattice angles are degrees by default (verify)

    Returns
    -------
    lattice_parameters_with_units : dict
        Valid keys = a, b, c, alpha, beta, gamma
        Each dictionary value is an object with a float value and str unit.

    """

    assert isinstance(structure, Structure)
    assert length_unit in ['angstrom', 'bohr']
    assert angle_unit in ['degree', 'radian']

    lattice_parameters = structure.as_dict()['lattice']
    lattice_parameters.pop('matrix')
    lattice_parameters.pop('volume')

    lattice_parameters_with_units = {}
    for key, value in lattice_parameters.items():
        if key in ['a', 'b', 'c']:
            unit = length_unit
        else:
            unit = angle_unit
        lattice_parameters_with_units[key] = Set(value, unit)

    return lattice_parameters_with_units
Exemplo n.º 19
0
def sio2_zeolite(named_result='SiO2') -> str:
    """
    BCC structure
    :param named_result: named result string
    :return: Input for testing translational invariance
    """
    fname = '../' + cubic.bcc_cifs['sio2'].file
    crystal = cif_parser_wrapper(fname)
    assert crystal['bravais'] == 'bcc', "crystal not simple cubic"

    arbitrary_shift = 0.1

    options = OrderedDict([
        ('h0_cutoff', Set(40, 'bohr')),
        ('overlap_cutoff', Set(40, 'bohr')),
        ('repulsive_cutoff', Set(40, 'bohr')),
        ('ewald_real_cutoff', Set(40, 'bohr')),
        ('ewald_reciprocal_cutoff', Set(1)),
        ('ewald_alpha', Set(0.5)),
        ('monkhorst_pack', Set([2, 2, 2])),
        ('potential_type', Set(xtb_potential_str(potential_type))),
    ])

    assertions = {
        PotentialType.TRUNCATED:
        OrderedDict([("n_iter", SetAssert(14)),
                     ("energy", SetAssert(-69.074163659, 1.e-6))]),
        PotentialType.FULL:
        OrderedDict([("n_iter", SetAssert(0, 0)), ("energy", SetAssert(0, 0))])
    }

    comments = '! Fractional shift of 0.1'

    return translation_string(crystal,
                              options,
                              assertions[potential_type],
                              arbitrary_shift,
                              named_result,
                              comments=comments)
Exemplo n.º 20
0
def conventional_silicon(named_result='conventional_cell_si'):

    fname = '../' + cubic.conventional_fcc_cifs['silicon'].file
    crystal = cif_parser_wrapper(fname,
                                 is_primitive_cell=False,
                                 fractional=True,
                                 bravais='cubic')
    assert crystal['n_atoms'] == 8, "Expect 8-atom basis for primitive si"

    options = OrderedDict([('h0_cutoff', Set(40, 'bohr')),
                           ('overlap_cutoff', Set(40, 'bohr')),
                           ('repulsive_cutoff', Set(40, 'bohr')),
                           ('ewald_real_cutoff', Set(10, 'bohr')),
                           ('ewald_reciprocal_cutoff', Set(1)),
                           ('ewald_alpha', Set(0.5)),
                           ('monkhorst_pack', Set([2, 2, 2])),
                           ('potential_type',
                            Set(xtb_potential_str(potential_type)))])

    return qcore_input.xtb_input_string_cleaner(crystal=crystal,
                                                options=options,
                                                named_result=named_result)
Exemplo n.º 21
0
def primitive_potassium(named_result='primitive_potassium'):
    """
    BCC Example

    Notes:
    Converges but with this warning
    warning: solve(): system seems singular (rcond: 4.98607e-17);
    attempting approx solution
    13         7.217892848     -5.61e-12      5.55e-17        0.13

    SCF takes ~ 35 iterations => SCC faster
    symmetry reduction works

    :param named_result: named result
    :return:
    """
    fname = '../' + cubic.bcc_cifs['potassium'].file
    crystal = cif_parser_wrapper(fname)

    settings = collections.OrderedDict([('h0_cutoff', Set(40, 'bohr')),
                                        ('overlap_cutoff', Set(40, 'bohr')),
                                        ('repulsive_cutoff', Set(40, 'bohr')),
                                        ('ewald_real_cutoff', Set(40, 'bohr')),
                                        ('ewald_reciprocal_cutoff', Set(10)),
                                        ('ewald_alpha', Set(0.5)),
                                        ('monkhorst_pack', Set([2, 2, 2])),
                                        ('symmetry_reduction', Set(True)),
                                        ('temperature', Set(0, 'kelvin')),
                                        ('solver', Set('SCC'))])

    xtb_potential = collections.OrderedDict([
        ('potential_type', Set('truncated')),
        ('smoothing_range', Set(1, 'bohr'))
    ])

    sub_commands = collections.OrderedDict([('xtb_potential', xtb_potential)])

    input_string = qcore_input.xtb_input_string(crystal,
                                                settings=settings,
                                                sub_commands=sub_commands,
                                                named_result=named_result)
    return input_string
Exemplo n.º 22
0
def alpha_N2(named_result='alpha_N2'):
    """
    Simple cubic example
    No charge transfer => Trivial to converge
    """
    fname = '../' + cubic.cubic_cifs['alpha-N2'].file
    crystal = cif_parser_wrapper(fname)
    settings = collections.OrderedDict([('h0_cutoff', Set(40, 'bohr')),
                                        ('overlap_cutoff', Set(40, 'bohr')),
                                        ('repulsive_cutoff', Set(40, 'bohr')),
                                        ('ewald_real_cutoff', Set(40, 'bohr')),
                                        ('ewald_reciprocal_cutoff', Set(10)),
                                        ('ewald_alpha', Set(0.5)),
                                        ('monkhorst_pack', Set([2, 2, 2])),
                                        ('symmetry_reduction', Set(True)),
                                        ('temperature', Set(0, 'kelvin'))])

    xtb_potential = collections.OrderedDict([
        ('potential_type', Set('truncated')),
        ('smoothing_range', Set(1, 'bohr'))
    ])

    sub_commands = collections.OrderedDict([('xtb_potential', xtb_potential)])

    input_string = qcore_input.xtb_input_string(crystal,
                                                settings=settings,
                                                sub_commands=sub_commands,
                                                named_result=named_result)
    return input_string
Exemplo n.º 23
0
def primitive_anatase(named_result='primitive_anatase'):
    """
    Anatase primitive unit cell

    SCC takes 26 iterations vs 11 SCF

    :param named_result: named result
    :return:
    """
    crystal = tetragonal.tio2_anatase()

    settings = collections.OrderedDict([('h0_cutoff', Set(40, 'bohr')),
                                        ('overlap_cutoff', Set(40, 'bohr')),
                                        ('repulsive_cutoff', Set(40, 'bohr')),
                                        ('ewald_real_cutoff', Set(40, 'bohr')),
                                        ('ewald_reciprocal_cutoff', Set(10)),
                                        ('ewald_alpha', Set(0.5)),
                                        ('monkhorst_pack', Set([2, 2, 2])),
                                        ('symmetry_reduction', Set(False)),
                                        ('temperature', Set(0, 'kelvin'))])

    xtb_potential = collections.OrderedDict([
        ('potential_type', Set('truncated')),
        ('smoothing_range', Set(1, 'bohr'))
    ])

    sub_commands = collections.OrderedDict([('xtb_potential', xtb_potential)])

    input_string = qcore_input.xtb_input_string(crystal,
                                                settings=settings,
                                                sub_commands=sub_commands,
                                                named_result=named_result)
    return input_string
Exemplo n.º 24
0
def magnesium_oxide():
    file_name = '../' + cubic.conventional_fcc_cifs['magnesium_oxide'].file
    crystal = cif_parser_wrapper(file_name,
                                 fractional=True,
                                 is_primitive_cell=False,
                                 bravais='cubic')

    unit = get_position_unit(crystal)
    lattice_constant_factors = np.linspace(0.8, 1.2, 21, endpoint=True)
    lattice_constants = cubic_lattice_constants(crystal,
                                                lattice_constant_factors)

    named_result = 'mgo_volume'
    settings = collections.OrderedDict([
        ('h0_cutoff', Set(40, 'bohr')),
        ('overlap_cutoff', Set(40, 'bohr')),
        ('repulsive_cutoff', Set(40, 'bohr')),
        # Ewald setting for hard-cutoff of potential at 30 bohr
        ('ewald_real_cutoff', Set(40, 'bohr')),
        # Converged w.r.t. real-space value
        ('ewald_reciprocal_cutoff', Set(10)),
        ('ewald_alpha', Set(0.5)),
        ('monkhorst_pack', Set([2, 2, 2])),
        ('symmetry_reduction', Set(True)),
        ('temperature', Set(0, 'kelvin')),
        ('solver', Set('SCC'))
    ])

    total_energies = np.zeros(shape=(lattice_constant_factors.size))
    for i, al in enumerate(lattice_constants):
        lattice_factor = lattice_constant_factors[i]
        crystal['lattice_parameters']['a'] = Set(al, unit)
        input_string = qcore_input.xtb_input_string(crystal,
                                                    settings,
                                                    named_result=named_result)
        output = run_qcore(input_string)
        if not output:
            print('No result:', lattice_factor)
        else:
            total_energies[i] = output[named_result]['energy']
            # 4.19 ang is exp. See "Ab initio determination of the bulk properties of Mgo"
            print(lattice_factor, al, output[named_result]['energy'])

    return lattice_constant_factors, total_energies