def test1(self):
     "mccomponents.sample.phonon.multiphonon.computeAnESet"
     from dos import loadDOS
     dos = loadDOS()
     E = dos.energy
     dE = E[1] - E[0]
     g = dos.I
     # expand E a bit
     E = numpy.arange(E[0], 70, dE)
     g = numpy.concatenate((g, numpy.zeros(len(E)-len(g))))
     g/=g.sum()*dE
     from mccomponents.sample.phonon.multiphonon import computeAnESet
     kelvin2mev = 0.0862
     beta = 1./(300*kelvin2mev)
     E, An_set = computeAnESet(N=5, E=E, g=g, beta=beta, dE=dE)
     # check sum rule
     for An in An_set:
         self.assertAlmostEqual(An.sum() * dE, 1.)
     if interactive:
         import pylab
         for An in An_set:
             pylab.plot(E, An)
             continue
         pylab.show()
     return
    def test1(self):
        "multiphonon.computeAnESet: UN N dos"
        dos = readdos()
        E = dos.energy
        dE = E[1] - E[0]
        g = dos.I
        # expand E a bit
        E = numpy.arange(E[0], 500, dE)
        g = numpy.concatenate((g, numpy.zeros(len(E) - len(g))))

        g /= g.sum() * dE
        from mccomponents.sample.phonon.multiphonon import computeAnESet
        kelvin2mev = 0.0862
        beta = 1. / (5 * kelvin2mev)
        E, An_set = computeAnESet(N=10, E=E, g=g, beta=beta, dE=dE)
        import pylab
        for An in An_set:
            pylab.plot(E, An)
            continue
        pylab.show()
        return
 def test1(self):
     "multiphonon.computeAnESet: UN N dos"
     dos = readdos()
     E = dos.energy
     dE = E[1] - E[0]
     g = dos.I
     # expand E a bit
     E = numpy.arange(E[0], 500, dE)
     g = numpy.concatenate((g, numpy.zeros(len(E)-len(g))))
     
     g/=g.sum()*dE
     from mccomponents.sample.phonon.multiphonon import computeAnESet
     kelvin2mev = 0.0862
     beta = 1./(5*kelvin2mev)
     E, An_set = computeAnESet(N=10, E=E, g=g, beta=beta, dE=dE)
     import pylab
     for An in An_set:
         pylab.plot(E, An)
         continue
     pylab.show()
     return
Exemple #4
0
    def test1(self):
        "mccomponents.sample.phonon.multiphonon.computeAnESet"
        from dos import loadDOS
        dos = loadDOS()
        E = dos.energy
        dE = E[1] - E[0]
        g = dos.I
        # expand E a bit
        E = numpy.arange(E[0], 70, dE)
        g = numpy.concatenate((g, numpy.zeros(len(E) - len(g))))

        g /= g.sum() * dE
        from mccomponents.sample.phonon.multiphonon import computeAnESet
        kelvin2mev = 0.0862
        beta = 1. / (300 * kelvin2mev)
        E, An_set = computeAnESet(N=5, E=E, g=g, beta=beta, dE=dE)
        if interactive:
            import pylab
            for An in An_set:
                pylab.plot(E, An)
                continue
            pylab.show()
        return