Initialization

HaToeV=27.21138602;

SetDirectory["~/Dropbox/Manuscripts/srDFT/Data"];

Needs["NumericalDifferentialEquationAnalysis`"]

Needs["ErrorBarPlots`"];

Needs["MaTeX`"]
SetOptions[MaTeX,"Preamble"->{"\\usepackage{amssymb,amsmath,latexsym,amsfonts,amsthm,mathpazo,xcolor,bm,mhchem}"}];

Flush[file_,shift_:0]:=Module[{DataFile,nState,nData,nDet,var,pt2,t1,t2,t3,res,extrap,fit,FormFit,nFit},
(* Import data *)
DataFile=Flatten[Import[StringJoin[file,".dat"],"Data"]];
{nState,nData} ={DataFile[[1]],DataFile[[2]]};
nDet=DataFile[[3;;nData+2]];
var=ArrayReshape[DataFile[[nData+3;;nData+2+nData nState]],{nData,nState}];
pt2=ArrayReshape[DataFile[[nData+3+nData nState;;nData+2+2nData nState]],{nData,nState}];

(* Compute excitation energies *)
nFit=3;
t1=Table[var[[k]][[Ordering[pt2[[k]]]]],{k,nData}];
t2=Table[Sort[pt2[[k]]],{k,nData}];
Print["Sorted PT2 energies"];Print[TableForm[t2]];
Print["Data to be extrapolated"];Print[TableForm[Table[{t2[[k,n]]-t1[[k,n]],t1[[k,n]]},{n,nState},{k,nData}]]];(*fit=Table[Fit[Take[Table[{t2[[k,n]]-t1[[k,n]],t1[[k,n]]},{k,nData}],-nFit],{1,e},e],{n,nState}];*)
FormFit=a+b e;
fit=Table[FindFit[Take[Table[{t2[[k,n]]-t1[[k,n]],t1[[k,n]]},{k,nData}],-nFit],FormFit,{a,b},e],{n,nState}];
Print[TableForm[Table[{n,fit[[n]]},{n,nState}],TableAlignments->Center,TableHeadings->{None,{"State", "Linear fit"}}]];
t3=Table[FormFit/.fit[[n]]/.e->0,{n,nState}];
res=Table[Flatten[{nDet[[k]],SetAccuracy[Table[(t2[[k,n]]-shift)HaToeV,{n,nState}],3]}],{k,nData}];
extrap=Flatten[{∞,SetAccuracy[Table[(t3[[n]]-shift)HaToeV,{n,nState}],3]}];
Print[TableForm[Append[res,Flatten[extrap]],TableAlignments->Center,TableHeadings->{None,Flatten[{"nDet",Table[ToString[k],{k,nState}]}]}]];

(* Print stuff *)
Do[
Print[Show[{ListLogLinearPlot[res[[;;,{1,k}]],Joined->True,PlotMarkers->Automatic,PlotTheme->"Scientific",FrameLabel->{"Number of determinants","Excitation energy (eV)"},BaseStyle->16],Plot[extrap[[k]],{x,0,(10^7)},PlotTheme->"Scientific"]}]];
,{k,nState}];

(* Print stuff *)
(*Print[Show[{ListLogLinearPlot[Evaluate[Table[res[[;;,{1,k+1}]]-extrap[[k+1]],{k,nState-1}]],Joined->True,PlotMarkers->Automatic,PlotTheme->"Vibrant",Frame->True,PlotRange->{{(10^3),6 (10^6)},{-0.1,0.15}},ImageSize->Large,PlotLegends->Placed[{MaTeX["B_1(n,3s)",Magnification->2],MaTeX["A_2(n,3p)",Magnification->2],MaTeX["A_1(n,3s)",Magnification->2]},{Right,Top}],
FrameLabel->{MaTeX["N_\\text{det}",Magnification->2],MaTeX["{}^1 \\omega - {}^1 \\omega_\\text{ex} \\text{ (eV)}",Magnification->2]},BaseStyle->16]}]];
*)
Return[":-)"]
];

CBSExtrap[tab_]:=Module[{FitCBS,tab1},
FitCBS=b+(a/(((L+1/2))^3));
tab1=Table[Limit[FitCBS/.FindFit[tab[[;;,{1,k}]],FitCBS,{a,b},L],L->∞],{k,2,5}];
Print[tab1];
Return[SetAccuracy[(tab1[[2;;Length[tab1]]]-tab1[[1]])HaToeV,3]];

];

