Skip to content

Commit

Permalink
Correct errors in FourDerivScalarTensor and ModifiedGravityWeyl4
Browse files Browse the repository at this point in the history
Update joss-paper.yaml

Update from deprecated version of artifact action

Test for 4dST fixed

Minus sign of Weyl moved
  • Loading branch information
SamuelBrady committed Jan 9, 2025
1 parent f69b5af commit 4b4a4c6
Show file tree
Hide file tree
Showing 5 changed files with 365 additions and 362 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/joss-paper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# This should be the path to the paper within your repo.
paper-path: paper/paper.md
- name: Upload
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: paper
# This is the output path where Pandoc will write the compiled
Expand Down
24 changes: 14 additions & 10 deletions Source/FourDerivScalarTensor/FourDerivScalarTensor.impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,13 +488,17 @@ FourDerivScalarTensor<coupling_and_potential_t>::compute_Sij_TF_and_S(
Tensor<2, data_t> SijGB;
FOR(i, j)
{
SijGB[i][j] = -2. / 3. * Omega_ij_TF[i][j] *
(F + 2. * (tr_covd2lapse * one_over_lapse - tr_A2)) -
2. * Mij_TF[i][j] *
(Omega - 4. * d2fdphi2 * Vt + 4. * quadratic_terms) -
2. * Omega / 3. * Fij_TF[i][j] / chi_regularised +
2. * ((Ni[i] + d1.K[i] / 3.) * Omega_i[j] +
(Ni[j] + d1.K[j] / 3.) * Omega_i[i]);
SijGB[i][j] =
-2. / 3. * Omega_ij_TF[i][j] *
(F + 2. * (tr_covd2lapse * one_over_lapse - tr_A2)) -
2. * Mij_TF[i][j] *
(Omega - 4. * d2fdphi2 * Vt + 4. * quadratic_terms) -
2. * Omega / 3. *
(Fij[i][j] -
vars.h[i][j] / 3. * (tr_covd2lapse * one_over_lapse - tr_A2)) /
chi_regularised +
2. * ((Ni[i] + d1.K[i] / 3.) * Omega_i[j] +
(Ni[j] + d1.K[j] / 3.) * Omega_i[i]);
FOR(k, l)
{
SijGB[i][j] +=
Expand Down Expand Up @@ -877,13 +881,13 @@ void FourDerivScalarTensor<coupling_and_potential_t>::compute_lhs(
continue;

LHS_mat[N - 1][idx] = 0.;
LHS_mat[idx][N - 1] = -2. * dfdphi * Mij_TF_UU_over_chi[i][j];
LHS_mat[idx][N - 1] = -8. * dfdphi * Mij_TF_UU_over_chi[i][j];
if (i != j)
LHS_mat[idx][N - 1] += -2. * dfdphi * Mij_TF_UU_over_chi[j][i];
LHS_mat[idx][N - 1] += -8. * dfdphi * Mij_TF_UU_over_chi[j][i];
++idx;
}
LHS_mat[N - 1][N - 2] = 0.;
LHS_mat[N - 2][N - 1] = dfdphi * M / 3.;
LHS_mat[N - 2][N - 1] = 4. * dfdphi * M / 3.;
LHS_mat[N - 1][N - 1] = 1. + g2 * (2. * vars.Pi * vars.Pi - Vt);

for (int row = 0; row < N; ++row)
Expand Down
4 changes: 2 additions & 2 deletions Source/ModifiedCCZ4/ModifiedCCZ4RHS.impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ ModifiedCCZ4RHS<theory_t, gauge_t, deriv_t>::get_full_kappa_times_Sij_TF(
// solve linear system for the theory fields that require it (e.g. 4dST)
my_theory.solve_lhs(theory_rhs, theory_vars, d1, d2, advec, coords);

Tensor<2, data_t> out = theory_rhs.A;
FOR(i, j) out[i][j] += -rhs.A[i][j];
Tensor<2, data_t> out = -theory_rhs.A;
FOR(i, j) out[i][j] += rhs.A[i][j];
FOR(i, j) out[i][j] /= chi_regularised;

return out;
Expand Down
71 changes: 35 additions & 36 deletions Tests/FourDerivScalarTensorTest/Mathematica_comparison.nb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 158, 7]
NotebookDataLength[ 111907, 3121]
NotebookOptionsPosition[ 111460, 3105]
NotebookOutlinePosition[ 111949, 3123]
CellTagsIndexPosition[ 111906, 3120]
NotebookDataLength[ 111954, 3120]
NotebookOptionsPosition[ 111504, 3104]
NotebookOutlinePosition[ 111996, 3122]
CellTagsIndexPosition[ 111953, 3119]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Expand Down Expand Up @@ -44,7 +44,7 @@ Cell[BoxData[{
RowBox[{"Vofphi", "=",
RowBox[{"RandomReal", "[", "]"}]}], ";",
RowBox[{"dVdphi", "=",
RowBox[{"RandomReal", "[", "]"}]}], ";"}], "\n"}], "\[IndentingNewLine]",
RowBox[{"RandomReal", "[", "]"}]}], ";"}], "\[IndentingNewLine]"}], "\n",

