from qecalc.qetask.matdyntask import MatdynTask
from qecalc.qetask.pwtask import PWTask
from qeutils import kmesh
from qeutils.bandstobxsf import bandstobxsf


matdyn = MatdynTask('config.ini')
pw = PWTask('config.ini')

pw.input.parse()
matdyn.input.parse()

qmesh = [17,17,17]

qpoints = kmesh.kMeshCart(qmesh,pw.input.structure.lattice.reciprocalBase())

matdyn.input.qpoints.set(qpoints)
matdyn.input.save()

matdyn.launch()

#matdyn.output.parse()

modes, freqs, qpts = matdyn.output.property('multi phonon')

bands = kmesh.packBands(qmesh, freqs)
phononEnergy = 720.0
bandstobxsf(phononEnergy, pw.input.structure.lattice.reciprocalBase(), bands,\
'phonons.bxsf')

Exemple #2
0
    s = s + " END_BANDGRID_3D\n END_BLOCK_BANDGRID_3D"
    file.write(s)
    file.close()


if __name__ == "__main__":
    from qecalc.qetask.pwtask import PWTask
    from qeutils import kmesh

    pw = PWTask("config.ini")
    pw.input.parse()
    pw.output.parse()
    # print pw.output.property('fermi energy')
    kpoints = [17, 17, 17]

    bands = kmesh.packBands(kpoints, pw.output.property("bands")[1])
    #    numpy.zeros((pw.output.property('bands')[1].shape[1], kpoints[0], kpoints[1], kpoints[2]))
    #    print bands
    #    for iband in range(pw.output.property('bands')[1].shape[1]):
    #        for kz in range(kpoints[2]):
    #            for ky in range(kpoints[1]):
    #                for kx in range(kpoints[0]):
    #                    bands[iband,kx,ky,kz] = \
    #                      pw.output.property('bands')[1][\
    #                      kpoints[2]*kpoints[1]*kz + kpoints[1]*ky + kx,iband]
    # bands = pw.output.property('bands')[1].transpose().reshape(\
    #                             -1, kpoints[0],kpoints[1],kpoints[2])
    print bands
    print bands.shape
    # pw.output.property('fermi energy')[0]
    bandstobxsf(7.8071, pw.input.structure.lattice.reciprocalBase(), bands, "test.bxsf")
#                     (C) 2009  All Rights Reserved
#
# File coded by:      Nikolay Markovskiy
#
# See AUTHORS.txt for a list of people who contributed.
# See LICENSE.txt for license information.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

from qecalc.qetask.pwtask import PWTask
from qeutils import kmesh
from qeutils import bandstobxsf

if __name__ == "__main__":

    pw = PWTask('config.ini')
    pw.input.parse()
    pw.output.parse()
    print pw.output.property('fermi energy')

    kpoints = [17, 17, 17]

    bands = kmesh.packBands(kpoints, pw.output.property('bands')[1])

    bandstobxsf(7.8071, \
                pw.input.structure.lattice.reciprocalBase(), \
                bands, 'test.bxsf')

__author__ = "Nikolay Markovskiy"
__date__ = "$Dec 4, 2009 7:52:03 PM$"