def test_N2(siesta_factory): pynao = pytest.importorskip('pynao') print("pynao version: ", pynao.__version__) n2 = molecule('N2') # enter siesta input n2.calc = siesta_factory.calc(basis_set='DZP', fdf_arguments={ 'COOP.Write': True, 'WriteDenchar': True, 'XML.Write': True }) name = 'n2' pynao_args = dict(label="siesta", jcutoff=7, iter_broadening=0.15, xc_code='LDA,PZ', tol_loc=1e-6, tol_biloc=1e-7) rm = StaticRamanCalculator(n2, RamanCalculatorInterface, name=name, delta=0.011, exkwargs=pynao_args) rm.run() Pz = PlaczekStatic(n2, name=name) e_vib = Pz.get_energies() assert len(e_vib) == 6 Pz.summary()
def test_bulk(Cbulk, testdir): """Bulk FCC carbon (for EMT) self consistency""" delta = 0.02 name = 'bp' rm = StaticRamanCalculator(Cbulk, BondPolarizability, name=name, delta=delta) rm.run() pz = PlaczekStatic(Cbulk, name=name) e_vib = pz.get_energies() i_vib = pz.get_absolute_intensities() assert len(e_vib) == 6 pz.summary() name = 'phbp' rm = StaticRamanPhononsCalculator(Cbulk, BondPolarizability, calc=EMT(), name=name, delta=delta, supercell=(1, 1, 1)) rm.run() pz = PlaczekStaticPhonons(Cbulk, name=name) e_phonons = pz.get_energies() assert len(e_vib) == len(e_phonons) assert e_vib[3:] == approx(e_phonons[3:], 1) i_phonons = pz.get_absolute_intensities() assert i_vib[3:] == approx(i_phonons[3:], 1) pz.summary() assert rm.clean() == 25
def test_c3(testdir): """Can we calculate triangular (EMT groundstate) C3?""" y, z = 0.30646191, 1.14411339 # emt relaxed atoms = Atoms('C3', positions=[[0, 0, 0], [0, y, z], [0, z, y]]) atoms.calc = EMT() name = 'bp' rm = StaticRamanCalculator(atoms, BondPolarizability, name=name, exname=name, txt='-') rm.run() pz = PlaczekStatic(atoms, name=name) i_vib = pz.get_absolute_intensities() assert i_vib[-3:] == approx([5.36301901, 5.36680555, 35.7323934], 1e-6) pz.summary()