Beispiel #1
0
 def __init__(self, wyckoff_sites, lattice, group):
     self.wyckoff_sites = wyckoff_sites
     self.group = group
     #Extract coords and species
     species = []
     coords = []
     for ws in wyckoff_sites:
         species += [ws.specie] * ws.multiplicity
         for c in ws.coords:
             coords.append(c)
     coords = np.array(coords)
     Structure.__init__(self, lattice.matrix, species, coords)
Beispiel #2
0
    def __init__(self, refined_structure, spacegroup, equivalent_positions):
        Structure.__init__(
            self,
            refined_structure.lattice,
            [site.species_and_occu for site in refined_structure],
            refined_structure.frac_coords,
        )

        self._spacegroup = spacegroup
        site_map = zip(self._sites, equivalent_positions)
        site_map = sorted(site_map, key=lambda x: x[1])
        self._equivalent_sites = [[x[0] for x in g] for k, g in itertools.groupby(site_map, key=lambda x: x[1])]
Beispiel #3
0
 def __init__(self, mol_sites, lattice, group):
     self.mol_sites = mol_sites
     self.group = group
     #Extract coords and species
     species = []
     coords = []
     for ms in mol_sites:
         coords1, species1 = ms.get_coords_and_species()
         species += species1
         for c in coords1:
             coords.append(c)
     coords = np.array(coords)
     Structure.__init__(self, lattice.matrix, species, coords)
    def __init__(self, structure, spacegroup, equivalent_positions):
        Structure.__init__(self, structure.lattice,
                           [site.species_and_occu
                            for site in structure],
                           structure.frac_coords,
                           site_properties=structure.site_properties)

        self._spacegroup = spacegroup
        u, inv = np.unique(equivalent_positions, return_inverse = True)
        self.equivalent_indices = [[] for i in xrange(len(u))]
        self._equivalent_sites = [[] for i in xrange(len(u))]
        for i, inv in enumerate(inv):
            self.equivalent_indices[inv].append(i)
            self._equivalent_sites[inv].append(self.sites[i])
Beispiel #5
0
    def __init__(self, structure, spacegroup, equivalent_positions):
        Structure.__init__(self,
                           structure.lattice,
                           [site.species_and_occu for site in structure],
                           structure.frac_coords,
                           site_properties=structure.site_properties)

        self._spacegroup = spacegroup
        u, inv = np.unique(equivalent_positions, return_inverse=True)
        self.equivalent_indices = [[] for i in range(len(u))]
        self._equivalent_sites = [[] for i in range(len(u))]
        for i, inv in enumerate(inv):
            self.equivalent_indices[inv].append(i)
            self._equivalent_sites[inv].append(self.sites[i])
Beispiel #6
0
    def __init__(self, structure, spacegroup, equivalent_positions):
        """
        Args:
            structure:
                Original structure
            spacegroup:
                An input spacegroup from SymmetryFinder.
            equivalent_positions:
                Equivalent positions from SymmetryFinder.
        """
        Structure.__init__(self,
                           structure.lattice,
                           [site.species_and_occu for site in structure],
                           structure.frac_coords,
                           site_properties=structure.site_properties)

        self._spacegroup = spacegroup
        site_map = zip(self._sites, equivalent_positions)
        site_map = sorted(site_map, key=lambda x: x[1])
        self._equivalent_sites = [[
            x[0] for x in g
        ] for k, g in itertools.groupby(site_map, key=lambda x: x[1])]
Beispiel #7
0
    def __init__(self, structure, spacegroup, equivalent_positions):
        """
        Args:
            structure:
                Original structure
            spacegroup:
                An input spacegroup from SymmetryFinder.
            equivalent_positions:
                Equivalent positions from SymmetryFinder.
        """
        Structure.__init__(
            self,
            structure.lattice,
            [site.species_and_occu for site in structure],
            structure.frac_coords,
            site_properties=structure.site_properties,
        )

        self._spacegroup = spacegroup
        site_map = zip(self._sites, equivalent_positions)
        site_map = sorted(site_map, key=lambda x: x[1])
        self._equivalent_sites = [[x[0] for x in g] for k, g in itertools.groupby(site_map, key=lambda x: x[1])]
Beispiel #8
0
    def __init__(self, structure, spacegroup, equivalent_positions):
        """
        Args:
            structure:
                Original structure
            spacegroup:
                An input spacegroup from SymmetryFinder.
            equivalent_positions:
                Equivalent positions from SymmetryFinder.
        """
        Structure.__init__(self,
                           structure.lattice,
                           [site.species_and_occu for site in structure],
                           structure.frac_coords,
                           site_properties=structure.site_properties)

        self._spacegroup = spacegroup
        u, inv = np.unique(equivalent_positions, return_inverse=True)
        self.equivalent_indices = [[] for i in xrange(len(u))]
        self._equivalent_sites = [[] for i in xrange(len(u))]
        for i, inv in enumerate(inv):
            self.equivalent_indices[inv].append(i)
            self._equivalent_sites[inv].append(self.sites[i])
Beispiel #9
0
 def __init__(self, structure, spacegroup, equivalent_positions):
     """
     Args:
         structure:
             Original structure
         spacegroup:
             An input spacegroup from SymmetryFinder.
         equivalent_positions:
             Equivalent positions from SymmetryFinder.
     """
     Structure.__init__(self, structure.lattice,
                        [site.species_and_occu
                         for site in structure],
                        structure.frac_coords,
                        site_properties=structure.site_properties)
     
     self._spacegroup = spacegroup
     u, inv = np.unique(equivalent_positions, return_inverse = True)
     self.equivalent_indices = [[] for i in xrange(len(u))]
     self._equivalent_sites = [[] for i in xrange(len(u))]
     for i, inv in enumerate(inv):
         self.equivalent_indices[inv].append(i)
         self._equivalent_sites[inv].append(self.sites[i])