def input_scf_phonon_si_low(): pseudos = abidata.pseudos("14si.pspnc") structure = get_si_structure() scf_in = scf_for_phonons(structure, pseudos, kppa=100, ecut=4, spin_mode="unpolarized", accuracy="low", smearing=None) return scf_in
def test_scf_for_phonons(self): """Testing scf_for_phonons.""" from abipy.abio.factories import scf_for_phonons scf_inp = scf_for_phonons(self.si_structure, self.si_pseudo, kppa=1000, ecut=3) scf_inp.abivalidate()
def input_scf_phonon_gan_low(): pseudos = [abidata.pseudos("31ga.pspnc").pseudo_with_symbol('Ga'), abidata.pseudos("7n.pspnc").pseudo_with_symbol('N')] structure = get_gan_structure() scf_in = scf_for_phonons(structure, pseudos, kppa=100, ecut=4, spin_mode="unpolarized", accuracy="low", smearing=None) return scf_in
def test_scf_for_phonons(self): """Testing scf_for_phonons.""" from abipy.abio.factories import scf_for_phonons scf_inp = scf_for_phonons(self.si_structure, self.si_pseudo, kppa=1000, ecut=3) self.abivalidate_input(scf_inp) if False: with open('scf_for_phonons.json', mode='w') as fp: json.dump(scf_inp.as_dict(), fp, indent=2) self.assert_input_equality('scf_for_phonons.json', scf_inp) factory_obj = ScfForPhononsFactory(self.si_structure, self.si_pseudo, kppa=1000, ecut=3) self.assertMSONable(factory_obj) scf_inp_obj = factory_obj.build_input(scf_inp) self.assert_input_equality('scf_for_phonons.json', scf_inp_obj)
def test_scf_for_phonons(self): """Testing scf_for_phonons.""" from abipy.abio.factories import scf_for_phonons scf_inp = scf_for_phonons(self.si_structure, self.si_pseudo, kppa=1000, ecut=3) self.abivalidate_input(scf_inp) if False: print("Updating json reference files.") #with open('scf_for_phonons.json', mode='w') as fp: # json.dump(scf_inp.as_dict(), fp, indent=2) self.assert_input_equality('scf_for_phonons.json', scf_inp) factory_obj = ScfForPhononsFactory(self.si_structure, self.si_pseudo, kppa=1000, ecut=3) self.assertMSONable(factory_obj) scf_inp_obj = factory_obj.build_input(scf_inp) self.assert_input_equality('scf_for_phonons.json', scf_inp_obj)
def AbinitNscfTasks(structure, kpoints, ecut, nscf_bands, nscf_kpoints=None, **kwargs): from abipy.core.structure import Structure from abipy.abio.factories import scf_for_phonons from pymatgen.core.units import bohr_to_ang #extract pseudos pseudo_list = [] for atype, (mass, pseudo) in structure['atypes'].items(): pseudo_list.append(pseudo) pseudo_table = kwargs.pop("pseudo_table", pseudo_list) #create a PwInput file just to read the ibrav from structure qe_input = PwIn.from_structure_dict(structure) lattice, coords, species = qe_input.get_cell() lattice = [[col * bohr_to_ang for col in row] for row in lattice] structure = Structure(lattice, species, coords) #create an AbinitInput file from structure spin_mode = kwargs.pop('spin_mode', 'unpolarized') smearing = kwargs.pop('smearing', 'nosmearing') inp = scf_for_phonons(structure, pseudo_table, spin_mode=spin_mode, smearing=smearing, ecut=ecut / 2) return AbinitNscfTasksFromAbinitInput(inp, kpoints, ecut, nscf_bands, nscf_kpoints=nscf_kpoints, **kwargs)