Esempio n. 1
0
    def read_supercell(self):
        """ Returns `SuperCell` object from this file """
        cell = _a.arrayd(np.copy(self.cell))
        cell.shape = (3, 3)

        nsc = self._value('nsc')
        sc = SuperCell(cell, nsc=nsc)
        sc.sc_off = self._value('isc_off')
        return sc
Esempio n. 2
0
    def read_supercell(self):
        """ Returns a SuperCell object from a siesta.TSHS file """
        n_s = _siesta.read_tshs_sizes(self.file)[3]
        arr = _siesta.read_tshs_cell(self.file, n_s)
        nsc = np.array(arr[0].T, np.int32)
        cell = np.array(arr[1].T, np.float64)
        cell.shape = (3, 3)
        isc = np.array(arr[2].T, np.int32)
        isc.shape = (-1, 3)

        SC = SuperCell(cell, nsc=nsc)
        SC.sc_off = isc
        return SC
Esempio n. 3
0
File: delta.py Progetto: sjumzw/sisl
    def read_supercell(self):
        """ Returns the `SuperCell` object from this file """
        cell = _a.arrayd(np.copy(self._value('cell')))
        cell.shape = (3, 3)

        nsc = self._value('nsc')
        sc = SuperCell(cell, nsc=nsc)
        try:
            sc.sc_off = self._value('isc_off')
        except:
            # This is ok, we simply do not have the supercell offsets
            pass

        return sc
Esempio n. 4
0
    def read_sc(self):
        """ Returns a SuperCell object from a siesta.TSHS file
        """

        n_s = _siesta.read_tshs_sizes(self.file)[3]
        arr = _siesta.read_tshs_cell(self.file, n_s)
        nsc = np.array(arr[0], np.int32)
        cell = np.array(arr[1], np.float64)
        cell.shape = (3, 3)
        isc = np.array(arr[2], np.int32)
        sc = np.array(arr[2], np.float64)

        SC = SuperCell(cell, nsc=nsc)
        SC.sc_off = np.dot(sc.T, cell.T)
        return SC
Esempio n. 5
0
    def read_sc(self):
        """ Returns `SuperCell` object from a .TBT.nc file """
        cell = np.array(np.copy(self.cell), dtype=np.float64)
        cell.shape = (3, 3)

        try:
            nsc = self._value('nsc')
        except:
            nsc = None

        sc = SuperCell(cell, nsc=nsc)
        try:
            sc.sc_off = self._value('isc_off')
        except:
            pass

        return sc