On 11 Aug 2015, at 15:07, Comer Duncan comer.duncan@gmail.com wrote:
Hi Ian,
Yes, I have a recurring error which I can't track down. In fact there are probably several things wrong with the script. I am attaching the script BrillAnalytic.m and BrillAnalytic.err. I can not seem to locate a missing paren or bracket or brace. vi tells me that there is a mismatch of 1 in the occurrence of a '[' and a ']' . Also I am not at all sure that I have configured the calculation of TrRicci correctly. On one hand I specify gxx,gxy,gxz, etc but never associate these expressions with g[la,lb]. I guess I don't understand well enough the working of Kranc. Thanks for taking a look!
Hi Comer,
Observations in the order I have them:
You can't define q[rho1_,zcyl_] in the way that you have, inside the calculation. The mathematica expression f[x_] := y has the effect of defining the function f, but returns Null. So you effectively have
epsi -> one, Null, rho1 -> Sqrt[x*x + y*y],
in your calculation. Just move this to outside the calculation.
Get["KrancThorn`]"; should be Get["KrancThorn`"]; *that* was a subtle mistake! I commented out the whole of the rest of the file before I found it! The issue is that the closing parenthesis is inside the string (before the ") so Mathematica thinks the whole of the rest of the file is inside the Get[], and when it reaches the end of the file, it complains that the Get hasn't been terminated. This is your main error.
1/detg detgExpr is indeed 1. However, detg is calculated from g only once, rather than in every component of gu, so it is more efficient.
You need to define g as a tensor. Anything which is used as a tensor in the .m file needs to be defined as a tensor with DefineTensor. This is the cause of the RecursionLimit errors, which happen in MatrixInverse. Kranc could in fact detect this; I am thinking about how to add such a check.
The standard 3+1 metric variables are defined in the ADMBase thorn, and are called gxx, gxy, etc. Kranc needs tensors to be called g11, g12, etc, so we usually just redefine these components: g11=gxx; g21=gxy; g22=gyy; g31=gxz; g32=gyz; g33=gzz
You might want to take a look at
https://bitbucket.org/einsteintoolkit/einsteinanalysis/src/master/WeylScal4/...
which is a thorn for computing the Weyl scalars from the ADMBase variables, which is similar to what you are trying to do in TrRicciCalc.
Hi Ian,
I've made some changes taking info from the WeylScalar thorn stuff, but apparently not really well enough. I am attaching the BrillAnalytic.err and BrillAnalytic.m files. The error I get indicates that there is a big mismatch between expected argument number (2) and 'passed' (17)!. I can not tell where this is coming from from the error. Can you take a look, please?
Thanks.
Comer
On Tue, Aug 11, 2015 at 10:45 AM, Ian Hinder ian.hinder@aei.mpg.de wrote:
On 11 Aug 2015, at 15:07, Comer Duncan comer.duncan@gmail.com wrote:
Hi Ian,
Yes, I have a recurring error which I can't track down. In fact there are probably several things wrong with the script. I am attaching the script BrillAnalytic.m and BrillAnalytic.err. I can not seem to locate a missing paren or bracket or brace. vi tells me that there is a mismatch of 1 in the occurrence of a '[' and a ']' . Also I am not at all sure that I have configured the calculation of TrRicci correctly. On one hand I specify gxx,gxy,gxz, etc but never associate these expressions with g[la,lb]. I guess I don't understand well enough the working of Kranc. Thanks for taking a look!
Hi Comer,
Observations in the order I have them:
- You can't define q[rho1_,zcyl_] in the way that you have, inside the
calculation. The mathematica expression f[x_] := y has the effect of defining the function f, but returns Null. So you effectively have
epsi -> one, Null, rho1 -> Sqrt[x*x + y*y],in your calculation. Just move this to outside the calculation.
Get["KrancThorn`]"; should be Get["KrancThorn`"]; *that* was a subtle mistake! I commented out the whole of the rest of the file before I found it! The issue is that the closing parenthesis is inside the string (before the ") so Mathematica thinks the whole of the rest of the file is inside the Get[], and when it reaches the end of the file, it complains that the Get hasn't been terminated. This is your main error.
1/detg detgExpr is indeed 1. However, detg is calculated from g only once, rather than in every component of gu, so it is more efficient.
You need to define g as a tensor. Anything which is used as a tensor in the .m file needs to be defined as a tensor with DefineTensor. This is the cause of the RecursionLimit errors, which happen in MatrixInverse. Kranc could in fact detect this; I am thinking about how to add such a check.
The standard 3+1 metric variables are defined in the ADMBase thorn, and are called gxx, gxy, etc. Kranc needs tensors to be called g11, g12, etc, so we usually just redefine these components: g11=gxx; g21=gxy; g22=gyy; g31=gxz; g32=gyz; g33=gzz
You might want to take a look at
https://bitbucket.org/einsteintoolkit/einsteinanalysis/src/master/WeylScal4/...
which is a thorn for computing the Weyl scalars from the ADMBase variables, which is similar to what you are trying to do in TrRicciCalc.
-- Ian Hinder http://members.aei.mpg.de/ianhin
Here are the two files. Sorry.
Comer
On Wed, Aug 12, 2015 at 11:16 AM, Comer Duncan comer.duncan@gmail.com wrote:
Hi Ian,
I've made some changes taking info from the WeylScalar thorn stuff, but apparently not really well enough. I am attaching the BrillAnalytic.err and BrillAnalytic.m files. The error I get indicates that there is a big mismatch between expected argument number (2) and 'passed' (17)!. I can not tell where this is coming from from the error. Can you take a look, please?
Thanks.
Comer
On Tue, Aug 11, 2015 at 10:45 AM, Ian Hinder ian.hinder@aei.mpg.de wrote:
On 11 Aug 2015, at 15:07, Comer Duncan comer.duncan@gmail.com wrote:
Hi Ian,
Yes, I have a recurring error which I can't track down. In fact there are probably several things wrong with the script. I am attaching the script BrillAnalytic.m and BrillAnalytic.err. I can not seem to locate a missing paren or bracket or brace. vi tells me that there is a mismatch of 1 in the occurrence of a '[' and a ']' . Also I am not at all sure that I have configured the calculation of TrRicci correctly. On one hand I specify gxx,gxy,gxz, etc but never associate these expressions with g[la,lb]. I guess I don't understand well enough the working of Kranc. Thanks for taking a look!
Hi Comer,
Observations in the order I have them:
- You can't define q[rho1_,zcyl_] in the way that you have, inside
the calculation. The mathematica expression f[x_] := y has the effect of defining the function f, but returns Null. So you effectively have
epsi -> one, Null, rho1 -> Sqrt[x*x + y*y],in your calculation. Just move this to outside the calculation.
Get["KrancThorn`]"; should be Get["KrancThorn`"]; *that* was a subtle mistake! I commented out the whole of the rest of the file before I found it! The issue is that the closing parenthesis is inside the string (before the ") so Mathematica thinks the whole of the rest of the file is inside the Get[], and when it reaches the end of the file, it complains that the Get hasn't been terminated. This is your main error.
1/detg detgExpr is indeed 1. However, detg is calculated from g only once, rather than in every component of gu, so it is more efficient.
You need to define g as a tensor. Anything which is used as a tensor in the .m file needs to be defined as a tensor with DefineTensor. This is the cause of the RecursionLimit errors, which happen in MatrixInverse. Kranc could in fact detect this; I am thinking about how to add such a check.
The standard 3+1 metric variables are defined in the ADMBase thorn, and are called gxx, gxy, etc. Kranc needs tensors to be called g11, g12, etc, so we usually just redefine these components: g11=gxx; g21=gxy; g22=gyy; g31=gxz; g32=gyz; g33=gzz
You might want to take a look at
https://bitbucket.org/einsteintoolkit/einsteinanalysis/src/master/WeylScal4/...
which is a thorn for computing the Weyl scalars from the ADMBase variables, which is similar to what you are trying to do in TrRicciCalc.
-- Ian Hinder http://members.aei.mpg.de/ianhin
Hi,
I am trying to make a Kranc file to build a thorn to make a Brill wave using CT_Cosmology. I am bogged down with errors in the script and would appreciate some help in getting the thing to work. I am attaching the script and the output err file. Basically what I am trying to do is to build a single kranc file to handle the specification of the initial metric and extrinsic curvature and have the Hamiltonian constraint solved using the CT_Cosmology thorn CT_Multilevel. I have been trying to copy existing thorns but have not been able to iron out the problems.
Thanks for the help!
Comer
On Wed, Aug 12, 2015 at 11:17 AM, Comer Duncan comer.duncan@gmail.com wrote:
Here are the two files. Sorry.
Comer
On Wed, Aug 12, 2015 at 11:16 AM, Comer Duncan comer.duncan@gmail.com wrote:
Hi Ian,
I've made some changes taking info from the WeylScalar thorn stuff, but apparently not really well enough. I am attaching the BrillAnalytic.err and BrillAnalytic.m files. The error I get indicates that there is a big mismatch between expected argument number (2) and 'passed' (17)!. I can not tell where this is coming from from the error. Can you take a look, please?
Thanks.
Comer
On Tue, Aug 11, 2015 at 10:45 AM, Ian Hinder ian.hinder@aei.mpg.de wrote:
On 11 Aug 2015, at 15:07, Comer Duncan comer.duncan@gmail.com wrote:
Hi Ian,
Yes, I have a recurring error which I can't track down. In fact there are probably several things wrong with the script. I am attaching the script BrillAnalytic.m and BrillAnalytic.err. I can not seem to locate a missing paren or bracket or brace. vi tells me that there is a mismatch of 1 in the occurrence of a '[' and a ']' . Also I am not at all sure that I have configured the calculation of TrRicci correctly. On one hand I specify gxx,gxy,gxz, etc but never associate these expressions with g[la,lb]. I guess I don't understand well enough the working of Kranc. Thanks for taking a look!
Hi Comer,
Observations in the order I have them:
- You can't define q[rho1_,zcyl_] in the way that you have, inside
the calculation. The mathematica expression f[x_] := y has the effect of defining the function f, but returns Null. So you effectively have
epsi -> one, Null, rho1 -> Sqrt[x*x + y*y],in your calculation. Just move this to outside the calculation.
Get["KrancThorn`]"; should be Get["KrancThorn`"]; *that* was a subtle mistake! I commented out the whole of the rest of the file before I found it! The issue is that the closing parenthesis is inside the string (before the ") so Mathematica thinks the whole of the rest of the file is inside the Get[], and when it reaches the end of the file, it complains that the Get hasn't been terminated. This is your main error.
1/detg detgExpr is indeed 1. However, detg is calculated from g only once, rather than in every component of gu, so it is more efficient.
You need to define g as a tensor. Anything which is used as a tensor in the .m file needs to be defined as a tensor with DefineTensor. This is the cause of the RecursionLimit errors, which happen in MatrixInverse. Kranc could in fact detect this; I am thinking about how to add such a check.
The standard 3+1 metric variables are defined in the ADMBase thorn, and are called gxx, gxy, etc. Kranc needs tensors to be called g11, g12, etc, so we usually just redefine these components: g11=gxx; g21=gxy; g22=gyy; g31=gxz; g32=gyz; g33=gzz
You might want to take a look at
https://bitbucket.org/einsteintoolkit/einsteinanalysis/src/master/WeylScal4/...
which is a thorn for computing the Weyl scalars from the ADMBase variables, which is similar to what you are trying to do in TrRicciCalc.
-- Ian Hinder http://members.aei.mpg.de/ianhin
On 17/08/15 21:09, Comer Duncan wrote:
Hi,
I am trying to make a Kranc file to build a thorn to make a Brill wave using CT_Cosmology. I am bogged down with errors in the script and would appreciate some help in getting the thing to work. I am attaching the script and the output err file. Basically what I am trying to do is to build a single kranc file to handle the specification of the initial metric and extrinsic curvature and have the Hamiltonian constraint solved using the CT_Cosmology thorn CT_Multilevel. I have been trying to copy existing thorns but have not been able to iron out the problems.
Hi Comer!
I notice that you use an underscore in one of your calculation names. This will almost certainly interfere with the way Mathematica uses underscores and should be avoided. You can, for instance, simply call the calculation "BrillAnalyticCalc".
Eloisa
On 17 Aug 2015, at 22:23, Eloisa Bentivegna eloisa.bentivegna@ct.infn.it wrote:
On 17/08/15 21:09, Comer Duncan wrote:
Hi,
I am trying to make a Kranc file to build a thorn to make a Brill wave using CT_Cosmology. I am bogged down with errors in the script and would appreciate some help in getting the thing to work. I am attaching the script and the output err file. Basically what I am trying to do is to build a single kranc file to handle the specification of the initial metric and extrinsic curvature and have the Hamiltonian constraint solved using the CT_Cosmology thorn CT_Multilevel. I have been trying to copy existing thorns but have not been able to iron out the problems.
Hi Comer!
I notice that you use an underscore in one of your calculation names. This will almost certainly interfere with the way Mathematica uses underscores and should be avoided. You can, for instance, simply call the calculation "BrillAnalyticCalc".
Yes, that seems to be the problem. When you define a calculation, you usually assign it to a Mathematica variable so that it can be referred to later in the arguments to CreateThornTT. In Comer's example, this Mathematica variable has an underscore, i.e.
CT_BrillAnalyticCalc = { Name -> ThornName , ... }
where ThornName has been previously defined. This is "bad" because the underscore is used by Mathematica to indicate patterns, so CT_BrillAnalyticCalc is interpreted as Pattern[CT,Blank[BrillAnalyticCalc]]. i.e.
In[560]:= FullForm[CT_BrillAnalyticCalc] Out[560]//FullForm= Pattern[CT,Blank[BrillAnalyticCalc]]
By using an underscore on the left hand side of an assignment, you are actually telling Mathematica to create a rule for replacing expressions with head BrillAnalyticCalc. I don't think there's any way that Kranc can detect this sort of error, as it might be something you are legitimately using in the Kranc script (which is just a Mathematica program calling CreateThorn from Kranc, which could be thought of as a library). Probably the error message could be more explicit if the value passed is a pattern, and warn the user not to use underscores in variable names. I have created an issue (https://github.com/ianhinder/Kranc/issues/130) for this. This was part of the motivation for the "script language" (pre-production, do not use yet!) where we define an entirely new syntax, which is very restrictive. i.e. it can only express Kranc calculations; you cannot write generic programs which produce your thorn. Ideally, users could start with this, which would have much more stringent error checking available, and only if they wanted to apply more "programmatic" code generation, would they use Kranc from the Mathematica API.
users@lists.einsteintoolkit.org