CBSExtrap[tab_,nStates_]:=Module[{FitCBS,tab1},
FitCBS=b+(a/(((L+1/2))^3));
tab1=Table[Limit[FitCBS/.FindFit[tab[[;;,{1,k}]],FitCBS,{a,b},L],L->∞],{k,2,nStates+1}];
Print[tab1];
Return[SetAccuracy[(tab1[[2;;Length[tab1]]]-tab1[[1]])HaToeV,3]];

];

Ε[τ_,e_,δ_]:=With[{T=(1/(τ (δ^2)))},((2(∑_(i=1)^(Length[τ]))(∑_(j=1)^(Length[τ]))e[[i]]T[[i]]T[[j]]τ[[i]]((τ[[j]])^2)(τ[[j]]-τ[[i]]))/((∑_(i=1)^(Length[τ]))(∑_(j=1)^(Length[τ]))T[[i]]T[[j]]τ[[i]]τ[[j]](((τ[[j]]-τ[[i]]))^2)))];
Δ[τ_,δ_]:=With[{T=(1/(τ (δ^2)))},(Sqrt[4(∑_(k=1)^(Length[τ]))T[[k]]τ[[k]]((((((∑_(j=1)^(Length[τ]))T[[j]]((τ[[j]])^2)(τ[[j]]-τ[[k]]))/((∑_(i=1)^(Length[τ]))(∑_(j=1)^(Length[τ]))T[[i]]T[[j]]τ[[i]]τ[[j]](((τ[[j]]-τ[[i]]))^2)))))^2)])];

Extrap3[tab_]:=Module[{τ,e,δ,Res},
Res=Table[
τ=tab[[k,;;,1]];
e=tab[[k,;;,2]];
δ=tab[[k,;;,3]];
{SetPrecision[Ε[τ,e,δ],7],SetPrecision[Δ[τ,δ],2]}
,{k,Length[tab]}];
Return[Res];
];

JoinTab[tab1_,tab2_]:=Table[Flatten[{tab1[[k,1]],tab1[[k,2;;9]],tab2[[k,2;;7]]}],{k,4}];

FormatTab[Tab_]:=TableForm[Table[{ScientificForm[Tab[[k,1]]],Table[{SetAccuracy[HaToeV(Tab[[k,i]]-Tab[[k,2]]),3],SetPrecision[HaToeV(Sqrt[((Tab[[k,i+1]])^2)+((Tab[[k,3]])^2)]),1]},{i,2,14,2}]},{k,4}]
,TableHeadings->{None,{"ϵ","(Subscript[E, x])   Error"}}]

errorBar[type_: "Rectangle"][{{x0_,x1_},{y0_,y1_}},value_,meta_]:=Block[{error,mags=QuantityMagnitude[value]},error=Flatten[QuantityMagnitude[meta]];
error=If[error==={},0,Last[error]];{ChartElementData[type][{{x0,x1},{y0,y1}},mags,meta],{Black,{Thickness[0.0015],Line[{{{(x0+x1)/2,y1-error},{(x0+x1)/2,y1+error}},{{1/4 (3 x0+x1),y1+error},{1/4 (x0+3 x1),y1+error}},{{1/4 (3 x0+x1),y1-error},{1/4 (x0+3 x1),y1-error}}}]}}}]

