Extract pair correlation energies

They come with orbital labels that are the usual Molpro orbital.symmetry convention, with a - prefix if beta spin.

[2]:
from pymolpro import Project
[3]:
p=Project("pair_correlation_energies")
p.write_input("geometry={f;h,f,1.732};rhf;mp2;ccsd")
p.run(wait=True)
[4]:
for method in ["MP2", "CCSD"]:
    pair_energies=[float(s) for s in p.xpath('//jobstep[@command="'+method+'"]/pair/@energy')]
    first_orbitals=p.xpath('//jobstep[@command="'+method+'"]/pair/@orbital1')
    second_orbitals=p.xpath('//jobstep[@command="'+method+'"]/pair/@orbital2')
    correlation_energy=float(p.xpath('//jobstep[@command="'+method+'"]/property[@name="correlation energy"]/@value')[0])
    print(method,sum(pair_energies),correlation_energy,sum(pair_energies)-correlation_energy)
MP2 -0.20160732000000003 -0.201607332446729 1.2446728953063868e-08
CCSD -0.20679572000000007 -0.206795741784683 2.1784682918690734e-08
[5]:
for method in ["MP2", "CCSD"]:
    pair_energies=[float(s) for s in p.xpath('//jobstep[@command="'+method+'"]/pair/@energy')]
    print(method)
    for i in range(len(pair_energies)):
        print(first_orbitals[i],second_orbitals[i],pair_energies[i])
MP2
2.1 -2.1 -0.00422532
-2.1 2.1 -0.00422532
3.1 2.1 -0.00195003
-3.1 -2.1 -0.00195003
3.1 -2.1 -0.00605648
-3.1 2.1 -0.00605648
3.1 -3.1 -0.01091658
-3.1 3.1 -0.01091658
1.2 -1.2 -0.00830117
-1.2 1.2 -0.00830117
1.3 -1.3 -0.00830117
-1.3 1.3 -0.00830117
1.2 2.1 -0.00186616
-1.2 -2.1 -0.00186616
1.2 -2.1 -0.00531072
-1.2 2.1 -0.00531072
1.2 3.1 -0.00712749
-1.2 -3.1 -0.00712749
1.2 -3.1 -0.00850571
-1.2 3.1 -0.00850571
1.3 2.1 -0.00186616
-1.3 -2.1 -0.00186616
1.3 -2.1 -0.00531072
-1.3 2.1 -0.00531072
1.3 3.1 -0.00712749
-1.3 -3.1 -0.00712749
1.3 -3.1 -0.00850571
-1.3 3.1 -0.00850571
1.3 1.2 -0.0068056
-1.3 -1.2 -0.0068056
1.3 -1.2 -0.00862715
-1.3 1.2 -0.00862715
CCSD
2.1 -2.1 -0.0046273
-2.1 2.1 -0.0046273
3.1 2.1 -0.0016596
-3.1 -2.1 -0.0016596
3.1 -2.1 -0.00698549
-3.1 2.1 -0.00698549
3.1 -3.1 -0.01222224
-3.1 3.1 -0.01222224
1.2 -1.2 -0.00896781
-1.2 1.2 -0.00896781
1.3 -1.3 -0.00896781
-1.3 1.3 -0.00896781
1.2 2.1 -0.00158733
-1.2 -2.1 -0.00158733
1.2 -2.1 -0.00593049
-1.2 2.1 -0.00593049
1.2 3.1 -0.00644151
-1.2 -3.1 -0.00644151
1.2 -3.1 -0.0085311
-1.2 3.1 -0.0085311
1.3 2.1 -0.00158733
-1.3 -2.1 -0.00158733
1.3 -2.1 -0.00593049
-1.3 2.1 -0.00593049
1.3 3.1 -0.00644151
-1.3 -3.1 -0.00644151
1.3 -3.1 -0.0085311
-1.3 3.1 -0.0085311
1.3 1.2 -0.00621804
-1.3 -1.2 -0.00621804
1.3 -1.2 -0.00876871
-1.3 1.2 -0.00876871
[5]: