def test_main(): silicon = bulk('Si') calc = Espresso(pseudopotentials=PSEUDO, ecutwfc=50.0) silicon.set_calculator(calc) silicon.get_potential_energy() assert calc.get_fermi_level() is not None assert calc.get_ibz_k_points() is not None assert calc.get_eigenvalues(spin=0, kpt=0) is not None assert calc.get_number_of_spins() is not None assert calc.get_k_point_weights() is not None
def main(): gold = bulk('Au') input_data = { 'system': { 'occupations': 'smearing', 'smearing': 'fermi-dirac', 'degauss': 0.02 } } calc = Espresso(pseudopotentials=PSEUDO, input_data=input_data) gold.set_calculator(calc) gold.get_potential_energy() assert calc.get_fermi_level() is not None assert calc.get_ibz_k_points() is not None assert calc.get_eigenvalues(spin=0, kpt=0) is not None assert calc.get_number_of_spins() is not None assert calc.get_k_point_weights() is not None
} calc = Espresso( kpts=kpts, pseudopotentials=gbrv_pp, tstress=True, tprnfor=True, # kwargs added to parameters input_data=input_data) atoms.calc = calc atoms.get_potential_energy() # Get the valence band maximum efermi = calc.get_fermi_level() Nk = len(calc.get_ibz_k_points()) Ns = calc.get_number_of_spins() eigval = np.array([[calc.get_eigenvalues(kpt=k, spin=s) for k in range(Nk)] for s in range(Ns)]) evbm = np.max(eigval[eigval < efermi]) # Next, a band structure calculation input_data['control'].update({ 'calculation': 'bands', 'restart_mode': 'restart', 'verbosity': 'high' }) calc.set(kpts={'path': spath, 'npoints': 50}, input_data=input_data) calc.calculate(atoms) bs_qe = calc.band_structure() bs_qe.reference = evbm