From 2f2a8d1c53489b42f8a58508ae48a6e3db612563 Mon Sep 17 00:00:00 2001 From: Liwei Ji Date: Wed, 11 Sep 2024 08:23:37 -0400 Subject: [PATCH] Z4cow: check_rhs.ipynb --- Z4cow/wolfram/check_rhs.ipynb | 443 ++++++++++++++++++++++++++++++++++ Z4cow/wolfram/wl/Z4c_rhs.wl | 2 +- 2 files changed, 444 insertions(+), 1 deletion(-) create mode 100644 Z4cow/wolfram/check_rhs.ipynb diff --git a/Z4cow/wolfram/check_rhs.ipynb b/Z4cow/wolfram/check_rhs.ipynb new file mode 100644 index 00000000..80b6ac62 --- /dev/null +++ b/Z4cow/wolfram/check_rhs.ipynb @@ -0,0 +1,443 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "a265f5c5-fce9-45ad-b496-8bb1ee1f219b", + "metadata": {}, + "source": [ + "# Z4c Equations (Evolve $W$)" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "9642db04-5283-4582-99af-90ffff046096", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "------------------------------------------------------------\n", + "Package xAct`xPerm` version 1.2.3, {2015, 8, 23}\n", + "CopyRight (C) 2003-2020, Jose M. Martin-Garcia, under the General Public\\\n", + " \n", + "> License.\n", + "Connecting to external mac executable...\n", + "Connection established.\n", + "------------------------------------------------------------\n", + "Package xAct`xTensor` version 1.2.0, {2021, 10, 17}\n", + "CopyRight (C) 2002-2021, Jose M. Martin-Garcia, under the General Public\\\n", + " \n", + "> License.\n", + "------------------------------------------------------------\n", + "These packages come with ABSOLUTELY NO WARRANTY; for details type\\\n", + " \n", + "> Disclaimer[]. This is free software, and you are welcome to redistribute\\\n", + " \n", + "> it under certain conditions. See the General Public License for details.\n", + "------------------------------------------------------------\n", + "------------------------------------------------------------\n", + "Package xAct`xCoba` version 0.8.6, {2021, 2, 28}\n", + "CopyRight (C) 2005-2021, David Yllanes and Jose M. Martin-Garcia, under the\\\n", + " \n", + "> General Public License.\n", + "------------------------------------------------------------\n", + "These packages come with ABSOLUTELY NO WARRANTY; for details type\\\n", + " \n", + "> Disclaimer[]. This is free software, and you are welcome to redistribute\\\n", + " \n", + "> it under certain conditions. See the General Public License for details.\n", + "------------------------------------------------------------\n", + "------------------------------------------------------------\n", + "Package Generato`Basic`, {2024, 1, 11}\n", + "------------------------------------------------------------\n", + "------------------------------------------------------------\n", + "Package Generato`ParseMode`, {2024, 7, 06}\n", + "------------------------------------------------------------\n", + "------------------------------------------------------------\n", + "Package Generato`Component`, {2024, 1, 11}\n", + "------------------------------------------------------------\n", + "------------------------------------------------------------\n", + "Package Generato`Varlist`, {2024, 1, 11}\n", + "------------------------------------------------------------\n", + "------------------------------------------------------------\n", + "Package Generato`Interface`, {2024, 1, 11}\n", + "------------------------------------------------------------\n", + "------------------------------------------------------------\n", + "Package Generato`Derivation`, {2024, 1, 18}\n", + "------------------------------------------------------------\n", + "\n" + ] + } + ], + "source": [ + "Needs[\"xAct`xCoba`\", FileNameJoin[{Environment[\"GENERATO\"], \"src/Generato.wl\"}]]" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "ade74516-0ef1-4104-8217-d8968a1fa871", + "metadata": {}, + "outputs": [], + "source": [ + "DefManifold[M3, 3, IndexRange[a, z]];" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "89c3c5eb-f13f-4be9-8117-c9e197d1114e", + "metadata": {}, + "outputs": [], + "source": [ + "<<\"wl/Z4c_vars_check.wl\"" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "396420b3-c92c-49bf-acc6-b02599fffdd0", + "metadata": {}, + "outputs": [], + "source": [ + "<<\"wl/Z4c_rhs.wl\"" + ] + }, + { + "cell_type": "markdown", + "id": "789279a3-122b-41b2-a9d7-e852493904d7", + "metadata": {}, + "source": [ + "## Check Expressions" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "07be83aa-230e-44b5-ba16-b6fc7df0626e", + "metadata": {}, + "outputs": [], + "source": [ + "rhsof[var_] := Module[{}, var /. {var[[0]] :> RHSOf[ToString[var[[0]]]]}];\n", + "eqssof[varlist_] := Module[{var}, \n", + " Table[var = varlist[[ivar]][[1]]; var == rhsof[var]//ScreenDollarIndices, {ivar, 1, Length[varlist]}]];" + ] + }, + { + "cell_type": "markdown", + "id": "fe765538-ea4c-48c4-8597-df4256c160c7", + "metadata": {}, + "source": [ + "### Intermediate Variables" + ] + }, + { + "cell_type": "markdown", + "id": "bbb20a49-7fcf-45bc-837c-77948b504af7", + "metadata": {}, + "source": [ + "#### Intermediate" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "de2b21c1-afc1-4772-af17-8b6b1d655f04", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\"Output\"
" + ], + "text/plain": [ + "-Image-" + ] + }, + "execution_count": 7, + "metadata": { + "text/html": [], + "text/plain": [] + }, + "output_type": "execute_result" + } + ], + "source": [ + "Rasterize[Drop[eqssof[IntermediateVarlist], {2}]//MatrixForm]" + ] + }, + { + "cell_type": "markdown", + "id": "7c6273a1-3c0a-4e63-a329-ed8e59fa4eef", + "metadata": {}, + "source": [ + "#### DD" + ] + }, + { + "cell_type": "markdown", + "id": "7ed43fa8-cf42-4452-94d8-58239fb80e62", + "metadata": {}, + "source": [ + "$$\n", + "\\begin{align}\n", + " D_iD_j\\alpha\n", + " &=\\partial_i\\partial_j\\alpha-\\Gamma^k{}_{ij}\\partial_k\\alpha \\\\\n", + " &=\\partial_i\\partial_j\\alpha-\n", + " \\left[\n", + " \\tilde\\Gamma^k{}_{ij}\n", + " -\\frac{1}{2}\n", + " (\\partial_i\\ln\\chi\\delta^k{}_j+\\partial_j\\ln\\chi\\delta^k{}_i\n", + " -\\tilde\\gamma_{ij}\\tilde\\gamma^{kl}\\partial_l\\ln\\chi)\n", + " \\right]\\partial_k\\alpha \\\\\n", + " &=\\partial_i\\partial_j\\alpha-\n", + " \\tilde\\Gamma^k{}_{ij}\\partial_k\\alpha\n", + " +\\frac{1}{2}\n", + " (\\partial_i\\ln\\chi\\partial_j\\alpha\n", + " +\\partial_j\\ln\\chi\\partial_i\\alpha\n", + " -\\tilde\\gamma_{ij}\\tilde\\gamma^{kl}\\partial_l\\ln\\chi\\partial_k\\alpha) \\\\\n", + " &=\\partial_i\\partial_j\\alpha-\n", + " \\tilde\\Gamma^k{}_{ij}\\partial_k\\alpha\n", + " +\\partial_{(i}\\ln\\chi\\partial_{j)}\\alpha\n", + " -\\frac{1}{2}\\tilde\\gamma_{ij}\\tilde\\gamma^{kl}\\partial_l\\ln\\chi\\partial_k\\alpha\n", + "\\end{align}\n", + "$$\n", + "where we have used\n", + "$$\n", + "\\begin{align}\n", + " \\Gamma^{k}{}_{ij}\n", + " &=\\frac{1}{2}\\gamma^{kl}(\\partial_i\\gamma_{jl}+\\partial_j\\gamma_{li}-\\partial_l\\gamma_{ij})\n", + " \\\\\n", + " &=\\frac{1}{2}\\tilde\\gamma^{kl}\n", + " \\left[\n", + " (\\partial_i\\tilde\\gamma_{jl}-\\partial_i\\ln\\chi\\tilde\\gamma_{jl})+\n", + " (\\partial_j\\tilde\\gamma_{li}-\\partial_j\\ln\\chi\\tilde\\gamma_{li})-\n", + " (\\partial_l\\tilde\\gamma_{ij}-\\partial_l\\ln\\chi\\tilde\\gamma_{ij})\n", + " \\right]\n", + " \\\\\n", + " &=\\tilde\\Gamma^k{}_{ij}\n", + " -\\frac{1}{2}\n", + " (\\partial_i\\ln\\chi\\delta^k{}_j+\\partial_j\\ln\\chi\\delta^k{}_i\n", + " -\\tilde\\gamma_{ij}\\tilde\\gamma^{kl}\\partial_l\\ln\\chi)\n", + "\\end{align}\n", + "$$\n", + "where $\\partial_l\\gamma_{ij}=\\partial_l(\\chi^{-1}\\tilde\\gamma_{ij})\n", + " =\\chi^{-1}(\\partial_l\\tilde{\\gamma}_{ij}-\\chi^{-1}\\partial_l\\chi\\tilde\\gamma_{ij})\n", + " =\\chi^{-1}(\\partial_l\\tilde{\\gamma}_{ij}-\\partial_l\\ln\\chi\\tilde\\gamma_{ij})$" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "25401775-5b5d-40eb-9da2-4c4845fb2691", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\"Output\"
" + ], + "text/plain": [ + "-Image-" + ] + }, + "execution_count": 8, + "metadata": { + "text/html": [], + "text/plain": [] + }, + "output_type": "execute_result" + } + ], + "source": [ + "Rasterize[eqssof[DDVarlist]//MatrixForm]" + ] + }, + { + "cell_type": "markdown", + "id": "d61f5e53-3dff-453a-9b9b-7c6447d2e4f1", + "metadata": {}, + "source": [ + "#### Rs" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "f2ce0f85-fa51-41a7-bbd7-8a9ea9fe4faf", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\"Output\"
" + ], + "text/plain": [ + "-Image-" + ] + }, + "execution_count": 9, + "metadata": { + "text/html": [], + "text/plain": [] + }, + "output_type": "execute_result" + } + ], + "source": [ + "Rasterize[eqssof[RVarlist]//MatrixForm]" + ] + }, + { + "cell_type": "markdown", + "id": "9ac1d847-e0fa-451c-9f6e-bac3670460e6", + "metadata": {}, + "source": [ + "#### Matter" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "5ddbd250-e7ec-437d-a69a-a1fc753dd032", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\"Output\"
" + ], + "text/plain": [ + "-Image-" + ] + }, + "execution_count": 10, + "metadata": { + "text/html": [], + "text/plain": [] + }, + "output_type": "execute_result" + } + ], + "source": [ + "Rasterize[eqssof[MatterVarlist]//MatrixForm]" + ] + }, + { + "cell_type": "markdown", + "id": "b1c7f63e-2cb3-4340-a0b4-9403f8fe36b6", + "metadata": {}, + "source": [ + "#### Constraint" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "b5b8d296-7b75-4060-905b-713c2fd76e4c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\"Output\"
" + ], + "text/plain": [ + "-Image-" + ] + }, + "execution_count": 11, + "metadata": { + "text/html": [], + "text/plain": [] + }, + "output_type": "execute_result" + } + ], + "source": [ + "Rasterize[eqssof[dAtUUVarlist]//MatrixForm]" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "cbb63715-91d1-4e6d-ba35-7b40bf15078e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\"Output\"
" + ], + "text/plain": [ + "-Image-" + ] + }, + "execution_count": 12, + "metadata": { + "text/html": [], + "text/plain": [] + }, + "output_type": "execute_result" + } + ], + "source": [ + "Rasterize[eqssof[ConstraintVarlist]//MatrixForm]" + ] + }, + { + "cell_type": "markdown", + "id": "32d4d592-2daf-44a2-a037-98803a57e592", + "metadata": {}, + "source": [ + "### EOM (without the adv terms)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "6487352e-9283-4593-9d90-95f3e3bcb72a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\"Output\"
" + ], + "text/plain": [ + "-Image-" + ] + }, + "execution_count": 13, + "metadata": { + "text/html": [], + "text/plain": [] + }, + "output_type": "execute_result" + } + ], + "source": [ + "Rasterize[eqssof[dtEvolVarlist]//MatrixForm]" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Wolfram Language 14.1", + "language": "Wolfram Language", + "name": "wolframlanguage14.1" + }, + "language_info": { + "codemirror_mode": "mathematica", + "file_extension": ".m", + "mimetype": "application/vnd.wolfram.m", + "name": "Wolfram Language", + "pygments_lexer": "mathematica", + "version": "12.0" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Z4cow/wolfram/wl/Z4c_rhs.wl b/Z4cow/wolfram/wl/Z4c_rhs.wl index 3618709a..6caf8ba2 100644 --- a/Z4cow/wolfram/wl/Z4c_rhs.wl +++ b/Z4cow/wolfram/wl/Z4c_rhs.wl @@ -26,7 +26,7 @@ SetEQN[Gt[k_, i_, j_], invgamt[k, l] GtDDD[-l, i, j]]; SetEQN[trGtd[i_], invgamt[k, l] Gt[i, -k, -l]]; -SetEQN[dgam[k_, i_, j_], W[] ^ -2 (-2 dlnW[k] gamt[i, j] + dgamt[k, i, j]]); +SetEQN[dgam[k_, i_, j_], W[] ^ -2 (-2 dlnW[k] gamt[i, j] + dgamt[k, i, j])]; SetEQN[GamDDD[k_, i_, j_], 1/2 (dgam[i, j, k] + dgam[j, k, i] - dgam[k, i, j])];