def test_all_states(rrname, atoms): """Include degenerate states""" om = 1 gam = 0.1 ao = Albrecht(atoms, H2MorseExcitedStates, name=rrname, overlap=True, approximation='Albrecht A', txt=None) aoi = ao.get_absolute_intensities(omega=om, gamma=gam)[-1] al = Albrecht(atoms, H2MorseExcitedStates, name=rrname, approximation='Albrecht A', txt=None) ali = al.get_absolute_intensities(omega=om, gamma=gam)[-1] assert ali == pytest.approx(aoi, 1e-5)
def test_one_state(rrname, atoms): om = 1 gam = 0.1 ao = Albrecht(atoms, H2MorseExcitedStates, exkwargs={'nstates': 1}, name=rrname, overlap=True, approximation='Albrecht A', txt=None) aoi = ao.get_absolute_intensities(omega=om, gamma=gam)[-1] al = Albrecht(atoms, H2MorseExcitedStates, exkwargs={'nstates': 1}, name=rrname, approximation='Albrecht A', txt=None) ali = al.get_absolute_intensities(omega=om, gamma=gam)[-1] assert ali == pytest.approx(aoi, 1e-9)
def test_compare_placzek_albrecht_intensities(testdir): atoms = H2Morse() name = 'rrmorse' rmc = ResonantRamanCalculator(atoms, H2MorseExcitedStatesCalculator, overlap=lambda x, y: x.overlap(y), name=name, txt='-') rmc.run() om = 1 gam = 0.1 pri, ali = 0, 0 """Albrecht A and P-P are approximately equal""" pr = Profeta(atoms, H2MorseExcitedStates, name=name, overlap=True, approximation='p-p', txt=None) pri = pr.get_absolute_intensities(omega=om, gamma=gam)[-1] al = Albrecht(atoms, H2MorseExcitedStates, name=name, overlap=True, approximation='Albrecht A', txt=None) ali = al.get_absolute_intensities(omega=om, gamma=gam)[-1] print('pri, ali', pri, ali) assert pri == pytest.approx(ali, 1e-2) """Albrecht B+C and Profeta are approximately equal""" pr.approximation = 'Profeta' pri = pr.get_absolute_intensities(omega=om, gamma=gam)[-1] al.approximation = 'Albrecht BC' ali = al.get_absolute_intensities(omega=om, gamma=gam)[-1] print('pri, ali', pri, ali) assert pri == pytest.approx(ali, 1e-2) """Albrecht and Placzek are approximately equal""" pr.approximation = 'Placzek' pri = pr.get_absolute_intensities(omega=om, gamma=gam)[-1] al.approximation = 'Albrecht' ali = al.get_absolute_intensities(omega=om, gamma=gam)[-1] print('pri, ali', pri, ali) assert pri == pytest.approx(ali, 1e-2)