Пример #1
0
 def test_translation_integers_for_simple_cubic_cell(self):
     """
     For a cubic system, expect the naive expression
     ceil(cutoff / |a|) to give the same maximum integer as
     translation_integers_for_radial_cutoff function,
     where a is the cubic lattice vector
     """
     lattice_vectors = simple_cubic(5)
     cutoff = 21
     integers = lattice.simple_cubic_cell_translation_integers(
         lattice_vectors, cutoff)
     integers2 = lattice.translation_integers_for_radial_cutoff(
         lattice_vectors, cutoff)
     self.assertTrue(np.all(integers == integers2))
Пример #2
0
def simple_cubic():
    system_label = 'cubic_silicon'
    al = 10.33
    species = ['Si'] * 8
    positions = al * np.array([[0.25000000, 0.75000000, 0.25000000],
                               [0.00000000, 0.00000000, 0.50000000],
                               [0.25000000, 0.25000000, 0.75000000],
                               [0.00000000, 0.50000000, 0.00000000],
                               [0.75000000, 0.75000000, 0.75000000],
                               [0.50000000, 0.00000000, 0.00000000],
                               [0.75000000, 0.25000000, 0.25000000],
                               [0.50000000, 0.50000000, 0.50000000]])
    unit_cell = atoms.Atoms(species, positions)
    lattice = bravais.simple_cubic(al)
    return System(system_label, unit_cell, lattice)
Пример #3
0
def cubic_point_groups():
    point_groups = []
    al = 1

    cubic_lattice = bravais.simple_cubic(al)
    pg = find_point_group(cubic_lattice)
    point_groups.append(pg)
    print(' Real lattice of simple cubic:', pg)

    recip_lattice = lattice.reciprocal_lattice_vectors(cubic_lattice)
    pg = find_point_group(recip_lattice)
    point_groups.append(pg)
    print(' Reciprocal lattice of simple cubic:', pg)

    bcc_lattice = bravais.body_centred_cubic(al)
    pg = find_point_group(bcc_lattice)
    point_groups.append(pg)
    print(' Real lattice of BCC:', pg)

    recip_lattice = lattice.reciprocal_lattice_vectors(bcc_lattice)
    pg = find_point_group(recip_lattice)
    point_groups.append(pg)
    print(' Reciprocal lattice of BCC:', pg)

    fcc_lattice = bravais.face_centred_cubic(al)
    pg = find_point_group(fcc_lattice)
    point_groups.append(pg)
    print(' Real lattice of FCC:', pg)

    recip_lattice = lattice.reciprocal_lattice_vectors(fcc_lattice)
    pg = find_point_group(recip_lattice)
    point_groups.append(pg)
    print(' Reciprocal lattice of FCC:', pg, "\n")

    assert check_all_equal(point_groups, 'm-3m')
    return
Пример #4
0
# Silicon cells for gamma point calculation with Grimme gfn1

import numpy as np

from modules.electronic_structure.structure import atoms, bravais, crystals, supercell
from modules.electronic_structure.basis import gfn1

from modules.parameters import crystals as params
from modules.fileio import write
from modules import entos

# Silicon cubic unit cell in angstrom
al = params.silicon['lattice_constant']['angstrom']
fractional_basis_positions = crystals.silicon('conventional')
lattice = bravais.simple_cubic(al)

unit_cell = []
for atom in fractional_basis_positions:
    pos_angstrom = np.matmul(lattice, atom.position)
    unit_cell.append(atoms.Atom(atom.species, pos_angstrom))


def silicon_supercell(n, centred_on_zero=None):
    if centred_on_zero == None:
        centred_on_zero = (n[0] * n[1] * n[2]) % 2 != 0

    translations = supercell.translation_vectors(
        lattice, n, centred_on_zero=centred_on_zero)
    super_cell = supercell.build_supercell(unit_cell, translations)

    # Information
Пример #5
0
 def test_parallelpiped_volume_simple_cubic(self):
     """ Test volume for simple cubic lattice"""
     al = 5
     lattice_vectors = simple_cubic(5)
     vol = lattice.parallelpiped_volume(lattice_vectors)
     self.assertEqual(vol, al**3)