ortlinfit[data_?MatrixQ,errs_?MatrixQ]:=Module[{n=Length[data],c,ct,dk,dm,k,m,p,s,st,ul,vl,w,wt,xm,ym,covmm,covkk,covmk,covkm},(*yes,I know I could have used FindFit[] for this...*){ct,st,k}=Flatten[MapAt[Normalize[{1,#}]&,NArgMin[Norm[Function[{x,y},y-\[FormalM] x-\[FormalK]]@@@data],{\[FormalM],\[FormalK]}],1]];
(*find orthogonal regression coefficients*){c,s,p}=FindArgMin[{Total[(data.{-\[FormalS],\[FormalC]}-\[FormalP])^2/((errs^2).{\[FormalS]^2,\[FormalC]^2})],\[FormalC]^2+\[FormalS]^2==1},{{\[FormalC],ct},{\[FormalS],st},{\[FormalP],k/ct}}];
(*slope and intercept*){m,k}={s,p}/c;
wt=1/errs^2;w=(Times@@@wt)/(wt.{1,m^2});
{xm,ym}=w.data/Total[w];
ul=data[[All,1]]-xm;vl=data[[All,2]]-ym;
(*uncertainties in slope and intercept*)dm=w.(m ul-vl)^2/w.ul^2/(n-2);
dk=dm (w.data[[All,1]]^2/Total[w]);
covmm=Total@MapThread[1/(m^2 #1[[1]]^2+#1[[2]]^2)^3 2 ((m^2 #1[[1]]^2+#1[[2]]^2)^2 #2[[1]]^2-4 m #1[[1]]^2 (m^2 #1[[1]]^2+#1[[2]]^2) #2[[1]] (k+m #2[[1]]-#2[[2]])+4 m^2 #1[[1]]^4 (k+m #2[[1]]-#2[[2]])^2-#1[[1]]^2 (m^2 #1[[1]]^2+#1[[2]]^2) (k+m #2[[1]]-#2[[2]])^2)&,{errs,data}];
covkm=Total@MapThread[(-4 k m #1[[1]]^2-2 m^2 #1[[1]]^2 #2[[1]]+2 #1[[2]]^2 #2[[1]]+4 m #1[[1]]^2 #2[[2]])/(m^2 #1[[1]]^2+#1[[2]]^2)^2&,{errs,data}];
covmk=Total@MapThread[(-4 k m #1[[1]]^2-2 m^2 #1[[1]]^2 #2[[1]]+2 #1[[2]]^2 #2[[1]]+4 m #1[[1]]^2 #2[[2]])/(m^2 #1[[1]]^2+#1[[2]]^2)^2&,{errs,data}];
covkk=Total@MapThread[2/(m^2 #1[[1]]^2+#1[[2]]^2)&,{errs,data}];
{Function[\[FormalX],Evaluate[{m,k}.{\[FormalX],1}]],Sqrt[{dm,dk}],Sqrt@Diagonal[2*Inverse@{{covmm,covkm},{covmk,covkk}}]}]/;Dimensions[data]===Dimensions[errs]

SizeLegend=1.5;
SizeChart=2;
SizeLabel=2;

Data & Figures

Ammonia

Ref$NH3={
6.66,8.21,8.65,9.19,6.37
};

ω$NH3$CI={
{6.48,6.59,6.64},{8.08,8.16,8.22},{9.68,9.33,9.14},
{10.41,9.96,},{6.19,6.31,6.35}
};
Δω$NH3$srDFT={
{0.1008514883,0.0012833642,},{0.0514229888,-0.0121483766,},
{0.0671177537,0.0039381914,},{-0.0013915474,-0.1081230353,},{0.0823135186,0.0201663160,}
};

NH3GraphOptions={
ChartStyle->"TemperatureMap",
ChartElementFunction->errorBar["Rectangle"],
ImageSize->Full,
Frame->True,
BaseStyle->12,
BarSpacing->{0,1/2},
FrameTicks->{Automatic,Automatic},
GridLines->{{6,11.5,17,22.5,28},Automatic},
FrameLabel->{None,MaTeX["\\text{Error in excitation energy (eV)}",Magnification->1]},
PlotRange->{{1.25,32.75},{-0.07,0.15}},
AspectRatio->1/3
};

Table[ω$NH3$CI[[k,l]]+Δω$NH3$srDFT[[k,l]]-Ref$NH3[[k]],{k,Length[Ref$NH3]},{l,Length[ω$NH3$CI[[k]]]}]

Chart$NH3$CI=BarChart[Table[(ω$NH3$CI[[k,l]]-Ref$NH3[[k]]),{k,Length[Ref$NH3]},{l,Length[ω$NH3$CI[[k]]]}],
ChartStyle->"Pastel",
ImageSize->Full,
Frame->True,
GridLines->{{4,7.5,11,14.5},Automatic},
BaseStyle->12,
ImagePadding->{{All,All},{None,None}},
BarSpacing->{0,1/2},
FrameTicks->{Automatic,Automatic},
Epilog->Text[MaTeX["\\text{\\ce{NH3}: exFCI}",Magnification->SizeLabel],Offset[{20,-50},Scaled[{0,1}]],{-1,0}],
FrameLabel->{None,MaTeX["\\text{Error in excitation energy (eV)}",Magnification->1.5]},
PlotRange->{{1,17.5},{-0.20,1.2}},
AspectRatio->1/3,ChartLegends->Placed[{MaTeX["\\text{AVDZ}",Magnification->SizeLegend],MaTeX["\\text{AVTZ}",Magnification->SizeLegend],MaTeX["\\text{AVQZ}",Magnification->SizeLegend]},{Right,Top}]];

Chart$NH3$srDFT=BarChart[Table[ω$NH3$CI[[k,l]]+Δω$NH3$srDFT[[k,l]]-Ref$NH3[[k]],{k,Length[Ref$NH3]},{l,Length[ω$NH3$CI[[k]]]}],
ChartStyle->"Pastel",
ImageSize->Full,
Frame->True,
GridLines->{{4,7.5,11,14.5},Automatic},
BaseStyle->12,
ImagePadding->{{All,All},{All,All}},
BarSpacing->{0,1/2},
FrameTicks->{Automatic,Automatic},
Epilog->Text[MaTeX["\\text{\\ce{NH3}: exFCI+srLDA}",Magnification->SizeLabel],Offset[{20,-50},Scaled[{0,1}]],{-1,0}],
FrameLabel->{None,MaTeX["\\text{Error in excitation energy (eV)}",Magnification->1.5]},
PlotRange->{{1,17.5},{-0.20,1.2}},
ChartLabels->{{
MaTeX["{}^1 A_2 (n \\rightarrow 3s)",Magnification->SizeChart],
MaTeX["{}^1 E (n \\rightarrow 3p)",Magnification->SizeChart],
MaTeX["{}^1 A_1 (n \\rightarrow 3p)",Magnification->SizeChart],
MaTeX["{}^1 A_2 (n \\rightarrow 4s)",Magnification->SizeChart],
MaTeX["{}^3 A_2 (n \\rightarrow 3s)",Magnification->SizeChart]},None},
AspectRatio->1/3
];

Column[{Chart$NH3$CI,Chart$NH3$srDFT},Spacings->0]

Ethylene

Formaldehyde

Methylene

HBCI energies

E$HBCI$CH2={{-39.08849,-39.07404,-39.03711,-38.99603}};

Ex$HBCI$CH2=Table[(E$HBCI$CH2[[a,b+1]]-E$HBCI$CH2[[a,1]])HaToeV,{a,1},{b,3}];
TableForm[
SetAccuracy[Ex$HBCI$CH2,4]
,TableHeadings->{{"AVQZ"}, {"1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[B, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->2\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])"}},TableAlignments->Center]

exFCI energies

E$exFCI$CH2={
{-39.04846,-39.03225,-38.99203,-38.95076},
{-39.08064,-39.06565,-39.02833,-38.98709},
{-39.08854,-39.07402,-39.03711,-38.99607},
{-39.09079,-39.07647,-39.03964,-38.99867}
};

Ex$exFCI$CH2=Table[(E$exFCI$CH2[[a,b+1]]-E$exFCI$CH2[[a,1]])HaToeV,{a,4},{b,3}];
TableForm[
SetAccuracy[Ex$exFCI$CH2,4]
,TableHeadings->{{"AVDZ","AVTZ","AVQZ","AV5Z"}, {"1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[B, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->2\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])"}},TableAlignments->Center]

srDFT corrections

Data

Δ$srLDA$HF$CH2={
{-0.0673300961,-0.0705202569,-0.0691918521,-0.0691524932},
{-0.0383266548,-0.0400580108,-0.0393783232,-0.0393373493},
{-0.0257396573,-0.0266694456,-0.0263694748,-0.0263865575}
};
Δ$srLDA$CIPSI$CH2={
{-0.0659655691,-0.0694412579,-0.0697992501,-0.0684985618},
{-0.0372886841,-0.0390512224,-0.0389904476,-0.0384719220},
{-0.0252326401,-0.0261312082,-0.0260889269,-0.0258905042},
};
Δ$srPBE$HF$CH2={
{-0.0603756068,-0.0633173372,-0.0630745566,-0.0647486708},
{-0.0376916868,-0.0389762464,-0.0387547694,-0.0395325506},
{-0.0277199714,-0.0282854317,-0.0282464474,-0.0286542766}
};
Δ$srPBE$CIPSI$CH2={
{-0.0593512954,-0.0624098268,-0.0636129589,-0.0641108995},
{-0.0369966524,-0.0382777284,-0.0384756772,-0.0388209327},
{-0.0273710951,-0.0279213259,-0.0280491216,-0.0282714613}
};

(Subscript[srLDA, HF])

ΔEx$srLDA$HF$CH2=Table[(Δ$srLDA$HF$CH2[[a,b+1]]-Δ$srLDA$HF$CH2[[a,1]])HaToeV,{a,3},{b,3}];
TableForm[
SetAccuracy[ΔEx$srLDA$HF$CH2,4]
,TableHeadings->{{"AVDZ","AVTZ","AVQZ","AV5Z"}, {"1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[B, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->2\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])"}},TableAlignments->Center]

TableForm[
SetAccuracy[Ex$exFCI$CH2[[1;;3]]+ΔEx$srLDA$HF$CH2,4]
,TableHeadings->{{"AVDZ","AVTZ","AVQZ","AV5Z"}, {"1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[B, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->2\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])"}},TableAlignments->Center]

(Subscript[srLDA, CIPSI])

ΔEx$srLDA$CIPSI$CH2=Table[(Δ$srLDA$CIPSI$CH2[[a,b+1]]-Δ$srLDA$CIPSI$CH2[[a,1]])HaToeV,{a,3},{b,3}];
TableForm[
SetAccuracy[ΔEx$srLDA$CIPSI$CH2,4]
,TableHeadings->{{"AVDZ","AVTZ","AVQZ","AV5Z"}, {"1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[B, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->2\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])"}},TableAlignments->Center]

TableForm[
SetAccuracy[Ex$exFCI$CH2[[1;;3]]+ΔEx$srLDA$CIPSI$CH2,4]
,TableHeadings->{{"AVDZ","AVTZ","AVQZ","AV5Z"}, {"1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[B, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->2\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])"}},TableAlignments->Center]

(Subscript[srPBE, HF])

ΔEx$srPBE$HF$CH2=Table[(Δ$srPBE$HF$CH2[[a,b+1]]-Δ$srPBE$HF$CH2[[a,1]])HaToeV,{a,3},{b,3}];
TableForm[
SetAccuracy[ΔEx$srPBE$HF$CH2,4]
,TableHeadings->{{"AVDZ","AVTZ","AVQZ","AV5Z"}, {"1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[B, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->2\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])"}},TableAlignments->Center]

TableForm[
SetAccuracy[Ex$exFCI$CH2[[1;;3]]+ΔEx$srPBE$HF$CH2,4]
,TableHeadings->{{"AVDZ","AVTZ","AVQZ","AV5Z"}, {"1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[B, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->2\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])"}},TableAlignments->Center]

(Subscript[srPBE, CIPSI])

ΔEx$srPBE$CIPSI$CH2=Table[(Δ$srPBE$CIPSI$CH2[[a,b+1]]-Δ$srPBE$CIPSI$CH2[[a,1]])HaToeV,{a,3},{b,3}];
TableForm[
SetAccuracy[ΔEx$srPBE$CIPSI$CH2,4]
,TableHeadings->{{"AVDZ","AVTZ","AVQZ","AV5Z"}, {"1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[B, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->2\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])"}},TableAlignments->Center]

TableForm[
SetAccuracy[Ex$exFCI$CH2[[1;;3]]+ΔEx$srPBE$CIPSI$CH2,4]
,TableHeadings->{{"AVDZ","AVTZ","AVQZ","AV5Z"}, {"1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->1\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[B, 1])","1\!\(\*SuperscriptBox[\(\\ \), \(3\)]\)(Subscript[B, 1])->2\!\(\*SuperscriptBox[\(\\ \), \(1\)]\)(Subscript[A, 1])"}},TableAlignments->Center]

Water

Ref$H2O={
7.70,9.47,9.97,
7.33,9.30,9.59
};

H2OGraphOptions={
ChartStyle->"TemperatureMap",
ChartElementFunction->errorBar["Rectangle"],
ImageSize->Full,
Frame->True,
BaseStyle->12,
BarSpacing->{0,1/2},
FrameTicks->{Automatic,Automatic},
GridLines->{{6,11.5,17,22.5,28},Automatic},
FrameLabel->{None,MaTeX["\\text{Error in excitation energy (eV)}",Magnification->1]},
PlotRange->{{1.25,32.75},{-0.07,0.15}},
AspectRatio->1/3
};

ω$H2O$CI={
{7.53,7.63,7.68,7.70},{9.32,9.41,9.46,9.48},{9.94,9.99,10.03,10.03},
{7.14,7.25,7.30,7.31},{9.14,9.24,9.29,9.30},{9.48,9.54,9.58,9.58}
};
Δω$H2O$srDFT$3={
{0.1437500765,0.0549792602,,},{0.1098470108,0.0230577122,,},{0.1309149766,0.0486453064,,},
{0.1557795122,0.1213008819,,},{0.1557795122-0.0075998416,0.1213008819-0.0121635742,,},{0.1557795122-0.0223316767,0.1213008819-0.0137501974,,}
};
Δω$H2O$srDFT$4={
{0.1325893457,0.0496824716,0.0252675418,},{0.1061492211,0.0285095460,0.0031276591,},{0.1168442860,0.0321339301,0.0159183092,},
{0.1309108378,0.0515790571,0.0250776933,},{0.1309108378-0.0251093674,0.0515790571-0.0183309670,0.0250776933-0.0155135668,},{0.1309108378-0.0144709213,0.0515790571-0.0090641197,0.0250776933-0.0081108363,}
};

FindFit[{{2,0.1325893457},{3,0.0496824716},{4,0.0252675418}},a+(b/(L^c)),{a,b,c},L]
FindFit[{{2,0.1061492211},{3,0.0285095460},{4,0.0031276591}},a+(b/(L^c)),{a,b,c},L]
FindFit[{{2,0.1168442860},{3,0.0321339301},{4,0.0159183092}},a+(b/(L^c)),{a,b,c},L]
FindFit[{{2,0.1309108378},{3,0.0515790571},{4,0.0250776933}},a+(b/(L^c)),{a,b,c},L]
FindFit[{{2,0.1309108378-0.0251093674},{3,0.0515790571-0.0183309670},{4,0.0250776933-0.0155135668}},a+(b/(L^c)),{a,b,c},L]
FindFit[{{2,0.1309108378-0.0144709213},{3,0.0515790571-0.0090641197},{4,0.0250776933-0.0081108363}},a+(b/(L^c)),{a,b,c},L]

Chart$H2O$CI=BarChart[Table[(ω$H2O$CI[[k,l]]-Ref$H2O[[k]]),{k,Length[Ref$H2O]},{l,Length[ω$H2O$CI[[k]]]}],
ChartStyle->"Pastel",
ImageSize->Full,
Frame->True,
GridLines->{{5,9.5,14,18.5,23},Automatic},
BaseStyle->12,
ImagePadding->{{All,All},{None,None}},
BarSpacing->{0,1/2},
FrameTicks->{Automatic,Automatic},
Epilog->Text[MaTeX["\\text{\\ce{H2O}: exFCI}",Magnification->SizeLabel],Offset[{20,-50},Scaled[{0,1}]],{-1,0}],
FrameLabel->{None,MaTeX["\\text{Error in excitation energy (eV)}",Magnification->1.5]},
PlotRange->{{1,27},{-0.20,0.1}},
AspectRatio->1/3,ChartLegends->Placed[{MaTeX["\\text{AVDZ}",Magnification->SizeLegend],MaTeX["\\text{AVTZ}",Magnification->SizeLegend],MaTeX["\\text{AVQZ}",Magnification->SizeLegend],MaTeX["\\text{CBS}",Magnification->SizeLegend]},{Right,Bottom}]];

Chart$H2O$srDFT=BarChart[Table[ω$H2O$CI[[k,l]]+Δω$H2O$srDFT$4[[k,l]]-Ref$H2O[[k]],{k,Length[Ref$H2O]},{l,Length[ω$H2O$CI[[k]]]}],
ChartStyle->"Pastel",
ImageSize->Full,
Frame->True,
GridLines->{{5,9.5,14,18.5,23},Automatic},
BaseStyle->12,
ImagePadding->{{All,All},{All,All}},
BarSpacing->{0,1/2},
FrameTicks->{Automatic,Automatic},
Epilog->Text[MaTeX["\\text{\\ce{H2O}: exFCI+srLDA}",Magnification->SizeLabel],Offset[{20,-50},Scaled[{0,1}]],{-1,0}],
FrameLabel->{None,MaTeX["\\text{Error in excitation energy (eV)}",Magnification->1.5]},
PlotRange->{{1,27},{-0.20,0.1}},
ChartLabels->{{
MaTeX["{}^1 B_1 (n \\rightarrow 3s)",Magnification->SizeChart],
MaTeX["{}^1 A_2 (n \\rightarrow 3p)",Magnification->SizeChart],
MaTeX["{}^1 A_1 (n \\rightarrow 3s)",Magnification->SizeChart],
MaTeX["{}^3 B_1 (n \\rightarrow 3s)",Magnification->SizeChart],
MaTeX["{}^3 A_2 (n \\rightarrow 3p)",Magnification->SizeChart],
MaTeX["{}^3 A_1 (n \\rightarrow 3s)",Magnification->SizeChart]},None},
AspectRatio->1/3
];

Column[{Chart$H2O$CI,Chart$H2O$srDFT},Spacings->0]
(*Export["FigH2O.pdf",%];*)