[gpaw-users] Phonon band structure

Kristen Kaasbjerg kkaa at fysik.dtu.dk
Thu Dec 16 18:22:15 CET 2010


Hi Jakob

The GPAW calculator exploits symmetries by default to reduce the number of
k-points in the ground-state calculation:

https://wiki.fysik.dtu.dk/gpaw/documentation/manual.html#parameters

As the atoms are displaced in the phonon calculation, the symmetry will be
broken.

Add the "usesymm" keyword in your calculator:

calc = GPAW(kpts=(2,2,2),
            h=0.2,
            usesymm=False,
            occupations=FermiDirac(0.1),
            convergence={'eigenstates': 1.0e-7})

Kristen

> I forgot to include the input python code:
>
> *********
> from ase.structure import bulk
> from ase.phonons import Phonons
> from gpaw import GPAW, FermiDirac
>
> # Setup crystal and GPAW calculator
> atoms = bulk('Al', 'fcc', a=4.05)
>
> calc = GPAW(kpts=(2,2,2),
>             h=0.2,
>             occupations=FermiDirac(0.1),
>             convergence={'eigenstates': 1.0e-7})
>
> # Phonon calculator
> N = 3
> ph = Phonons(atoms, calc, supercell=(N, N, N), delta=0.01,
> name='Jacapo-phonon')
> ph.run()
> ***********
>
> Jakob Blomquist wrote:
>> Hi
>> Everytime I try to use GPAW and the phonon module I get a symmetry error
>> after the first step (when one atom is moved once in one direction).
>>
>> ****************
>> Writing GPAW-phonon.eq.pckl
>> Traceback (most recent call last):
>>   File "Al-phonon.py", line 18, in <module>
>>     ph.run()
>>   File "/home/jakob/ase/ase/phonons.py", line 206, in run
>>     forces = atoms_lmn.get_forces()
>>   File "/home/jakob/ase/ase/atoms.py", line 536, in get_forces
>>     forces = self.calc.get_forces(self)
>>   File "/usr/local/lib/python2.6/dist-packages/gpaw/aseinterface.py",
>> line 61, in get_forces
>>     force_call_to_set_positions=force_call_to_set_positions)
>>   File "/usr/local/lib/python2.6/dist-packages/gpaw/paw.py", line 239,
>> in calculate
>>     self.set_positions(atomsWriting GPAW-phonon.eq.pckl
>> Traceback (most recent call last):
>>   File "Al-phonon.py", line 18, in <module>
>>     ph.run()
>>   File "/home/jakob/ase/ase/phonons.py", line 206, in run
>>     forces = atoms_lmn.get_forces()
>>   File "/home/jakob/ase/ase/atoms.py", line 536, in get_forces
>>     forces = self.calc.get_forces(self)
>>   File "/usr/local/lib/python2.6/dist-packages/gpaw/aseinterface.py",
>> line 61, in get_forces
>>     force_call_to_set_positions=force_call_to_set_positions)
>>   File "/usr/local/lib/python2.6/dist-packages/gpaw/paw.py", line 239,
>> in calculate
>>     self.set_positions(atoms)
>>   File "/usr/local/lib/python2.6/dist-packages/gpaw/paw.py", line 293,
>> in set_positions
>>     spos_ac = self.initialize_positions(atoms)
>>   File "/usr/local/lib/python2.6/dist-packages/gpaw/paw.py", line 285,
>> in initialize_positions
>>     self.wfs.set_positions(spos_ac)
>>   File "/usr/local/lib/python2.6/dist-packages/gpaw/wavefunctions.py",
>> line 914, in set_positions
>>     WaveFunctions.set_positions(self, spos_ac)
>>   File "/usr/local/lib/python2.6/dist-packages/gpaw/wavefunctions.py",
>> line 247, in set_positions
>>     self.symmetry.check(spos_ac)
>>   File "/usr/local/lib/python2.6/dist-packages/gpaw/symmetry.py", line
>> 139, in check
>>     raise RuntimeError('Broken symmetry!')
>> )
>>   File "/usr/local/lib/python2.6/dist-packages/gpaw/paw.py", line 293,
>> in set_positions
>>     spos_ac = self.initialize_positions(atoms)
>>   File "/usr/local/lib/python2.6/dist-packages/gpaw/paw.py", line 285,
>> in initialize_positions
>>     self.wfs.set_positions(spos_ac)
>>   File "/usr/local/lib/python2.6/dist-packages/gpaw/wavefunctions.py",
>> line 914, in set_positions
>>     WaveFunctions.set_positions(self, spos_ac)
>>   File "/usr/local/lib/python2.6/dist-packages/gpaw/wavefunctions.py",
>> line 247, in set_positions
>>     self.symmetry.check(spos_ac)
>>   File "/usr/local/lib/python2.6/dist-packages/gpaw/symmetry.py", line
>> 139, in check
>>     raise RuntimeError('Broken symmetry!')
>> ************
>> I use GPAW version 0.7.6383
>> The latest revision of the ase/phonon.py
>> and
>> ase version 3.4.0 stable revision
>>
>> Any suggestions?
>>
>> /Jakob Blomquist
>>
>> Kristen Kaasbjerg wrote:
>>
>>> I have now added a simple example to the ASE documentation illustrating
>>> how to use the new phonon module:
>>>
>>> https://wiki.fysik.dtu.dk/ase/ase/phonons.html#module-phonons
>>>
>>> A few figures will be added soon.
>>>
>>> Kristen
>>>
>>>
>>>
>>>
>>>> Dear GPAW-users,
>>>>
>>>> I am a post-doc in Kyoto university in Japan. I work for phonopy.
>>>> The Si band structure may be calculated as follows:
>>>>
>>>> from gpaw import GPAW
>>>> from ase import *
>>>> from ase.calculators import numeric_force
>>>> from phonopy import Phonopy
>>>> import numpy as np
>>>>
>>>> # GPAW setting
>>>> a = 5.404
>>>> bulk = Atoms(symbols='Si8',
>>>>              positions=[(0, 0, 0),
>>>>                         (0, 0.5, 0.5),
>>>>                         (0.5, 0, 0.5),
>>>>                         (0.5, 0.5, 0),
>>>>                         (0.25, 0.25, 0.25),
>>>>                         (0.25, 0.75, 0.75),
>>>>                         (0.75, 0.25, 0.75),
>>>>                         (0.75, 0.75, 0.25)],
>>>>              pbc=True)
>>>> bulk.set_cell((a, a, a), scale_atoms=True)
>>>>
>>>> n = 32
>>>> calc = GPAW(gpts=(n, n, n),
>>>>             nbands=8*3,
>>>>             width=0.01,
>>>>             kpts=(2, 2, 2),
>>>>             convergence={'eigenstates': 1e-7}
>>>>             )
>>>>
>>>> # Phonopy pre-process
>>>> print "------"
>>>> print "Phonon"
>>>> print "------"
>>>> # 1st arg. is the input unit cell.
>>>> # 2nd arg. is the supercell lattice relative to the unit cell.
>>>> # 'distance' is the distance of displacements.
>>>> # Default symmetry tolerance is 1e-5 in fractional coordinates.
>>>> phonon = Phonopy(bulk, [[1,0,0],[0,1,0],[0,0,1]], distance=0.01)
>>>> symmetry = phonon.get_symmetry()
>>>> print "Space group:", symmetry.get_international_table()
>>>>
>>>>
>>>> phonon.print_displacements()
>>>> supercells = phonon.get_supercells_with_displacements()
>>>>
>>>> # Force calculations
>>>> set_of_forces = []
>>>> for scell in supercells:
>>>>     cell = Atoms( symbols=scell.get_chemical_symbols(),
>>>>                   scaled_positions=scell.get_scaled_positions(),
>>>>                   cell=scell.get_cell(),
>>>>                   pbc=True )
>>>>     cell.set_calculator(calc)
>>>>     forces = cell.get_forces()
>>>>     drift_force = forces.sum(axis=0)
>>>>     print "        ---------------------------------"
>>>>     print "     ", "%11.5f"*3 % tuple(drift_force)
>>>>     # Simple translational invariance
>>>>     for force in forces:
>>>>         force -= drift_force / forces.shape[0]
>>>>     set_of_forces.append(forces)
>>>>
>>>> # Phonopy post-process
>>>> # 1st arg. is a relative lattice to the input unit cell.
>>>> # 2nd arg. is bunch of the calculated forces.
>>>> phonon.set_post_process([[0,0.5,0.5],[0.5,0,0.5],[0.5,0.5,0]],
>>>> set_of_forces)
>>>>
>>>> # Phonon dispersion relation
>>>> bands = []
>>>>
>>>> q_start  = np.array([0.5,0.5,0.0])
>>>> q_end    = np.array([0.0,0.0,0.0])
>>>> band = []
>>>> for i in range(51):
>>>>     band.append( q_start + ( q_end - q_start ) / 50 * i )
>>>>
>>>> bands.append(band)
>>>>
>>>> q_start  = np.array([0.0,0.0,0.0])
>>>> q_end    = np.array([0.5,0.0,0.0])
>>>> band = []
>>>> for i in range(51):
>>>>     band.append( q_start + ( q_end - q_start ) / 50 * i )
>>>>
>>>> bands.append(band)
>>>>
>>>> #*********************
>>>> # Matplotlib required
>>>> #*********************
>>>> print "\nPhonon dispersion:"
>>>> phonon.set_band_structure( bands )
>>>> phonon.plot_band_structure().show()
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Togo
>>>>
>>>> On Fri, Dec 3, 2010 at 7:02 PM, Kristen Kaasbjerg <kkaa at fysik.dtu.dk>
>>>> wrote:
>>>>
>>>>
>>>>
>>>>> If someone finds it useful then why not ?
>>>>> I should stress though, that the ASE implementation has features for
>>>>> calculating phonon dispersion and mode visualization with ag.
>>>>>
>>>>> By the way, frophon code seem to have been replaced by the Phononpy
>>>>> code:
>>>>> http://phonopy.sourceforge.net/
>>>>>
>>>>> Kristen
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> by looking at the latest abinit release one can see that they
>>>>>> "Print out VASP-style POSCAR and FORCES files, for use with PHON or
>>>>>> frophon codes for frozen phonon calculations."
>>>>>> http://www.abinit.org/documentation/helpfiles/for-v6.4/release_notes/release_notes.html
>>>>>>
>>>>>> Could this way be also interesting for us?
>>>>>> website of phon: http://www.homepages.ucl.ac.uk/~ucfbdxa/phon/
>>>>>>
>>>>>> Marcin
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> _______________________________________________
>>>>> gpaw-users mailing list
>>>>> gpaw-users at listserv.fysik.dtu.dk
>>>>> https://listserv.fysik.dtu.dk/mailman/listinfo/gpaw-users
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>> _______________________________________________
>>> gpaw-users mailing list
>>> gpaw-users at listserv.fysik.dtu.dk
>>> https://listserv.fysik.dtu.dk/mailman/listinfo/gpaw-users
>>>
>>>
>>
>> _______________________________________________
>> gpaw-users mailing list
>> gpaw-users at listserv.fysik.dtu.dk
>> https://listserv.fysik.dtu.dk/mailman/listinfo/gpaw-users
>>
>




More information about the gpaw-users mailing list