RowBox[{
RowBox[{
Expand All @@ -56,7 +56,7 @@ Cell[BoxData[{
RowBox[{"RandomReal", "[", "]"}]}], ";",
RowBox[{"dg2dphi", "=",
RowBox[{"RandomReal", "[", "]"}]}], ";"}],
"\n"}], "\[IndentingNewLine]",
"\[IndentingNewLine]"}], "\n",
RowBox[{
RowBox[{"chi", "=",
RowBox[{"RandomReal", "[", "]"}]}], ";",
Expand Down Expand Up @@ -335,7 +335,7 @@ Cell[BoxData[{
RowBox[{"i", ",", "1", ",", "3"}], "}"}], ",",
RowBox[{"{",
RowBox[{"j", ",", "1", ",", "3"}], "}"}]}], "]"}]}], ";"}],
"\[IndentingNewLine]"}], "\n",
"\n"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"d2chi", "=",
RowBox[{"Table", "[",
Expand Down Expand Up @@ -410,8 +410,8 @@ Cell[BoxData[{
RowBox[{"{",
RowBox[{"j", ",", "1", ",", "3"}], "}"}], ",",
RowBox[{"{",
RowBox[{"l", ",", "1", ",", "3"}], "}"}]}], "]"}]}], ";"}],
"\[IndentingNewLine]", "\n",
RowBox[{"l", ",", "1", ",", "3"}], "}"}]}], "]"}]}], ";"}], "\n",
"\[IndentingNewLine]",
RowBox[{"(*",
RowBox[{"Make", " ", "the", " ", "derivatives", " ", "symmetric"}],
"*)"}]}], "\[IndentingNewLine]",
Expand Down Expand Up @@ -486,7 +486,7 @@ Cell[BoxData[{
RowBox[{"i", ",", "1", ",", "3"}], "}"}], ",",
RowBox[{"{",
RowBox[{"j", ",", "1", ",", "3"}], "}"}]}], "]"}], ";"}],
"\n"}], "\[IndentingNewLine]",
"\[IndentingNewLine]"}], "\n",
RowBox[{
RowBox[{"stream", "=",
RowBox[{"OpenWrite", "[",
Expand All @@ -500,7 +500,7 @@ Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"Close", "[", "stream", "]"}], ";"}],
"\n"}], "\[IndentingNewLine]",
"\[IndentingNewLine]"}], "\n",
RowBox[{
RowBox[{"stream", "=",
RowBox[{"OpenAppend", "[",
Expand Down Expand Up @@ -914,7 +914,7 @@ Cell[BoxData[{
RowBox[{"k", ",", "1", ",", "3"}], "}"}], ",",
RowBox[{"{",
RowBox[{"l", ",", "1", ",", "3"}], "}"}]}], "]"}], ";"}],
"\[IndentingNewLine]"}], "\n",
"\n"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"WriteLine", "[",
RowBox[{"stream", ",",
Expand Down Expand Up @@ -1083,8 +1083,8 @@ Cell[BoxData[{
RowBox[{"{",
RowBox[{"1", ",", "4"}], "}"}], ",",
RowBox[{"{",
RowBox[{"2", ",", "5"}], "}"}]}], "}"}]}], "]"}]}], ";"}],
"\[IndentingNewLine]", "\n",
RowBox[{"2", ",", "5"}], "}"}]}], "}"}]}], "]"}]}], ";"}], "\n",
"\[IndentingNewLine]",
RowBox[{"(*",
RowBox[{"Calculate", " ", "ricci"}], "*)"}]}], "\[IndentingNewLine]",
RowBox[{
Expand Down Expand Up @@ -1291,9 +1291,9 @@ Cell[BoxData[{
RowBox[{"Tr", "[",
RowBox[{"\[Chi]", " ",
RowBox[{"hu", ".", "ricci"}]}], "]"}]}], ";"}], "\[IndentingNewLine]",
"\[IndentingNewLine]",
"\n",
RowBox[{"(*",
RowBox[{"define", " ", "variables"}], "*)"}]}], "\n",
RowBox[{"define", " ", "variables"}], "*)"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Aa", "=", "A"}], ";",
RowBox[{"\[Alpha]", "=", "lapse"}], ";",
Expand Down Expand Up @@ -1546,11 +1546,11 @@ Cell[BoxData[{
RowBox[{"Transpose", "[",
RowBox[{"covdA\[Chi]", ",",
RowBox[{"{",
RowBox[{"2", ",", "1", ",", "3"}], "}"}]}], "]"}]}]}], ";"}], "\n",
"\[IndentingNewLine]",
RowBox[{"2", ",", "1", ",", "3"}], "}"}]}], "]"}]}]}], ";"}],
"\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"(*",
RowBox[{"Calculate", " ", "\[Rho]GB", " ", "and", " ", "JGB"}],
"*)"}]}], "\[IndentingNewLine]",
"*)"}]}], "\n",
RowBox[{
RowBox[{"\[Rho]GB", "=",
RowBox[{
Expand Down Expand Up @@ -1605,10 +1605,9 @@ Cell[BoxData[{
RowBox[{"1", ",", "4"}], "}"}], ",",
RowBox[{"{",
RowBox[{"2", ",", "5"}], "}"}]}], "}"}]}], "]"}]}]}]}], ";"}],
"\n", "\[IndentingNewLine]",
"\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"(*",
RowBox[{"calculate", " ", "S", " ", "terms"}],
"*)"}]}], "\[IndentingNewLine]",
RowBox[{"calculate", " ", "S", " ", "terms"}], "*)"}]}], "\n",
RowBox[{
RowBox[{"L\[Beta]A", "=",
RowBox[{
Expand Down Expand Up @@ -1676,7 +1675,7 @@ Cell[BoxData[{
RowBox[{"2", ",", "5"}], "}"}], ",",
RowBox[{"{",
RowBox[{"3", ",", "6"}], "}"}]}], "}"}]}], "]"}]}]}]}], ";"}],
"\[IndentingNewLine]"}], "\n",
"\n"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"SK\[Phi]", "=",
RowBox[{
Expand Down Expand Up @@ -1889,10 +1888,8 @@ Cell[BoxData[{
RowBox[{"(",
RowBox[{"9", " ", "\[Chi]"}], ")"}]}], " ", "hh", " ",
RowBox[{"(",
RowBox[{"trcovd2lapse", "+",
RowBox[{"\[Alpha]", " ", "trA2"}], "-",
RowBox[{"Tr", "[",
RowBox[{"hu", ".", "L\[Beta]A"}], "]"}]}], ")"}]}], "-",
RowBox[{"trcovd2lapse", "-",
RowBox[{"\[Alpha]", " ", "trA2"}]}], ")"}]}], "-",
RowBox[{"2", " ",
RowBox[{"Symmetrize", "[",
RowBox[{"TensorContract", "[",
Expand Down Expand Up @@ -2708,7 +2705,7 @@ Cell[BoxData[{
RowBox[{"hu", ".", "d\[Phi]"}], ")"}]}], ")"}], ".",
RowBox[{"(",
RowBox[{"hu", ".", "d\[Phi]"}], ")"}]}]}]}]}], ";"}],
"\n"}], "\[IndentingNewLine]",
"\[IndentingNewLine]"}], "\n",
RowBox[{
RowBox[{
RowBox[{"df2", " ", "=",
Expand Down Expand Up @@ -2784,8 +2781,7 @@ Cell[BoxData[{
";"}], "\n",
RowBox[{
RowBox[{"XK\[Phi]", "=",
RowBox[{
RowBox[{"\[Chi]", "/", "2"}], " ",
RowBox[{"2", "\[Chi]", " ",
RowBox[{"hu", ".", "Mtf", ".", "hu"}], " ", "df"}]}], ";"}], "\n",
RowBox[{
RowBox[{"Yij", "=",
Expand All @@ -2810,7 +2806,7 @@ Cell[BoxData[{
RowBox[{"YK\[Phi]", "=",
RowBox[{
RowBox[{
RowBox[{"-", "1"}], "/", "12"}], " ", "df", " ", "M"}]}], ";"}], "\n",
RowBox[{"-", "1"}], "/", "3"}], " ", "df", " ", "M"}]}], ";"}], "\n",
RowBox[{
RowBox[{
RowBox[{"mat", "=",
Expand Down Expand Up @@ -3100,11 +3096,14 @@ Cell[BoxData[{
3.901890490604434*^9, 3.901890661252363*^9}, {3.901890736101222*^9,
3.901890764916051*^9}, {3.9018908738600693`*^9, 3.901890877152804*^9}, {
3.901890971545923*^9, 3.9018909720408287`*^9}, {3.9019353806230383`*^9,
3.901935454974388*^9}, {3.915183445953743*^9, 3.915183457864848*^9}},
CellLabel->"In[1]:=",ExpressionUUID->"8b4b8e8e-49ac-434c-83d5-300cdefd8c2e"]
3.901935454974388*^9}, {3.915183445953743*^9, 3.915183457864848*^9}, {
3.945421980214201*^9, 3.94542198432117*^9}, {3.94542202399296*^9,
3.9454220299263144`*^9}, {3.9454222768594723`*^9, 3.945422277619046*^9}},
CellLabel->
"In[185]:=",ExpressionUUID->"8b4b8e8e-49ac-434c-83d5-300cdefd8c2e"]
},
WindowSize->{802.5, 669.75},
WindowMargins->{{Automatic, 282}, {0, Automatic}},
WindowSize->{802.5, 618},
WindowMargins->{{-1081.5, Automatic}, {Automatic, 183}},
TaggingRules->{
"WelcomeScreenSettings" -> {"FEStarting" -> False}, "TryRealOnly" -> False},
FrontEndVersion->"13.3 for Linux x86 (64-bit) (July 24, 2023)",
Expand All @@ -3122,7 +3121,7 @@ CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[558, 20, 110898, 3083, 7166, "Input",ExpressionUUID->"8b4b8e8e-49ac-434c-83d5-300cdefd8c2e"]
Cell[558, 20, 110942, 3082, 7146, "Input",ExpressionUUID->"8b4b8e8e-49ac-434c-83d5-300cdefd8c2e"]
}
]
*)
Expand Down
Loading

0 comments on commit 4b4a4c6

Please sign in to comment.