コード例 #1
0
ファイル: tight_binding.py プロジェクト: aherrmann/triqs1.1
class TBLattice:
    def __init__(self,
                 units,
                 hopping,
                 orbital_positions=[(0, 0, 0)],
                 orbital_names=[""]):

        # the k are int32 which boost python does like to convert
        def reg(k):
            return tuple(int(x) for x in k)

        self._hop = dict((reg(k), numpy.array(v)) for k, v in hopping.items())
        orb = dict((str(i), orb) for (i, orb) in enumerate(orbital_positions))
        self.bl = BravaisLattice(units, orb)
        self.tb = TightBinding(self.bl, self._hop)  #, orbital_positions )
        self.dim = self.bl.dim
        self.NOrbitalsInUnitCell = self.bl.n_orbitals()
        self.Units = units
        self.OrbitalPositions = orbital_positions
        self.OrbitalNames = orbital_names
        self.MuPattern = numpy.identity(self.NOrbitalsInUnitCell)

    def latt_to_real_x(self, p):
        return self.bl.lattice_to_real_coordinates(
            numpy.array(p, numpy.float64))
        # modified since array are not converted automatically any more
        ##return self.bl.lattice_to_real_coordinates (p ) #numpy.array(p.float64))

    def hopping_dict(self):
        return self._hop

    def hopping(self, k_stack):
        return hopping_stack(self.tb, k_stack)
コード例 #2
0
ファイル: tight_binding.py プロジェクト: EBRUDU1/triqs
class TBLattice:

    def __init__ (self, units, hopping, orbital_positions = [ (0, 0, 0) ], orbital_names = [""]):

        # the k are int32 which boost python does like to convert 
        def reg(k) : return tuple( int(x) for x in k) 
        self._hop = dict ( ( reg(k), numpy.array(v)) for k, v in hopping.items())
        orb = dict ( (str(i), orb) for (i, orb) in enumerate(orbital_positions ))
        self.bl = BravaisLattice(units, orb)
        self.tb = TightBinding(self.bl, self._hop) #, orbital_positions )
        self.dim = self.bl.dim
        self.NOrbitalsInUnitCell = self.bl.n_orbitals()
        self.Units = units
        self.OrbitalPositions = orbital_positions 
        self.OrbitalNames = orbital_names
        self.MuPattern = numpy.identity(self.NOrbitalsInUnitCell)

    def latt_to_real_x(self, p) : 
        return self.bl.lattice_to_real_coordinates (numpy.array(p, numpy.float64))
        # modified since array are not converted automatically any more
        ##return self.bl.lattice_to_real_coordinates (p ) #numpy.array(p.float64))

    def hopping_dict(self) : return self._hop

    def hopping(self, k_stack) :
        return hopping_stack(self.tb, k_stack)
コード例 #3
0
    def __init__(self,
                 units,
                 hopping,
                 orbital_positions=[(0, 0, 0)],
                 orbital_names=[""]):

        # the k are int32 which boost python does like to convert
        def reg(k):
            return tuple(int(x) for x in k)

        self._hop = dict((reg(k), numpy.array(v)) for k, v in hopping.items())
        orb = dict((str(i), orb) for (i, orb) in enumerate(orbital_positions))
        self.bl = BravaisLattice(units, orbital_positions)
        self.tb = TightBinding(self.bl, self._hop)  #, orbital_positions )
        self.dim = self.bl.dim
        self.NOrbitalsInUnitCell = self.bl.n_orbitals
        self.Units = units
        self.OrbitalPositions = orbital_positions
        self.OrbitalNames = orbital_names
        self.MuPattern = numpy.identity(self.NOrbitalsInUnitCell)
コード例 #4
0
ファイル: tight_binding.py プロジェクト: JaksaVucicevic/triqs
    def __init__ (self, units, hopping, orbital_positions = [ (0, 0, 0) ], orbital_names = [""]):

        # the k are int32 which boost python does like to convert 
        def reg(k) : return tuple( int(x) for x in k) 
        self._hop = dict ( ( reg(k), numpy.array(v)) for k, v in hopping.items())
        orb = dict ( (str(i), orb) for (i, orb) in enumerate(orbital_positions ))
        self.bl = BravaisLattice(units, orbital_positions)
        self.tb = TightBinding(self.bl, self._hop) #, orbital_positions )
        self.dim = self.bl.dim
        self.NOrbitalsInUnitCell = self.bl.n_orbitals
        self.Units = units
        self.OrbitalPositions = orbital_positions 
        self.OrbitalNames = orbital_names
        self.MuPattern = numpy.identity(self.NOrbitalsInUnitCell)