(* ::Package:: *)

M1={{6 \[Lambda]9,0,0,0,0,Sqrt[2] \[Lambda]6,Sqrt[2] \[Lambda]7,2 \[Lambda]8,0,0,0,0,0,0,0,0,0,0,0},{0,\[Lambda]6,\[Lambda]8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{0,\[Lambda]8,\[Lambda]7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{0,0,0,\[Lambda]6,\[Lambda]8,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{0,0,0,\[Lambda]8,\[Lambda]7,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{Sqrt[2] \[Lambda]6,0,0,0,0,3 \[Lambda]1,2 \[Lambda]3+\[Lambda]4,0,0,0,0,0,0,0,0,0,0,0,0},{Sqrt[2] \[Lambda]7,0,0,0,0,2 \[Lambda]3+\[Lambda]4,3 \[Lambda]2,0,0,0,0,0,0,0,0,0,0,0,0},{2 \[Lambda]8,0,0,0,0,0,0,\[Lambda]3+2 \[Lambda]4+3 \[Lambda]5,0,0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,\[Lambda]3+2 \[Lambda]4-3 \[Lambda]5,0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,\[Lambda]1,\[Lambda]4,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,\[Lambda]4,\[Lambda]2,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0,0,\[Lambda]3+\[Lambda]5,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0,0,0,\[Lambda]3-\[Lambda]5,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0,0,0,0,\[Lambda]1,\[Lambda]5,0,0,0,0},{0,0,0,0,0,0,0,0,0,0,0,0,0,\[Lambda]5,\[Lambda]2,0,0,0,0},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\[Lambda]3+\[Lambda]4,0,0,0},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\[Lambda]1,\[Lambda]5,0},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\[Lambda]5,\[Lambda]2,0},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\[Lambda]3+\[Lambda]4}};
M2={{\[Lambda]6,\[Lambda]8,0,0,0,0,0,0,0,0},{\[Lambda]8,\[Lambda]7,0,0,0,0,0,0,0,0},{0,0,\[Lambda]1,\[Lambda]4,0,0,0,0,0,0},{0,0,\[Lambda]4,\[Lambda]2,0,0,0,0,0,0},{0,0,0,0,\[Lambda]3+\[Lambda]5,0,0,0,0,0},{0,0,0,0,0,\[Lambda]3-\[Lambda]5,0,0,0,0},{0,0,0,0,0,0,\[Lambda]1,\[Lambda]5,0,0},{0,0,0,0,0,0,\[Lambda]5,\[Lambda]2,0,0},{0,0,0,0,0,0,0,0,\[Lambda]3+\[Lambda]4,0},{0,0,0,0,0,0,0,0,0,\[Lambda]3-\[Lambda]4}};
M3={{\[Lambda]1,0,\[Lambda]5},{0,\[Lambda]3+\[Lambda]4,0},{\[Lambda]5,0,\[Lambda]2}};
L2=1/8 (4 W1^4 \[Lambda]1+4 W2^4 \[Lambda]1+Z^4 \[Lambda]1+\[Eta]^4 \[Lambda]2+2 Z^2 \[Eta]^2 \[Lambda]3+2 Z^2 \[Eta]^2 \[Lambda]4+2 Z^2 \[Eta]^2 \[Lambda]5+2 s^2 Z^2 \[Lambda]6+2 s^2 \[Eta]^2 \[Lambda]7+4 s^2 Z \[Eta] \[Lambda]8+2 s^4 \[Lambda]9+2 Z^2 \[Lambda]1 \[Rho]1^2+2 \[Eta]^2 \[Lambda]3 \[Rho]1^2+2 \[Eta]^2 \[Lambda]4 \[Rho]1^2-2 \[Eta]^2 \[Lambda]5 \[Rho]1^2+2 s^2 \[Lambda]6 \[Rho]1^2+\[Lambda]1 \[Rho]1^4+8 Z \[Eta] \[Lambda]5 \[Rho]1 \[Rho]2+4 s^2 \[Lambda]8 \[Rho]1 \[Rho]2+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Lambda]6+\[Lambda]1 (2 W2^2+Z^2+\[Rho]1^2)+2 (\[Lambda]4+\[Lambda]5) \[Phi]1^2+2 (\[Lambda]4-\[Lambda]5) \[Phi]2^2+\[Lambda]3 (\[Rho]2^2+2 (\[Phi]1^2+\[Phi]2^2))));
tol=10^(-2);
SubstVal[expr_]:=expr/.{\[Lambda]1->NumericalValue[lambda1],\[Lambda]2->NumericalValue[lambda2],\[Lambda]3->NumericalValue[lambda3],\[Lambda]4->NumericalValue[lambda4],\[Lambda]5->NumericalValue[lambda5],\[Lambda]6->0,\[Lambda]7->NumericalValue[lambdaHHs],\[Lambda]8->NumericalValue[lambda12s],\[Lambda]9->NumericalValue[lambdas]};
Mval[M_]:=DiagonalMatrix[Abs[Eigenvalues[SubstVal[M]]]];
UnitConstr:=(PositiveDefiniteMatrixQ[-Mval[M1]+16Pi*IdentityMatrix[Length[M1]]]&&PositiveDefiniteMatrixQ[-Mval[M2]+16Pi*IdentityMatrix[Length[M2]]]&&PositiveDefiniteMatrixQ[-Mval[M3]+16Pi*IdentityMatrix[Length[M3]]])&&(PositiveDefiniteMatrixQ[+Mval[M1]+16Pi*IdentityMatrix[Length[M1]]]&&PositiveDefiniteMatrixQ[+Mval[M2]+16Pi*IdentityMatrix[Length[M2]]]&&PositiveDefiniteMatrixQ[+Mval[M3]+16Pi*IdentityMatrix[Length[M3]]]);
PerturbConstr[\[Xi]_]:=(PositiveDefiniteMatrixQ[-Mval[M1]+\[Xi]*IdentityMatrix[Length[M1]]]&&PositiveDefiniteMatrixQ[-Mval[M2]+\[Xi]*IdentityMatrix[Length[M2]]]&&PositiveDefiniteMatrixQ[-Mval[M3]+\[Xi]*IdentityMatrix[Length[M3]]])&&(PositiveDefiniteMatrixQ[+Mval[M1]+\[Xi]*IdentityMatrix[Length[M1]]]&&PositiveDefiniteMatrixQ[+Mval[M2]+\[Xi]*IdentityMatrix[Length[M2]]]&&PositiveDefiniteMatrixQ[+Mval[M3]+\[Xi]*IdentityMatrix[Length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 \[Phi]1^2+16 h v \[Lambda]3 \[Phi]1^2+16 W1^2 \[Lambda]3 \[Phi]1^2+16 W2^2 \[Lambda]3 \[Phi]1^2+8 Z^2 \[Lambda]3 \[Phi]1^2-8 v^2 \[Lambda]4 \[Phi]1^2+16 W1^2 \[Lambda]4 \[Phi]1^2+16 W2^2 \[Lambda]4 \[Phi]1^2-8 v^2 \[Lambda]5 \[Phi]1^2+16 W1^2 \[Lambda]5 \[Phi]1^2-16 W2^2 \[Lambda]5 \[Phi]1^2+8 \[Lambda]2 \[Phi]1^4+16 h W1 \[Eta] \[Lambda]4 \[Phi]2+16 v W1 \[Eta] \[Lambda]4 \[Phi]2+16 W2 Z \[Eta] \[Lambda]4 \[Phi]2-16 h W1 \[Eta] \[Lambda]5 \[Phi]2-16 v W1 \[Eta] \[Lambda]5 \[Phi]2+16 W2 Z \[Eta] \[Lambda]5 \[Phi]2+64 W1 W2 \[Lambda]5 \[Phi]1 \[Phi]2+8 MS1^2 \[Phi]2^2+8 MS2^2 \[Phi]2^2+8 \[Eta]^2 \[Lambda]2 \[Phi]2^2+8 h^2 \[Lambda]3 \[Phi]2^2+16 h v \[Lambda]3 \[Phi]2^2+16 W1^2 \[Lambda]3 \[Phi]2^2+16 W2^2 \[Lambda]3 \[Phi]2^2+8 Z^2 \[Lambda]3 \[Phi]2^2-8 v^2 \[Lambda]4 \[Phi]2^2+16 W1^2 \[Lambda]4 \[Phi]2^2+16 W2^2 \[Lambda]4 \[Phi]2^2-8 v^2 \[Lambda]5 \[Phi]2^2-16 W1^2 \[Lambda]5 \[Phi]2^2+16 W2^2 \[Lambda]5 \[Phi]2^2+16 \[Lambda]2 \[Phi]1^2 \[Phi]2^2+8 \[Lambda]2 \[Phi]2^4+(Cos[\[Theta]]^4 (MS1^2 S2^4+MS2^2 S2^4+2 S1^4 vs^2 \[Lambda]2+4 S1^2 S2^2 vs^2 \[Lambda]HHs+(-MS1^2+MS2^2) S2^4 Cos[2 \[Theta]]))/vs^2-16 h S2 Z \[Eta] \[Lambda]5 Sin[\[Theta]]-16 S2 v Z \[Eta] \[Lambda]5 Sin[\[Theta]]+8 S1 vs \[Eta]^2 \[Lambda]HHs Sin[\[Theta]]-16 h S2 W1 \[Lambda]4 \[Phi]1 Sin[\[Theta]]-16 S2 v W1 \[Lambda]4 \[Phi]1 Sin[\[Theta]]-16 S2 W2 Z \[Lambda]4 \[Phi]1 Sin[\[Theta]]-16 h S2 W1 \[Lambda]5 \[Phi]1 Sin[\[Theta]]-16 S2 v W1 \[Lambda]5 \[Phi]1 Sin[\[Theta]]+16 S2 W2 Z \[Lambda]5 \[Phi]1 Sin[\[Theta]]+16 S1 vs \[Lambda]HHs \[Phi]1^2 Sin[\[Theta]]-16 h S2 W2 \[Lambda]4 \[Phi]2 Sin[\[Theta]]-16 S2 v W2 \[Lambda]4 \[Phi]2 Sin[\[Theta]]+16 S2 W1 Z \[Lambda]4 \[Phi]2 Sin[\[Theta]]-16 h S2 W2 \[Lambda]5 \[Phi]2 Sin[\[Theta]]-16 S2 v W2 \[Lambda]5 \[Phi]2 Sin[\[Theta]]-16 S2 W1 Z \[Lambda]5 \[Phi]2 Sin[\[Theta]]+16 S1 vs \[Lambda]HHs \[Phi]2^2 Sin[\[Theta]]+4 MS1^2 S1^2 Sin[\[Theta]]^2+4 MS2^2 S1^2 Sin[\[Theta]]^2+4 MS1^2 S2^2 Sin[\[Theta]]^2+4 MS2^2 S2^2 Sin[\[Theta]]^2+4 S2^2 \[Eta]^2 \[Lambda]2 Sin[\[Theta]]^2+4 h^2 S2^2 \[Lambda]3 Sin[\[Theta]]^2+8 h S2^2 v \[Lambda]3 Sin[\[Theta]]^2+8 S2^2 W1^2 \[Lambda]3 Sin[\[Theta]]^2+8 S2^2 W2^2 \[Lambda]3 Sin[\[Theta]]^2+4 S2^2 Z^2 \[Lambda]3 Sin[\[Theta]]^2+4 h^2 S2^2 \[Lambda]4 Sin[\[Theta]]^2+8 h S2^2 v \[Lambda]4 Sin[\[Theta]]^2+4 S2^2 Z^2 \[Lambda]4 Sin[\[Theta]]^2+4 h^2 S2^2 \[Lambda]5 Sin[\[Theta]]^2+8 h S2^2 v \[Lambda]5 Sin[\[Theta]]^2-4 S2^2 Z^2 \[Lambda]5 Sin[\[Theta]]^2+4 S1^2 \[Eta]^2 \[Lambda]HHs Sin[\[Theta]]^2+8 S2^2 \[Lambda]2 \[Phi]1^2 Sin[\[Theta]]^2+8 S1^2 \[Lambda]HHs \[Phi]1^2 Sin[\[Theta]]^2+8 S2^2 \[Lambda]2 \[Phi]2^2 Sin[\[Theta]]^2+8 S1^2 \[Lambda]HHs \[Phi]2^2 Sin[\[Theta]]^2+(4 MS1^2 S1^3 Sin[\[Theta]]^3)/vs+(4 MS2^2 S1^3 Sin[\[Theta]]^3)/vs+8 S1 S2^2 vs \[Lambda]HHs Sin[\[Theta]]^3+(MS1^2 S1^4 Sin[\[Theta]]^4)/vs^2+(MS2^2 S1^4 Sin[\[Theta]]^4)/vs^2+2 S2^4 \[Lambda]2 Sin[\[Theta]]^4+4 S1^2 S2^2 \[Lambda]HHs Sin[\[Theta]]^4+((MS1^2-MS2^2) Cos[2 \[Theta]] (vs^2 (vs^2+4 \[Eta]^2+8 (\[Phi]1^2+\[Phi]2^2))+4 (-S1^2+S2^2) vs^2 Sin[\[Theta]]^2-4 S1^3 vs Sin[\[Theta]]^3-S1^4 Sin[\[Theta]]^4))/vs^2+(8 MS1^2 S1 Z \[Eta] Sin[\[Theta]] Sin[2 \[Theta]])/v-(8 MS2^2 S1 Z \[Eta] Sin[\[Theta]] Sin[2 \[Theta]])/v+(16 MS1^2 S1 W1 \[Phi]1 Sin[\[Theta]] Sin[2 \[Theta]])/v-(16 MS2^2 S1 W1 \[Phi]1 Sin[\[Theta]] Sin[2 \[Theta]])/v+(16 MS1^2 S1 W2 \[Phi]2 Sin[\[Theta]] Sin[2 \[Theta]])/v-(16 MS2^2 S1 W2 \[Phi]2 Sin[\[Theta]] Sin[2 \[Theta]])/v-8 MS1^2 S1 S2 Sin[\[Theta]]^2 Sin[2 \[Theta]]+8 MS2^2 S1 S2 Sin[\[Theta]]^2 Sin[2 \[Theta]]-(8 h MS1^2 S1 S2 Sin[\[Theta]]^2 Sin[2 \[Theta]])/v+(8 h MS2^2 S1 S2 Sin[\[Theta]]^2 Sin[2 \[Theta]])/v+(4 MS1^2 S1^2 Z \[Eta] Sin[\[Theta]]^2 Sin[2 \[Theta]])/(v vs)-(4 MS2^2 S1^2 Z \[Eta] Sin[\[Theta]]^2 Sin[2 \[Theta]])/(v vs)+(8 MS1^2 S1^2 W1 \[Phi]1 Sin[\[Theta]]^2 Sin[2 \[Theta]])/(v vs)-(8 MS2^2 S1^2 W1 \[Phi]1 Sin[\[Theta]]^2 Sin[2 \[Theta]])/(v vs)+(8 MS1^2 S1^2 W2 \[Phi]2 Sin[\[Theta]]^2 Sin[2 \[Theta]])/(v vs)-(8 MS2^2 S1^2 W2 \[Phi]2 Sin[\[Theta]]^2 Sin[2 \[Theta]])/(v vs)-(4 MS1^2 S1^2 S2 Sin[\[Theta]]^3 Sin[2 \[Theta]])/vs+(4 MS2^2 S1^2 S2 Sin[\[Theta]]^3 Sin[2 \[Theta]])/vs-(4 h MS1^2 S1^2 S2 Sin[\[Theta]]^3 Sin[2 \[Theta]])/(v vs)+(4 h MS2^2 S1^2 S2 Sin[\[Theta]]^3 Sin[2 \[Theta]])/(v vs)+1/(v vs^2) 4 S2 Cos[\[Theta]]^3 (v vs (MS1^2 S2^2+MS2^2 S2^2+2 S1^2 vs^2 \[Lambda]HHs)+S1 v (MS1^2 S2^2+MS2^2 S2^2-2 vs^2 (S1^2 (\[Lambda]2-\[Lambda]HHs)+S2^2 \[Lambda]HHs)) Sin[\[Theta]]-(MS1^2-MS2^2) S2^2 v Cos[2 \[Theta]] (vs+S1 Sin[\[Theta]])+(MS1^2-MS2^2) S1 S2 (h+v) vs Sin[2 \[Theta]])+1/(v vs^2) 2 Cos[\[Theta]]^2 (v (3 MS1^2 S1^2 S2^2+3 MS2^2 S1^2 S2^2+2 vs^2 (S1^2 S2^2 (3 \[Lambda]2-4 \[Lambda]HHs)+S1^4 \[Lambda]HHs+S2^4 \[Lambda]HHs)) Sin[\[Theta]]^2+(MS1^2-MS2^2) v Cos[2 \[Theta]] (2 (S1^2-S2^2) vs^2-6 S1 S2^2 vs Sin[\[Theta]]-3 S1^2 S2^2 Sin[\[Theta]]^2)+2 vs Sin[\[Theta]] (S1 v (3 MS1^2 S2^2+3 MS2^2 S2^2+2 (S1^2-2 S2^2) vs^2 \[Lambda]HHs)-(MS1^2-MS2^2) S2 (-2 S1^2+S2^2) (h+v) Sin[2 \[Theta]])+2 vs (v vs (MS1^2 (S1^2+S2^2)+MS2^2 (S1^2+S2^2)+S1^2 \[Eta]^2 \[Lambda]2+h^2 S1^2 \[Lambda]3+2 h S1^2 v \[Lambda]3+2 S1^2 W1^2 \[Lambda]3+2 S1^2 W2^2 \[Lambda]3+S1^2 Z^2 \[Lambda]3+h^2 S1^2 \[Lambda]4+2 h S1^2 v \[Lambda]4+S1^2 Z^2 \[Lambda]4+h^2 S1^2 \[Lambda]5+2 h S1^2 v \[Lambda]5-S1^2 Z^2 \[Lambda]5+S2^2 \[Eta]^2 \[Lambda]HHs+2 S1^2 \[Lambda]2 \[Phi]1^2+2 S2^2 \[Lambda]HHs \[Phi]1^2+2 S1^2 \[Lambda]2 \[Phi]2^2+2 S2^2 \[Lambda]HHs \[Phi]2^2)+(MS1^2-MS2^2) S2 (2 h S1 vs+2 S1 v vs+S2 (Z \[Eta]+2 W1 \[Phi]1+2 W2 \[Phi]2)) Sin[2 \[Theta]]))+1/(v vs^2) 4 Cos[\[Theta]] (S1 S2 v (MS1^2 S1^2+MS2^2 S1^2-2 S2^2 vs^2 \[Lambda]2-2 S1^2 vs^2 \[Lambda]HHs+2 S2^2 vs^2 \[Lambda]HHs+(-MS1^2+MS2^2) S1^2 Cos[2 \[Theta]]) Sin[\[Theta]]^3+vs Sin[\[Theta]]^2 (S2 v (3 MS1^2 S1^2+3 MS2^2 S1^2+2 (-2 S1^2+S2^2) vs^2 \[Lambda]HHs)+3 (-MS1^2+MS2^2) S1^2 S2 v Cos[2 \[Theta]]+(MS1^2-MS2^2) S1 (S1^2-2 S2^2) (h+v) Sin[2 \[Theta]])+2 vs^2 (v (2 h S1 (Z \[Eta] \[Lambda]5+(\[Lambda]4+\[Lambda]5) (W1 \[Phi]1+W2 \[Phi]2))+2 S1 (v Z \[Eta] \[Lambda]5+Z (\[Lambda]4-\[Lambda]5) (W2 \[Phi]1-W1 \[Phi]2)+v (\[Lambda]4+\[Lambda]5) (W1 \[Phi]1+W2 \[Phi]2))+S2 vs \[Lambda]HHs (\[Eta]^2+2 (\[Phi]1^2+\[Phi]2^2)))+(MS1^2-MS2^2) S2 (Z \[Eta]+2 W1 \[Phi]1+2 W2 \[Phi]2) Sin[2 \[Theta]])+2 vs Sin[\[Theta]] (-S1 S2 v vs (2 W1^2 \[Lambda]3+2 W2^2 \[Lambda]3+Z^2 \[Lambda]3+Z^2 \[Lambda]4-Z^2 \[Lambda]5+h^2 (\[Lambda]3+\[Lambda]4+\[Lambda]5)+2 h v (\[Lambda]3+\[Lambda]4+\[Lambda]5)+\[Eta]^2 (\[Lambda]2-\[Lambda]HHs)+2 \[Lambda]2 \[Phi]1^2-2 \[Lambda]HHs \[Phi]1^2+2 \[Lambda]2 \[Phi]2^2-2 \[Lambda]HHs \[Phi]2^2)+2 (-MS1^2+MS2^2) S1 S2 v vs Cos[2 \[Theta]]+(MS1^2-MS2^2) (h (S1^2-S2^2) vs+S1^2 v vs-S2^2 v vs+S1 S2 (Z \[Eta]+2 W1 \[Phi]1+2 W2 \[Phi]2)) Sin[2 \[Theta]])))/.{MH->mh,MS1->ms1,MS2->ms2,vs->vevs,\[Lambda]HHs->\[Lambda]7,\[Theta]->ArcTan[t2th]/2};
SubstVal2[expr_]:=SubstVal[expr]/.{v->NumericalValue[vev],mh->NumericalValue[MH],ms1->NumericalValue[MS1],ms2->NumericalValue[MS2],vevs->NumericalValue[vs],t2th->NumericalValue[t2theta]};
L5=SubstVal[SubstVal2[L4]];
L6=L5/.{S1->0,S2->0,h->0,W1->0,W2->0,Z->0,\[Eta]->0,\[Phi]1->0,\[Phi]2->0};
L7=L5-L6;
MetaStabConstr:=(Abs[NMinimize[L7,{h,S1,S2,Z,\[Eta],\[Phi]1,\[Phi]2,W1,W2}][[1]]]<tol);
