Cadabra Q&A - Recent questions and answers
https://cadabra.science/qa/qa
Powered by Question2Answerfunction evaluate output a wrong order of SelfAntiCommuting objects
https://cadabra.science/qa/2543/function-evaluate-output-wrong-selfanticommuting-objects
<p>Hi, the following codes output a wrong result.</p>
<pre><code>{x,y}::Coordinate;
{a,b,c,d,e,f# }::Indices(vielbein, values={x,y}, position=independent);
{a,b,c,d,e,f# }::Integer(range=0..1)
\gamma_{a}::SelfAntiCommuting.
\omega^{a b}::AntiSymmetric.
ex:= xxx = \gamma_{a} \gamma_{b} \omega^{a b} ;
evaluate(ex,rhsonly=True,simplify=False);</code></pre>
<p>I obtained</p>
<p>$\gamma_x \gamma_y \omega^{y x} +\gamma_y \gamma_x \omega^{x y}$</p>
<p>The right result should be </p>
<p>$\gamma_x \gamma_y \omega^{x y} +\gamma_y \gamma_x \omega^{y x}$</p>
<p>Any suggestion would be greatly appreciated!</p>Bug reportshttps://cadabra.science/qa/2543/function-evaluate-output-wrong-selfanticommuting-objectsWed, 20 Sep 2023 13:33:27 +0000Answered: symmetrise slots function
https://cadabra.science/qa/2538/symmetrise-slots-function?show=2540#a2540
<p>As an alternative to doxdrum's answer, if you know the names of the indices, you can use <code>sym</code>, e.g.</p>
<pre><code>ex:= R_{a b} R_{c d} h_{s w} h^{a c} h^{b d};
sym(ex, $_{s}, _{w}$);</code></pre>
<p>There is also <code>asym</code> for anti-symmetrisation.</p>General questionshttps://cadabra.science/qa/2538/symmetrise-slots-function?show=2540#a2540Fri, 15 Sep 2023 07:59:25 +0000Answered: Module "cdb.core.component" cannot be imported
https://cadabra.science/qa/2534/module-cdb-core-component-cannot-be-imported?show=2537#a2537
<p>Sorry for the wait. Just to explain the logic: this function <code>get_component</code> used to be implemented in Python (the commented-out bit you noticed), but was at some point rewritten in C++ for a number of reasons. Since then, the <code>cdb.core.component</code> Python module just imports <code>cdb.core._component</code> (with underscore). This is a separate C++ library, which should have been installed with the build, but either wasn't, or is not in a path where Python looks for it.</p>
<p>I cannot reproduce it on my macOS machine either, but will do some digging on a clean machine to see what might be the problem (Python search paths are notoriously tricky to get right across multiple platforms).</p>Bug reportshttps://cadabra.science/qa/2534/module-cdb-core-component-cannot-be-imported?show=2537#a2537Fri, 08 Sep 2023 17:40:08 +0000Lie derivative in Cadabra
https://cadabra.science/qa/2533/lie-derivative-in-cadabra
<p>Hi,
I couldn't find any mention of the Lie derivative in any documentation of Cadabra (this website, github, additional literature).
I'm trying to write a method that expands the expression Lie_V{\<tensor-with_free_indices>} into the formula of the <a rel="nofollow" href="https://en.wikipedia.org/wiki/Lie_derivative#Coordinate_expressions">Lie derivative with partial derivatives</a>. The method will be something like
expand_Lie(ex,$V$,$m$)
The first argument is some expression that has inside "L{...}", the second argument is the vector, and the third argument is for a dummy index.</p>
<p>I started working with the code in p.36 of "The Cadabra Book.pdf" (by Peeters) - this implements expansion of the covariant derivative (nabla).</p>
<p>I need help to add a dummy index to the first term (replacing "L{..}") and multiplying it by the vector. My code currently changes change the name "L" into the "v^{p} \partial_{p}" but I think this is incorrect.</p>
<pre><code>def expand_Lie(ex,v,dummy):
for Lie in ex["L"]:
Lie.name=r"v^{p} \partial_{p}"
#Lie.indices().add(@(dummy)})
#Lie *= v^{@(dummy)}
for arg in Lie.args():
ret:=0;
for index in arg.free_indices():
t2:= @(arg);
if index.parent_rel==sub:
t1:= \partial_{@(index)}{v^{@(dummy)}};
t2[index]:= _{@(dummy)};
else:
t1:= -\partial_{@(dummy)}{v^{@(index)}};
t2[index]:= ^{@(dummy)};
ret += Ex(str(Lie.multiplier)) * t1 * t2
Lie += ret
return ex</code></pre>
<p>`</p>General questionshttps://cadabra.science/qa/2533/lie-derivative-in-cadabraTue, 22 Aug 2023 20:29:20 +0000Answered: Why doesn't distribute() completely expand products involving sums of kronecker deltas?
https://cadabra.science/qa/2518/doesnt-distribute-completely-products-involving-kronecker?show=2527#a2527
<p>I think the solution is actually very simple: you are missing a space between the <code>X_{c d}</code> and the opening bracket. This means that Cadabra interprets this as a tensor with argument given by whatever is in the brackets, <strong>not</strong> as a product of two tensors.</p>General questionshttps://cadabra.science/qa/2518/doesnt-distribute-completely-products-involving-kronecker?show=2527#a2527Tue, 20 Jun 2023 11:54:40 +0000Windows 11 source install
https://cadabra.science/qa/2516/windows-11-source-install
<p>I've been following the instructions in the git release's readme.rst and setting up to build cababra on windows, but I ran into an issue at the step:</p>
<pre><code>
cmake -DCMAKE_TOOLCHAIN_FILE=C:/Users/chris/vcpkg/scripts/buildsystems/vcpkg.cmake
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DVCPKG_TARGET_TRIPLET=x64-windows
-DCMAKE_INSTALL_PREFIX=C:\Cadabra
-G "Visual Studio 17 2022" -A x64 ..</code></pre>
<p>It runs fine until I get the error:</p>
<pre><code>-------------------------------------------
Configuring packages
-------------------------------------------
-- Storing algorithm C++ module as core
-- Storing algorithm C++ module as utils
CMake Error at cmake/functions.cmake:11 (install):
Syntax error in cmake code at
C:/Users/chris/cadabra2/cmake/functions.cmake:12
when parsing string
C:\Users\chris\anaconda3
Invalid character escape '\U'.
Call Stack (most recent call first):
core/CMakeLists.txt:428 (install_directory_permissions)
-- Configuring incomplete, errors occurred!</code></pre>
<p>Not sure how to get around this, looking online suggests it is some forward slash and backslash confusion between windows and cmake when specifying directories.</p>
<p>Any help would be great!</p>Installation troublehttps://cadabra.science/qa/2516/windows-11-source-installTue, 06 Jun 2023 13:36:55 +0000Answered: Unexpected behaviour of zoom()
https://cadabra.science/qa/2513/unexpected-behaviour-of-zoom?show=2514#a2514
<p>Hi Jsem.</p>
<ul>
<li>I'd first suggest that you show the results of your manipulations. Many of your calculations are a waste of time.</li>
<li>If you see the suggested notation for derivatives is to use curly bracket, not bracket. Example: <code>\delta{L}</code> instead of <code>\delta(L)</code>.</li>
<li>When you derive an object with indices, the indices should be inside the curly brackets. Example: <code>\delta{g^{\mu \nu}}</code> instead of <code>\delta{g}^{\mu \nu}</code></li>
</ul>
<p>When you apply the last suggestion to your substitution rule, the <code>zoom</code> algorithm yields the expected result.</p>
<hr>
<h1>What was going on?</h1>
<p>If you take the "incorrect" result, copy it (sellect it with the mouse and use Ctrl+C from the keyboard), and paste it in a editor, you'd get something like this:</p>
<pre><code>\begin{dmath*}{} - \frac{1}{2}\sqrt{g} F_{\alpha \beta} F_{\mu \nu} \delta{g^{\mu \alpha}} g^{\nu \beta} - \frac{1}{2}\sqrt{g} F_{\alpha \beta} \delta{F_{\mu \nu}} g^{\alpha \mu} g^{\beta \nu}+\frac{1}{8}F_{\alpha \beta} F_{\mu \nu} \sqrt{g} g_{\lambda \kappa} \delta{g}\,^{\lambda \kappa} g^{\mu \alpha} g^{\nu \beta}\end{dmath*}</code></pre>
<p>There, you'll see that the two terms containing the $\delta g^{\mu\nu}$ differ in the "scope" of the derivative.</p>General questionshttps://cadabra.science/qa/2513/unexpected-behaviour-of-zoom?show=2514#a2514Sun, 04 Jun 2023 10:34:48 +0000Answered: Maxwell equations in curved space
https://cadabra.science/qa/2509/maxwell-equations-in-curved-space?show=2511#a2511
<p>Hi Jsem. Interesting problem to work on.</p>
<p>I tryied to obtain the expected result... but I started to go down the rabbit hole! However, I have a couple of suggestions:</p>
<ul>
<li>The <code>distribute</code> before the substitution of $\delta \nabla A$ is unnecessary.</li>
<li>Instead of <code>canonicalise</code> the algorithm <code>meld</code> manages more efficiently the symmetries of the geometrical objects.</li>
<li>Use the <code>sort_product</code> and <code>rename_dummies</code> algorithms.</li>
</ul>
<hr>
<h1>Updated version</h1>
<p>I was writing the above solution, and then it occurs to me that the problem came through the terms $\delta\Gamma$.</p>
<p>So, after declaring the symmetry for those terms,</p>
<pre><code>\delta{\Gamma}^{\mu?}_{\nu? \rho?}::TableauSymmetry(shape={2}, indices={1,2}).</code></pre>
<p>the <code>meld</code> algorithm works as expected!!!</p>
<p>Hope it would be useful.</p>General questionshttps://cadabra.science/qa/2509/maxwell-equations-in-curved-space?show=2511#a2511Fri, 02 Jun 2023 12:47:48 +0000Answered: Is eliminate_metric supposed to move partial derivative indices?
https://cadabra.science/qa/2508/eliminate_metric-supposed-move-partial-derivative-indices?show=2510#a2510
<p>Interestingly, if you write the metric inside the derivative the desired result,</p>
<pre><code>expr:=\partial_{\nu}{ g^{\mu \nu} A_{\mu}};
eliminate_metric(_);</code></pre>
<p>I think that the behaviour differs because you cannot take in/out freely the metric from the expression.</p>
<p>Personally, I find your question very interesting!</p>General questionshttps://cadabra.science/qa/2508/eliminate_metric-supposed-move-partial-derivative-indices?show=2510#a2510Thu, 01 Jun 2023 14:54:59 +0000Answered: The Solution of Einstein's Equation in General Dimensions
https://cadabra.science/qa/2492/the-solution-of-einsteins-equation-in-general-dimensions?show=2502#a2502
<p>Did you manage to solve this problem? If there was a covariant way of writing the <code>v, t, z</code> coordinate part of the metric, the <code>split_index</code> command works great. On the other hand, if you had a fixed dimension, it's easy to specify coordinates and work things out. It would be nice to have an elegant solution to combine these. </p>
<p>There is an ugly solution instead. Which is to use the Kaluza-Klein example (<a rel="nofollow" href="https://cadabra.science/notebooks/kaluza_klein.html">see here</a>) to <code>split_index</code> recursively. And then you can manually write all the equations of motion of interest separately for the t, z, and mixed components. And you would have covariant expressions for the <code>i, j</code> and <code>\alpha, \beta</code> parts.</p>
<p>Here's the ugly potential solution in more detail: </p>
<ol>
<li>Start with an expression written in terms of "total" indices <code>M, N</code>, etc. First use <code>split_index</code> to split the total space-time from these <code>M, N</code> indices to, say, <code>a, b</code> and <code>A, B</code> indices. </li>
<li>And then apply a subsequent <code>split_index</code> to split <code>A, B</code> into your <code>i, j</code> and <code>\alpha, \beta</code> indices. Until here, it is currently possible to do using <code>split_index</code> as it stands. </li>
<li>However, the missing piece is a way to write the <code>a, b, c</code> part of the metric in terms of the specific coordinates <code>v, t, z</code> with an explicit metric of choice as you have it. If there way to do this last piece of the metric by say specifying <code>g_{a b}</code> to be a the three-metric you have, it would have been great. </li>
<li>What you can do, instead, is to use <code>split_index</code> three times for each of the coordinates as is done in the Kaluza-Klein example quoted above. This is admittedly tedious and rather ugly. </li>
</ol>
<p>But unfortunately, as far as I know, there's no way to carry out the third step together with the first two to achieve what you want to do directly. Perhaps @Kasper has an elegant solution? Please drop a line here if you manage to solve this issue. Otherwise, I hope the tedious solution helps...</p>General questionshttps://cadabra.science/qa/2492/the-solution-of-einsteins-equation-in-general-dimensions?show=2502#a2502Mon, 15 May 2023 19:15:11 +0000Autocomplete on Jupyter Notebook acting weird
https://cadabra.science/qa/2499/autocomplete-on-jupyter-notebook-acting-weird
<p>Whenever I try to use autocompletion on Jupyter notebooks it always autocompletes with "a.echo1" or by appending "ho1" to the last "a.echo1" it autocompleted. Has autcomplete been integrated in the Jupyter kernel yet or is there something wrong with my setup? Thank you</p>Bug reportshttps://cadabra.science/qa/2499/autocomplete-on-jupyter-notebook-acting-weirdTue, 25 Apr 2023 11:04:30 +0000Answered: Question about manip.apply_through()
https://cadabra.science/qa/2494/question-about-manip-apply_through?show=2495#a2495
<p>Hi jsem.</p>
<p>Firstly, I'd recommend that when asking for help you would include a "complete" example of your code (aka minimal working example or MWE), because there are some needed background definitions you are using. Cover that, let's move to your code.</p>
<ul>
<li>The algorithm <code>apply_through</code> is part of a module, <code>cdb.core.manip</code> which has to be imported using <code>import cdb.core.manip as manip</code>.</li>
<li>The operator you want to apply has to be surrounded by dollar signs, <code>$\partial_{\rho}{#}$</code>.</li>
</ul>
<p>That's mainly it!</p>
<p>Let me put it all together in an example</p>
<pre><code>import cdb.core.manip as manip
{\mu,\nu,\rho}::Indices.
D{#}::Derivative.
\partial{#}::PartialDerivative.
{A{#},B{#}}::Depends(\partial{#},D{#}).
# ex := A_{\mu \nu} = B_{\mu \nu};
manip.apply_through($A_{\mu \nu} = B_{\mu \nu}$, $\partial_{\rho}{#}$);
manip.apply_through(ex, $D{#}$);</code></pre>
<p>Hope this would be helpful.</p>General questionshttps://cadabra.science/qa/2494/question-about-manip-apply_through?show=2495#a2495Mon, 24 Apr 2023 09:15:55 +0000Answered: eliminate_metric - avoid partial differential
https://cadabra.science/qa/2487/eliminate_metric-avoid-partial-differential?show=2489#a2489
<p>I know that Kasper already answer the question, but I'd like to comment some additional points:</p>
<ul>
<li>The metric should depend on the partial derivatives (perhaps the covariant derivative, if you are working with nonmetricity).</li>
<li>It is useful to denote the indices of the metric as subindices, with the <code>_</code> sign, e.g. <code>g_{m n}</code> instead of <code>g{m n}</code>. Same for the Kronecker delta and the derivatives.</li>
<li>The <code>eliminate_metric</code> algorithm requires an argument, in this case either <code>(test)</code>, or the customary <code>(_)</code> to apply it to the pravious expression.</li>
</ul>
<h2>The modified code</h2>
<pre><code>{x1,x2,x3,x4}::Coordinate;
{k,l,m,n,p,q,r,s,t}::Indices(position=fixed,values=[x1,x2,x3,x4]);
\nabla{#}::Derivative;
\partial{#}::PartialDerivative;
g_{m n}::Metric;
g^{m n}::InverseMetric;
g_{m}^{n}::KroneckerDelta;
g^{m}_{n}::KroneckerDelta;
{g_{m n},g^{m n}}::Depends(\partial{#});
test := Q^{s}_{r m n} -> g^{s k} \partial_{r m}{g_{k n}};
eliminate_metric(_);</code></pre>Bug reportshttps://cadabra.science/qa/2487/eliminate_metric-avoid-partial-differential?show=2489#a2489Thu, 06 Apr 2023 08:09:06 +0000Answered: Errors in function 'evaluate`
https://cadabra.science/qa/2468/errors-in-function-evaluate?show=2480#a2480
<p>I have an another quetion:</p>
<p>The following code:</p>
<pre><code>{\mu,\nu}::Indices(values={t,x,y,z}, position=fixed);
\partial{#}::PartialDerivative;
A{#}::Depends(\partial{#});
h{#}::Depends(\partial{#});
ex:=\partial_{\mu}{h^{\mu\nu} A_{\nu}};
evaluate(_);</code></pre>
<p>The error message is as follows:</p>
<pre><code>RuntimeError: Free indices in different terms in a sum do not match.</code></pre>General questionshttps://cadabra.science/qa/2468/errors-in-function-evaluate?show=2480#a2480Tue, 21 Mar 2023 05:29:11 +0000Answered: Expansion in series
https://cadabra.science/qa/2467/expansion-in-series?show=2473#a2473
<p>I might be mistaken, but I don't think that could be done. To my knowlegde <code>sympy</code> does not manage tensor components. However, I leave you the link to the <a rel="nofollow" href="https://docs.sympy.org/latest/modules/series/series.html">manual (series expansions)</a>.</p>
<p>However, we did a sort of manual approximation to get a result, check the <a rel="nofollow" href="https://cadabra.science/notebooks/einstein_equations.html">user notebooks</a>, or equivalently the section 5 of our pre-print <a rel="nofollow" href="https://inspirehep.net/literature/2159412">Cadabra and Python algorithms in General Relativity and Cosmology I: Generalities</a>.</p>
<p>Although you won't find an answer to your question there, I hope they serve to give you alternative perspective.</p>
<p>Cheers.</p>General questionshttps://cadabra.science/qa/2467/expansion-in-series?show=2473#a2473Mon, 20 Mar 2023 08:28:43 +0000Answered: Incorrect Derivative Free Index Behaviour For User-Defined Symbols
https://cadabra.science/qa/2445/incorrect-derivative-free-index-behaviour-defined-symbols?show=2466#a2466
<p>You cannot use <code>x_\mu</code> or <code>x_\m</code> in the derivative like that. Current github HEAD will report $x_\mu$ and $\mu$ (twice) as free indices in both cases. However, if you use</p>
<pre><code>D_{\mu}{ \theta_\mu }</code></pre>
<p>or in the 2nd case</p>
<pre><code>D_{\m}{\theta_\m}</code></pre>
<p>then things work and (again with current github HEAD) will report no free indices.</p>
<p>Please let me know if this is still a problem with github HEAD (2.4.3.5).</p>Bug reportshttps://cadabra.science/qa/2445/incorrect-derivative-free-index-behaviour-defined-symbols?show=2466#a2466Sun, 12 Mar 2023 18:33:04 +0000Answered: Copy Cadabra output as a LaTeX string
https://cadabra.science/qa/2464/copy-cadabra-output-as-a-latex-string?show=2465#a2465
<p>Cadabra's philosophy is that notebooks should be viewed as code, which you should be able to run from start to end in one shot if needed. This clashes rather strongly with the idea of cutting and pasting (parts of) expressions which are then manipulated in following cells: the information about <em>what</em> you cut and how that should change when any of the earlier cells change is not contained in the notebook. This is very, very bad for reproducibility; try to avoid working like this.</p>
<p>To enforce a better working style, there are various tools in Cadabra to select sub-expressions programmatically and then act with algorithms on only those sub-expressions; I refer to the section on zoom/unzoom in the manual: <a rel="nofollow" href="https://cadabra.science/notebooks/ref_selecting.html">selecting expressions</a></p>
<p>Re-arranging expressions by moving terms to the left/right of an equals sign should be done using <code>to_lhs</code> and <code>to_rhs</code> of the <a rel="nofollow" href="https://cadabra.science/manual/cdb/core/manip.html">cdb.core.manip</a> module. In this way, if you expression changes, you are still sure to do the right thing, and you can run your notebook without doing the cut-n-paste again.</p>
<p>Now having said that (which addresses part 1), I am sympathetic to part 2 of your question: sometimes you simply want to copy a result into a LaTeX file somewhere else. There is no cut-n-paste way to do that, but you can use the <code>pyperclip</code> python module to put the LaTeX form of an expression into the clipboard (and then paste that elsewhere):</p>
<pre><code>import pyperclip as pc
ex:= A_{m} + B_{n} D_{n m};
pc.copy(ex._latex_())</code></pre>
<p>You can then paste the LaTeX form of <code>ex</code> to another program.</p>
<p>Of course you can abuse the above to cut an expression, edit it elsewhere and paste it back into a new input cell, but I would advise you not to do that, and learn instead about <code>zoom/unzoom/to_lhs/to_rhs</code> and various other tools. </p>
<p>Hope this helps.</p>General questionshttps://cadabra.science/qa/2464/copy-cadabra-output-as-a-latex-string?show=2465#a2465Fri, 10 Mar 2023 19:52:49 +0000Answered: How to use Mathematica's simplification
https://cadabra.science/qa/2462/how-to-use-mathematicas-simplification?show=2463#a2463
<p>This should work:</p>
<pre><code> ex:=\sin(x)**2+\cos(x)**2;
map_mma(ex, "Simplify");</code></pre>
<p>and produce "1". </p>
<p>If it does not, something has gone wrong when building Cadabra with Mathematica support. It is possible that your version of Mathematica is too new and was not picked up when you ran <code>cmake -DENABLE_MATHEMATICA=ON ..</code>. Try pulling from github; I have just pushed a change which includes an updated <code>FindMathematica.cmake</code> script.</p>
<p>If that still does not work, send me the output of that cmake run by email and I'll have a look.</p>General questionshttps://cadabra.science/qa/2462/how-to-use-mathematicas-simplification?show=2463#a2463Tue, 28 Feb 2023 13:17:09 +0000Answered: How to print negative powers as fractions?
https://cadabra.science/qa/2460/how-to-print-negative-powers-as-fractions?show=2461#a2461
<p>You can switch to printing-as-fractions using</p>
<pre><code>__cdbkernel__.display_fractions=True</code></pre>
<p>This can be switched between any two cells, you don't have to use it for the entire notebook.</p>General questionshttps://cadabra.science/qa/2460/how-to-print-negative-powers-as-fractions?show=2461#a2461Sun, 26 Feb 2023 15:46:00 +0000Partial derviative indices issues
https://cadabra.science/qa/2459/partial-derviative-indices-issues
<p>As a new user of Cadabra I am a bit confused what is going on with the following code. I am trying to repeat the steps done in Schutz's GR book for equations 6.63 - 6.67 as shown below.</p>
<p>Note I have edited my original post and added print outputs for when I substitute Gammpd into the equation for R. Cut and paste of my outputs produced garbage. </p>
<pre><code>{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u#}::Indices(name=fixed,position=fixed).
{\alpha,\beta,\nu,\mu,\sigma}::Indices(name=fixed,position=fixed);
{\rho,\delta,\kappa,\theta}::Indices(name=fixed,position=fixed);
\partial{#}::PartialDerivative.
\Gamma^{a}_{b c}::TableauSymmetry(shape={2}, indices={1,2});
g_{a b}::Metric.
;::Symbol;
# see https://cadabra.science/qa/473/is-this-legal-syntax
# this code works with and without this trick</code></pre>
<pre><code>R := R^{\alpha}_{\beta \mu \nu} -> \partial_{\mu}{\Gamma^{\alpha}_{\beta \nu}}
-\partial_{\nu}{\Gamma^{\alpha}_{\beta \mu}}
+\Gamma^{\alpha}_{\sigma \mu} \Gamma^{\sigma}_{\beta \nu}
-\Gamma^{\alpha}_{\sigma \nu} \Gamma^{\sigma}_{\beta \mu};
exp := R^{\alpha}_{\beta \mu \nu};
substitute(exp,R);
Gammapd := \partial_{\sigma}{\Gamma^{\alpha}_{\mu \nu}} -> (1/2) g^{\alpha \beta}
(\partial_{\nu \sigma}{g_{\beta \mu}} + \partial_{\mu \sigma}{g_{\beta \nu}}
-\partial_{\beta \sigma}{g_{\mu \nu}});
substitute(exp,Gammapd);
</code></pre>
<p>Doing the above results in :</p>
<p>1/2 g^{α β}(\partial<em>{ν μ}(g</em>{β β})) - 1/2 g^{α β}(\partial<em>{μ ν}(g</em>{β β})) + Γ^{α}<em>{σ μ} Γ^{σ}</em>{β ν}-Γ^{α}<em>{σ ν} Γ^{σ}</em>{β μ}</p>
<p>Using the following for Gammapd I get what I think is correct.</p>
<pre><code>Gammapd := \partial_{\sigma}{\Gamma^{\alpha}_{\mu \nu}} -> (1/2) g^{\alpha a}
(\partial_{\nu \sigma}{g_{a \mu}} + \partial_{\mu \sigma}{g_{a \nu}}
-\partial_{a \sigma}{g_{\mu \nu}});
</code></pre>
<p>1/2 g^{α a}(\partial<em>{ν μ}(g</em>{a β}) + \partial<em>{β μ}(g</em>{a ν})-\partial<em>{a μ}(g</em>{β ν})) - 1/2 g^{α a}(\partial<em>{μ ν}(g</em>{a β}) + \partial<em>{β ν}(g</em>{a μ})-\partial<em>{a ν}(g</em>{β μ})) + Γ^{α}<em>{σ μ} Γ^{σ}</em>{β ν}-Γ^{α}<em>{σ ν} Γ^{σ}</em>{β μ}</p>
<p>Note here that that \partial<em>{ν μ}(g</em>{a β}) should cancel out with \partial<em>{μ ν}(g</em>{a β}. In Shutz we are considering the inertial frame so all the Gammas = 0.</p>
<p>From Schutz: (the alpha on R is contravariant as are the metric's alpha sigma indices)</p>
<p>Rα βμν = 12 gασ (gσβ,νμ + gσ ν,βμ − gβν,σ μ
− gσβ,μν − gσ μ,βν + gβμ,σ ν ).
(6.65)</p>
<p>I would paste pictures of the Schutz equation and of my output but I can't seem to do that here and I'm not sure why?</p>
<p>I have also used:</p>
<pre><code>Gammapd := \partial_{\sigma}{\Gamma^{\alpha}_{\mu \nu}} -> (1/2) g^{a b}
(\partial_{c d}{g_{b e}} + \partial_{e d}{g_{b c}}
-\partial_{b d}{g_{e c}});</code></pre>
<p>for my substitution and for that I get:
Γ^{α}<em>{σ μ} Γ^{σ}</em>{β ν}-Γ^{α}<em>{σ ν} Γ^{σ}</em>{β μ} </p>
<p>only the Gamma terms? </p>
<p>Do I somehow have to use Depends or something to get this to work. Why are the terms with the double partial derivatives not canceling when the indices are symmetric?</p>General questionshttps://cadabra.science/qa/2459/partial-derviative-indices-issuesMon, 20 Feb 2023 20:14:18 +0000Answered: Broken link in manual: `Weight`
https://cadabra.science/qa/2439/broken-link-in-manual-weight?show=2455#a2455
<p>Thanks, now fixed.</p>Bug reportshttps://cadabra.science/qa/2439/broken-link-in-manual-weight?show=2455#a2455Thu, 16 Feb 2023 08:32:45 +0000Answered: Progress bar
https://cadabra.science/qa/2451/progress-bar?show=2454#a2454
<p><strong>Edit:</strong> sorry, I was wrong, the example below doesn't work either. Let me investigate.</p>
<p>I don't know why this minimal example does not work, but what does work is the <code>tqdm.notebook</code> version, which is meant for use in Jupyter notebooks:</p>
<pre><code>from tqdm.notebook import tqdm
import time
for i in tqdm(range(10000)):
time.sleep(.1)
pass</code></pre>
<p>So import <code>tqdm</code> from <code>tqdm.notebook</code>, not from <code>tqdm</code>.</p>
<p>Looks better too, IMHO.</p>General questionshttps://cadabra.science/qa/2451/progress-bar?show=2454#a2454Thu, 16 Feb 2023 08:26:21 +0000Answered: exponents problems
https://cadabra.science/qa/2452/exponents-problems?show=2453#a2453
<p>Use a substitution like</p>
<pre><code> substitute(ex, $\exp(A??) \exp(B??)-> exp(A??+B??)$)</code></pre>
<p>Add the <code>, repeat=True</code> if necessary to make it repeat the process until the expression no longer changes.</p>Bug reportshttps://cadabra.science/qa/2452/exponents-problems?show=2453#a2453Mon, 13 Feb 2023 15:05:56 +0000Answered: Display currently running function
https://cadabra.science/qa/2447/display-currently-running-function?show=2448#a2448
<p>There is some internal functionality for algorithms to send out-of-band progress information to the user interface in v2, but it has mostly been to experiment with it and see what we need. Only the <code>meld</code> algorithm really uses it at the moment. I am not sure we have converged on the right mechanism yet, hence it hasn't been included in other algorithms. </p>
<p>The problem is, as always with logging, that you do not want to log too little, but you also do not want to log too much. However, this distinction is very much a function of the problem you are solving: sometimes you want to see an update for all terms <code>canonicalise</code> acts on, but sometimes that's a very fast part of some inner loop and you are not interested in that. Some nested progress indicator is probably best.</p>
<p>If you have any good ideas, please post.</p>Feature requestshttps://cadabra.science/qa/2447/display-currently-running-function?show=2448#a2448Thu, 02 Feb 2023 19:26:52 +0000Answered: Incorrect behaviour of meld?
https://cadabra.science/qa/2442/incorrect-behaviour-of-meld?show=2446#a2446
<p><code>Meld</code> does at present not work with anticommuting objects. Use <code>canonicalise</code> for now.</p>Bug reportshttps://cadabra.science/qa/2442/incorrect-behaviour-of-meld?show=2446#a2446Sat, 28 Jan 2023 20:56:25 +0000How to get the `weight` value of an object?
https://cadabra.science/qa/2440/how-to-get-the-weight-value-of-an-object
<p>According to the (source) documentation, the <code>weight</code> property:</p>
<blockquote>
<p>Attach a labelled weight to an object, which can subsequently be used in the algorithms <code>keep_weight</code> and <code>drop_weight</code>. See the documentation of those algorithms for examples.</p>
</blockquote>
<p>Examples of it use can be found on the manual pages of the algorithms <a rel="nofollow" href="https://cadabra.science/manual/keep_weight.html">keep_weight</a> and <a rel="nofollow" href="https://cadabra.science/manual/drop_weight.html">drop_weight</a></p>
<h2>Question</h2>
<p>Is it possible to get the <code>weight</code> of an object?</p>
<p>My question is inspire in the uses of algorithms like <code>n_args</code> or <code>n_indices</code> (See <a rel="nofollow" href="https://cadabra.science/manual/cdb/utils/node.html">util.node</a>).</p>General questionshttps://cadabra.science/qa/2440/how-to-get-the-weight-value-of-an-objectSun, 22 Jan 2023 09:26:01 +0000Answered: Index replacement problem
https://cadabra.science/qa/2435/index-replacement-problem?show=2438#a2438
<p>This is bug in <code>eliminate_kronecker</code>, which does not respect the grouping introduced by the inverse power. I have opened an issue at <a rel="nofollow" href="https://github.com/kpeeters/cadabra2/issues/271">https://github.com/kpeeters/cadabra2/issues/271</a> ; will try to fix it but it may take a few days.</p>Bug reportshttps://cadabra.science/qa/2435/index-replacement-problem?show=2438#a2438Wed, 11 Jan 2023 22:30:13 +0000Answered: Can not set the correct Cadabra kernel path for jupyter.
https://cadabra.science/qa/2432/can-not-set-the-correct-cadabra-kernel-path-for-jupyter?show=2433#a2433
<p>see link <a rel="nofollow" href="https://cadabra.science/faq.html#q_01_01">https://cadabra.science/faq.html#q_01_01</a></p>Installation troublehttps://cadabra.science/qa/2432/can-not-set-the-correct-cadabra-kernel-path-for-jupyter?show=2433#a2433Thu, 05 Jan 2023 20:12:51 +0000Answered: Missing directory when running Cadabra for the first time
https://cadabra.science/qa/2428/missing-directory-when-running-cadabra-for-the-first-time?show=2429#a2429
<p>The <code>cadabra2</code> package in Debian/Ubuntu is currently broken, and this leads to the error you showed. Please install a package from the download page at <a rel="nofollow" href="https://cadabra.science/download.html">https://cadabra.science/download.html</a> instead for now.</p>Installation troublehttps://cadabra.science/qa/2428/missing-directory-when-running-cadabra-for-the-first-time?show=2429#a2429Wed, 04 Jan 2023 21:31:50 +0000Answered: Cadabra with Wolfram Engine
https://cadabra.science/qa/2426/cadabra-with-wolfram-engine?show=2427#a2427
<p>I haven't tried with Wolfram Engine, but if what they write is true, then it should work. Be aware that I haven't built against Mathematica for a long time, so things like the CMake support to figure out where the Wolfram software is located on disk may not work. Also, the code that bridges between Cadabra and Mathematica notation is not as tested as that to SymPy.</p>
<p>You do need the Wolfram software installed locally as Cadabra will need the headers of the WRSTP library <a rel="nofollow" href="https://www.wolfram.com/wstp/">https://www.wolfram.com/wstp/</a> to build. I cannot distribute those along with Cadabra as that violates Wolfram's terms. </p>
<p>If you do give it a try, please post here to let us know how it went.</p>General questionshttps://cadabra.science/qa/2426/cadabra-with-wolfram-engine?show=2427#a2427Wed, 04 Jan 2023 17:28:06 +0000Answered: commuting variations and partial derivatives
https://cadabra.science/qa/2424/commuting-variations-and-partial-derivatives?show=2425#a2425
<p>The first <code>substitute</code> does nothing, as there is no explicit <code>A</code> in your expression. If you write, instead of <code>A</code>, a proper object wildcard <code>A??</code> (on both sides of the arrow) then it will work, and then your second substitute will do its job too.</p>General questionshttps://cadabra.science/qa/2424/commuting-variations-and-partial-derivatives?show=2425#a2425Fri, 30 Dec 2022 22:57:31 +0000Answered: Broken link on the webpage documentation
https://cadabra.science/qa/2406/broken-link-on-the-webpage-documentation?show=2421#a2421
<p>Now fixed, thanks.</p>Bug reportshttps://cadabra.science/qa/2406/broken-link-on-the-webpage-documentation?show=2421#a2421Mon, 19 Dec 2022 22:42:44 +0000Answered: Strange triple index error
https://cadabra.science/qa/2405/strange-triple-index-error?show=2420#a2420
<p>This is now fixed in 2.4.3.3, which is currently the head of the github master branch.</p>Bug reportshttps://cadabra.science/qa/2405/strange-triple-index-error?show=2420#a2420Mon, 19 Dec 2022 22:34:23 +0000Answered: Import notebook from subdirectory
https://cadabra.science/qa/2417/import-notebook-from-subdirectory?show=2418#a2418
<p>Do this as you do with any Python module which is stored in a subdirectory: use a "dot" as path separator. So</p>
<pre><code>from directory.notebook_name import *</code></pre>General questionshttps://cadabra.science/qa/2417/import-notebook-from-subdirectory?show=2418#a2418Fri, 16 Dec 2022 22:34:16 +0000Answered: Power with free indices not allowed
https://cadabra.science/qa/2414/power-with-free-indices-not-allowed?show=2415#a2415
<p>You wrote $r^2$ as <code>r^2</code> (in the definition of $g_{u u}$), which means "$r$ with superscript index 2". Write it as <code>r**2</code>. Ditto for $l^2$.</p>General questionshttps://cadabra.science/qa/2414/power-with-free-indices-not-allowed?show=2415#a2415Thu, 15 Dec 2022 21:48:39 +0000Answered: Simplify products of scalar functions
https://cadabra.science/qa/2407/simplify-products-of-scalar-functions?show=2412#a2412
<p>This is what <code>collect_factors</code> is for. In general the <code>simplify</code> function is a sledge-hammer which should be avoided, as it calls through to SymPy to do the work, which is slow and prone to issues when the expression contains concepts which SymPy does not know about (like that implicit dependence).</p>General questionshttps://cadabra.science/qa/2407/simplify-products-of-scalar-functions?show=2412#a2412Thu, 15 Dec 2022 08:37:05 +0000Answered: Installing with apt-get on Linux Mint 21
https://cadabra.science/qa/2398/installing-with-apt-get-on-linux-mint-21?show=2399#a2399
<p>You installed the old 1.x series. The package for the new series (since about 2016) is called cadabra2. You'll need a fairly recent Mint for that though. The alternative is to download a package from the downloads page at <a rel="nofollow" href="https://cadabra.science/download.html">https://cadabra.science/download.html</a> .</p>Installation troublehttps://cadabra.science/qa/2398/installing-with-apt-get-on-linux-mint-21?show=2399#a2399Fri, 09 Dec 2022 07:04:04 +0000Answered: How can I invert the product rule nicely [where there are extra numerical factors]?
https://cadabra.science/qa/2383/invert-product-nicely-where-there-extra-numerical-factors?show=2384#a2384
<p>I could <em>factor</em> the terms as you wanted.</p>
<p>The behaviour of your session might be due to the <code>properties</code> of your objects.</p>
<p>I took your (incomplete) example, and re-ensembled it like this:</p>
<pre><code>{a,b}::Indices.
\partial{#}::PartialDerivative.
{A,B,C,D}::Depends(\partial{#}).
ex := \partial_{a}{A} B + A \partial_{a}{B};
rule := \partial_{b?}{C??} D?? + C?? \partial_{b?}{D??}
-> \partial_{b?}{C?? D??};
substitute(ex, rule);</code></pre>
<hr>
<p><strong>Update</strong></p>
<p><code>Physics Cat</code> thank you for highlighting that the extra factor of <code>2</code> was not a typo.</p>
<p>In your case, I'd follow Kasper's (usual) advise, and use the substitution the other way around,</p>
<pre><code>rule2 := \partial_{b?}{C??} D?? -> - C?? \partial_{b?}{D??}
+ \partial_{b?}{C?? D??};</code></pre>
<p>The whole notebook (MWE) would be:</p>
<pre><code>{a,b}::Indices.
\partial{#}::PartialDerivative.
{A,B,C,D}::NonCommuting.
{A,B,C,D}::Depends(\partial{#}).
ex1 := \partial_{a}{A} B + A \partial_{a}{B};
rule := \partial_{b?}{C??} D?? + C?? \partial_{b?}{D??}
-> \partial_{b?}{C?? D??};
substitute(ex1, rule);
ex2 := \partial_{a}{A} B + 2 A \partial_{a}{B};
rule2 := \partial_{b?}{C??} D?? -> - C?? \partial_{b?}{D??}
+ \partial_{b?}{C?? D??};
substitute(ex2, rule2);</code></pre>
<p>Hope this could be of use!</p>General questionshttps://cadabra.science/qa/2383/invert-product-nicely-where-there-extra-numerical-factors?show=2384#a2384Thu, 08 Dec 2022 09:05:05 +0000Answered: Expansion of covariant derivative
https://cadabra.science/qa/2041/expansion-of-covariant-derivative?show=2382#a2382
<p>There's a very simple workaround for this.</p>
<pre><code>{\mu, \nu, \lambda, \kappa, \rho, \sigma#}::Indices(space, position=independent).
\partial{#}::PartialDerivative.
\nabla{#}::Derivative.
A{#}::Depends(\partial{#}, \nabla{#}).
ex1:= A_\mu.
ex2:= B_{\mu \nu} = \nabla_{\mu}{ A_\nu }.
expand_nabla(ex2)
rename_dummies(ex2);
ex3:= C_{\mu \nu \rho} = \nabla_{\mu}{B_{\nu \rho }}.
substitute(ex3, ex2)
expand_nabla(ex3);</code></pre>
<p>You essentially have to rename dummy indices after each use of expand_nabla.</p>General questionshttps://cadabra.science/qa/2041/expansion-of-covariant-derivative?show=2382#a2382Wed, 07 Dec 2022 09:06:36 +0000Answered: Scope of Depends()
https://cadabra.science/qa/2380/scope-of-depends?show=2381#a2381
<p>Two issues here. Firstly, make sure you do not write a space between the nabla and the thing on which it acts, so write</p>
<pre><code>\nabla_{a}{ A_{b c} }</code></pre>
<p>not</p>
<pre><code>\nabla_{a} { A_{b c} }</code></pre>
<p>If you do that, the double-nabla stays.</p>
<p>Secondly, you need to merge all the <code>Depends</code> properties into one, otherwise the 2nd one overwrites the first. So make that</p>
<pre><code>A{#}::Depends(\partial{#}, \nabla{#}).</code></pre>
<p>Then <code>unwrap</code> works as expected.</p>General questionshttps://cadabra.science/qa/2380/scope-of-depends?show=2381#a2381Tue, 06 Dec 2022 20:13:58 +0000Answered: Weird behavior where kernel crashes when substituting expression, depending on how the expression is written
https://cadabra.science/qa/2378/behavior-crashes-substituting-expression-depending-expression?show=2379#a2379
<p>This was due to an issue when simplifying powers of rationals, in particular things of the form $(-a)^{-1}$, which left unsimplified rationals in the expression tree. </p>
<p>This is now fixed in 2.4.3.2 available on the github master branch.</p>Bug reportshttps://cadabra.science/qa/2378/behavior-crashes-substituting-expression-depending-expression?show=2379#a2379Tue, 06 Dec 2022 12:22:08 +0000Answered: How to access the value of an object?
https://cadabra.science/qa/2370/how-to-access-the-value-of-an-object?show=2373#a2373
<p>Your own answer works, but makes it impossible to use that same expression with a different free index. A more Cadabra-like way of doing this is to declare</p>
<pre><code>{\mu,\nu,\rho,\lambda,\phi,\chi}::Indices.
ex1:= T^{\mu\lambda} = A^{\mu \nu} B_{\nu \rho} C^{\rho \lambda};
ex2 := D_{\kappa \mu\nu} T^{\mu\nu};</code></pre>
<p>and then substitute <code>expr</code> with</p>
<pre><code> substitute(ex2, ex1);</code></pre>
<p>In Cadabra, equations have names, but those names are not themselves tensors. Those equation names (<code>ex1</code> and <code>ex2</code> above) do not carry indices.</p>General questionshttps://cadabra.science/qa/2370/how-to-access-the-value-of-an-object?show=2373#a2373Sat, 03 Dec 2022 19:11:28 +0000Answered: How to "factor out" derivatives?
https://cadabra.science/qa/2366/how-to-factor-out-derivatives?show=2367#a2367
<p>There's nothing built-in, but some variation of </p>
<pre><code>substitute(ex, $\partial_{a}{A??} + \partial_{a}{B??} -> \partial_{a}{A??+B??}$);</code></pre>
<p>will probably do the trick.</p>General questionshttps://cadabra.science/qa/2366/how-to-factor-out-derivatives?show=2367#a2367Fri, 02 Dec 2022 08:41:12 +0000Answered: Collect factors with negative power
https://cadabra.science/qa/2361/collect-factors-with-negative-power?show=2365#a2365
<p>Now fixed in 2.4.3.</p>General questionshttps://cadabra.science/qa/2361/collect-factors-with-negative-power?show=2365#a2365Thu, 01 Dec 2022 21:40:05 +0000Select/pattern matching for noncommuting expressions (gamma matrices) with free indices
https://cadabra.science/qa/2362/pattern-matching-noncommuting-expressions-matrices-indices
<p>The concrete problem I want to solve: I want to replace a product of two gamma matrices by the one in reverse order using the Clifford relation. i.e.
$\gamma<em>\mu \gamma</em>\nu -> 2 \eta<em>{\mu \nu} - \gamma</em>\nu \gamma_\mu $</p>
<p>When I use a substitution it's applied to all products of 2 gamma matrices, even if they already have the 'right' order. Since patterns select both terms, I cannot zoom into one of the terms selectively. Regexp does not seem to help either (or at least not without knowing the internal represantation of a placeholder like M??). Your trick works fine in your example, but I cannot ditinguish the order of the Dirac matrices by contracting with a vecor/tensor, so it does not help here. </p>
<p>Instead trying to sort the terms appropriately and then applying $\gamma<em>\mu \gamma</em>\nu + \gamma<em>\nu \gamma</em>\mu -> 2 \eta_{\mu \nu} $ instead seems not to work either, so I'm lost - should be a trivial exercise in gamma matrices... </p>
<p>Added: I found an analogous trick: Contract with a tensor $F^{\mu \nu} $ then one can match with a pattern containing $\gamma<em>\mu \gamma</em>\nu F^{\mu \nu}$. Due to non-commutativity of Dirac matrices this patterns really matches only one of the two terms. </p>
<p>However, considering that this is essnetially the most trvial transformation with Dirac matrices, it is surprising that such a painfull worakround seems to be needed. Hopefully, I'm overlooking some easy solution. </p>General questionshttps://cadabra.science/qa/2362/pattern-matching-noncommuting-expressions-matrices-indicesThu, 01 Dec 2022 14:51:48 +0000Pattern matching based on free index?
https://cadabra.science/qa/2359/pattern-matching-based-on-free-index
<p>Is there a way to define patterns for use in substitute or zoom containing a fixed free index?
Indices in patterns seem to always treated as wildcards, meaning x^{a} matches x^{b} as well. Whereas this is often what I want, there are many cases where I want to select terms based on a fixed free index, so x^{a} should match x^{a} only, not x^{b} for a dummy or another free index b. Is there a way to achieve this? </p>General questionshttps://cadabra.science/qa/2359/pattern-matching-based-on-free-indexThu, 01 Dec 2022 12:39:05 +0000Import from notebook library not working
https://cadabra.science/qa/2356/import-from-notebook-library-not-working
<p>I tried a import according to the Cadabra book section 4.2.1. However, it seems not to work, neither from the Cadabra notebook nor from jupyter.</p>
<ul>
<li>the library.cnb file is found, no error message (as opposed to the case when I import a non-existing file)</li>
<li>no error message on import</li>
<li>however, the content seems not to be imported, in the example "ex;" leads to an error message "NameError: name 'ex' is not defined"</li>
</ul>
<p>As stated above, this happens both from Jupyter and from Cadabra graphical interface. </p>
<p>When trying from CLI, I get an error "cannot parse json file" when importing. </p>
<p>Am I doing something wrong or is the import broken?</p>General questionshttps://cadabra.science/qa/2356/import-from-notebook-library-not-workingWed, 30 Nov 2022 18:10:23 +0000Summation of the substitution rules
https://cadabra.science/qa/2353/summation-of-the-substitution-rules
<p>Hi, until recently, it was possible to make two subrules into one simply by adding them together, for example:</p>
<pre><code>metric:= {h_{t t} = 1, h_{x x} = -(a)**2,
h_{y y} = -(a)**2, h_{z z} = -(a)**2,
h^{t t} = 1, h^{x x} = -(a)**{-2},
h^{y y} = -(a)**{-2}, h^{z z} = -(a)**{-2}};
Gamma:= \Gamma^{m}_{n r} = 1/2 h^{m s} (\partial_{r}{h_{n s}}
+\partial_{n}{h_{r s}}-\partial_{s}{h_{n r}});
evaluate(Gamma, metric, rhsonly=True);
Gamma = com.components_to_subrule(Gamma);
metric = metric + Gamma;</code></pre>
<p>But now as a result of these actions it turns out
<img src="https://sun9-22.userapi.com/impg/Ordvn9KtGIXME3K8RVUXUJnoI_r1ImT7-4wnfg/p2Kes2ENAZk.jpg?size=1080x76&quality=96&sign=97483a555a6b058ff3891cdd76c6ade5&type=album" alt="image"></p>
<p>This object is no longer a subrule.
I am using the latest version of Cadabra 2 for ubuntu 20.04</p>General questionshttps://cadabra.science/qa/2353/summation-of-the-substitution-rulesWed, 30 Nov 2022 16:31:33 +0000Raising and lowering indices with an anti-symmetric tensor
https://cadabra.science/qa/2347/raising-and-lowering-indices-with-an-anti-symmetric-tensor
<p>Hi there,</p>
<p>I'm quite enamoured with Cadabra's capabilty.</p>
<p>One thing that would be useful is being able to raise indices with an anti-symmetric objeect \epsilon_AB, \epsilon^AB</p>
<p>Right now if I set index behaviour to 'free', the canonicalise function assumes that</p>
<pre><code>u^{A}v_{A} = u_{A}v^{A}</code></pre>
<p>whereas in my line of work it is customary that:</p>
<pre><code>u^{A}v_{A} = -u_{A}v^{A}. </code></pre>
<p>At the moment the only workaround I can think of is keeping all indices lowered and manually inserting \epsilon^AB everywhere. </p>
<p>I had a look at the source for an easy edit I could make and I also couldn't find one. Any suggestions?</p>
<p>Cheers</p>Feature requestshttps://cadabra.science/qa/2347/raising-and-lowering-indices-with-an-anti-symmetric-tensorWed, 16 Nov 2022 18:09:12 +0000Problems installing with brew on MacOS
https://cadabra.science/qa/2345/problems-installing-with-brew-on-macos
<p>Hi, I'm trying to tget cadabra2 installed on my Mac on Monterey with homebrew, but it stops at 83% with no error messages. Here is the end of the output I get:</p>
<p>[ 83%] Linking CXX shared library cadabra2.cpython-310-darwin.so
cd /tmp/cadabra2-20221105-78213-uterjo/cadabra2-2.3.8/core && /usr/local/Cellar/cmake/3.24.2/bin/cmake -E cmake_link_script CMakeFiles/cadabra2.dir/link.txt --verbose=1
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -Xlinker -undefined -Xlinker dynamic_lookup -flto -o cadabra2.cpython-310-darwin.so -install_name @rpath/cadabra2.cpython-310-darwin.so CMakeFiles/cadabra2.dir/InstallPrefix.cc.o CMakeFiles/cadabra2.dir/DataCell.cc.o CMakeFiles/cadabra2.dir/CdbPython.cc.o CMakeFiles/cadabra2.dir/ExNode.cc.o CMakeFiles/cadabra2.dir/ProgressMonitor.cc.o CMakeFiles/cadabra2.dir/Bridge.cc.o CMakeFiles/cadabra2.dir/Adjform.cc.o CMakeFiles/cadabra2.dir/Algorithm.cc.o CMakeFiles/cadabra2.dir/Cleanup.cc.o CMakeFiles/cadabra2.dir/Combinatorics.cc.o CMakeFiles/cadabra2.dir/Compare.cc.o CMakeFiles/cadabra2.dir/DisplayBase.cc.o CMakeFiles/cadabra2.dir/DisplayMMA.cc.o CMakeFiles/cadabra2.dir/DisplayTeX.cc.o CMakeFiles/cadabra2.dir/DisplaySympy.cc.o CMakeFiles/cadabra2.dir/DisplayTerminal.cc.o CMakeFiles/cadabra2.dir/TerminalStream.cc.o CMakeFiles/cadabra2.dir/Exceptions.cc.o CMakeFiles/cadabra2.dir/Exchange.cc.o CMakeFiles/cadabra2.dir/Functional.cc.o CMakeFiles/cadabra2.dir/Hash.cc.o CMakeFiles/cadabra2.dir/IndexIterator.cc.o CMakeFiles/cadabra2.dir/IndexClassifier.cc.o CMakeFiles/cadabra2.dir/Kernel.cc.o CMakeFiles/cadabra2.dir/Linear.cc.o CMakeFiles/cadabra2.dir/Parser.cc.o CMakeFiles/cadabra2.dir/PreClean.cc.o CMakeFiles/cadabra2.dir/PreProcessor.cc.o CMakeFiles/cadabra2.dir/Props.cc.o CMakeFiles/cadabra2.dir/PythonException.cc.o CMakeFiles/cadabra2.dir/Stopwatch.cc.o CMakeFiles/cadabra2.dir/Storage.cc.o CMakeFiles/cadabra2.dir/Symbols.cc.o CMakeFiles/cadabra2.dir/SympyCdb.cc.o CMakeFiles/cadabra2.dir/YoungTab.cc.o CMakeFiles/cadabra2.dir/modules/xperm_new.cc.o CMakeFiles/cadabra2.dir/<strong>/libs/whereami/whereami.c.o CMakeFiles/cadabra2.dir/</strong>/libs/base64/base64.cc.o CMakeFiles/cadabra2.dir/algorithms/canonicalise.cc.o CMakeFiles/cadabra2.dir/algorithms/collect_components.cc.o CMakeFiles/cadabra2.dir/algorithms/collect_factors.cc.o CMakeFiles/cadabra2.dir/algorithms/collect_terms.cc.o CMakeFiles/cadabra2.dir/algorithms/combine.cc.o CMakeFiles/cadabra2.dir/algorithms/complete.cc.o CMakeFiles/cadabra2.dir/algorithms/decompose.cc.o CMakeFiles/cadabra2.dir/algorithms/decompose_product.cc.o CMakeFiles/cadabra2.dir/algorithms/distribute.cc.o CMakeFiles/cadabra2.dir/algorithms/drop_weight.cc.o CMakeFiles/cadabra2.dir/algorithms/einsteinify.cc.o CMakeFiles/cadabra2.dir/algorithms/eliminate_kronecker.cc.o CMakeFiles/cadabra2.dir/algorithms/eliminate_metric.cc.o CMakeFiles/cadabra2.dir/algorithms/eliminate_vielbein.cc.o CMakeFiles/cadabra2.dir/algorithms/epsilon_to_delta.cc.o CMakeFiles/cadabra2.dir/algorithms/evaluate.cc.o CMakeFiles/cadabra2.dir/algorithms/expand.cc.o CMakeFiles/cadabra2.dir/algorithms/expand_delta.cc.o CMakeFiles/cadabra2.dir/algorithms/expand_diracbar.cc.o CMakeFiles/cadabra2.dir/algorithms/expand_dummies.cc.o CMakeFiles/cadabra2.dir/algorithms/expand_power.cc.o CMakeFiles/cadabra2.dir/algorithms/explicit_indices.cc.o CMakeFiles/cadabra2.dir/algorithms/factor_in.cc.o CMakeFiles/cadabra2.dir/algorithms/factor_out.cc.o CMakeFiles/cadabra2.dir/algorithms/fierz.cc.o CMakeFiles/cadabra2.dir/algorithms/flatten_product.cc.o CMakeFiles/cadabra2.dir/algorithms/flatten_sum.cc.o CMakeFiles/cadabra2.dir/algorithms/indexsort.cc.o CMakeFiles/cadabra2.dir/algorithms/integrate_by_parts.cc.o CMakeFiles/cadabra2.dir/algorithms/join_gamma.cc.o CMakeFiles/cadabra2.dir/algorithms/keep_terms.cc.o CMakeFiles/cadabra2.dir/algorithms/lower_free_indices.cc.o CMakeFiles/cadabra2.dir/algorithms/lr_tensor.cc.o CMakeFiles/cadabra2.dir/algorithms/map_sympy.cc.o CMakeFiles/cadabra2.dir/algorithms/meld.cc.o CMakeFiles/cadabra2.dir/algorithms/order.cc.o CMakeFiles/cadabra2.dir/algorithms/product_rule.cc.o CMakeFiles/cadabra2.dir/algorithms/reduce_delta.cc.o CMakeFiles/cadabra2.dir/algorithms/rename_dummies.cc.o CMakeFiles/cadabra2.dir/algorithms/rewrite_indices.cc.o CMakeFiles/cadabra2.dir/algorithms/simplify.cc.o CMakeFiles/cadabra2.dir/algorithms/sort_product.cc.o CMakeFiles/cadabra2.dir/algorithms/sort_spinors.cc.o CMakeFiles/cadabra2.dir/algorithms/sort_sum.cc.o CMakeFiles/cadabra2.dir/algorithms/split_gamma.cc.o CMakeFiles/cadabra2.dir/algorithms/split_index.cc.o CMakeFiles/cadabra2.dir/algorithms/substitute.cc.o CMakeFiles/cadabra2.dir/algorithms/sym.cc.o CMakeFiles/cadabra2.dir/algorithms/tab_dimension.cc.o CMakeFiles/cadabra2.dir/algorithms/tab_basics.cc.o CMakeFiles/cadabra2.dir/algorithms/take_match.cc.o CMakeFiles/cadabra2.dir/algorithms/replace_match.cc.o CMakeFiles/cadabra2.dir/algorithms/unwrap.cc.o CMakeFiles/cadabra2.dir/algorithms/unzoom.cc.o CMakeFiles/cadabra2.dir/algorithms/untrace.cc.o CMakeFiles/cadabra2.dir/algorithms/vary.cc.o CMakeFiles/cadabra2.dir/algorithms/young_project.cc.o CMakeFiles/cadabra2.dir/algorithms/young_project_product.cc.o CMakeFiles/cadabra2.dir/algorithms/young_project_tensor.cc.o CMakeFiles/cadabra2.dir/algorithms/zoom.cc.o CMakeFiles/cadabra2.dir/properties/Accent.cc.o CMakeFiles/cadabra2.dir/properties/AntiCommuting.cc.o CMakeFiles/cadabra2.dir/properties/AntiSymmetric.cc.o CMakeFiles/cadabra2.dir/properties/Commuting.cc.o CMakeFiles/cadabra2.dir/properties/CommutingAsProduct.cc.o CMakeFiles/cadabra2.dir/properties/CommutingAsSum.cc.o CMakeFiles/cadabra2.dir/properties/CommutingBehaviour.cc.o CMakeFiles/cadabra2.dir/properties/Coordinate.cc.o CMakeFiles/cadabra2.dir/properties/DAntiSymmetric.cc.o CMakeFiles/cadabra2.dir/properties/Depends.cc.o CMakeFiles/cadabra2.dir/properties/DependsInherit.cc.o CMakeFiles/cadabra2.dir/properties/Derivative.cc.o CMakeFiles/cadabra2.dir/properties/Determinant.cc.o CMakeFiles/cadabra2.dir/properties/Diagonal.cc.o CMakeFiles/cadabra2.dir/properties/DifferentialForm.cc.o CMakeFiles/cadabra2.dir/properties/DiracBar.cc.o CMakeFiles/cadabra2.dir/properties/Distributable.cc.o CMakeFiles/cadabra2.dir/properties/EpsilonTensor.cc.o CMakeFiles/cadabra2.dir/properties/ExteriorDerivative.cc.o CMakeFiles/cadabra2.dir/properties/FilledTableau.cc.o CMakeFiles/cadabra2.dir/properties/GammaMatrix.cc.o CMakeFiles/cadabra2.dir/properties/GammaTraceless.cc.o CMakeFiles/cadabra2.dir/properties/ImaginaryI.cc.o CMakeFiles/cadabra2.dir/properties/ImplicitIndex.cc.o CMakeFiles/cadabra2.dir/properties/Indices.cc.o CMakeFiles/cadabra2.dir/properties/Integer.cc.o CMakeFiles/cadabra2.dir/properties/InverseMetric.cc.o CMakeFiles/cadabra2.dir/properties/KroneckerDelta.cc.o CMakeFiles/cadabra2.dir/properties/LaTeXForm.cc.o CMakeFiles/cadabra2.dir/properties/Matrix.cc.o CMakeFiles/cadabra2.dir/properties/Metric.cc.o CMakeFiles/cadabra2.dir/properties/NonCommuting.cc.o CMakeFiles/cadabra2.dir/properties/NumericalFlat.cc.o CMakeFiles/cadabra2.dir/properties/PartialDerivative.cc.o CMakeFiles/cadabra2.dir/properties/RiemannTensor.cc.o CMakeFiles/cadabra2.dir/properties/SatisfiesBianchi.cc.o CMakeFiles/cadabra2.dir/properties/SelfAntiCommuting.cc.o CMakeFiles/cadabra2.dir/properties/SelfCommuting.cc.o CMakeFiles/cadabra2.dir/properties/SelfNonCommuting.cc.o CMakeFiles/cadabra2.dir/properties/SortOrder.cc.o CMakeFiles/cadabra2.dir/properties/Spinor.cc.o CMakeFiles/cadabra2.dir/properties/Symbol.cc.o CMakeFiles/cadabra2.dir/properties/Symmetric.cc.o CMakeFiles/cadabra2.dir/properties/Tableau.cc.o CMakeFiles/cadabra2.dir/properties/TableauBase.cc.o CMakeFiles/cadabra2.dir/properties/TableauInherit.cc.o CMakeFiles/cadabra2.dir/properties/TableauSymmetry.cc.o CMakeFiles/cadabra2.dir/properties/Trace.cc.o CMakeFiles/cadabra2.dir/properties/Traceless.cc.o CMakeFiles/cadabra2.dir/properties/Vielbein.cc.o CMakeFiles/cadabra2.dir/properties/Weight.cc.o CMakeFiles/cadabra2.dir/properties/WeightInherit.cc.o CMakeFiles/cadabra2.dir/properties/WeylTensor.cc.o CMakeFiles/cadabra2.dir/pythoncdb/py_algorithms.cc.o CMakeFiles/cadabra2.dir/pythoncdb/py_ex.cc.o CMakeFiles/cadabra2.dir/pythoncdb/py_globals.cc.o CMakeFiles/cadabra2.dir/pythoncdb/py_helpers.cc.o CMakeFiles/cadabra2.dir/pythoncdb/py_kernel.cc.o CMakeFiles/cadabra2.dir/pythoncdb/py_module.cc.o CMakeFiles/cadabra2.dir/pythoncdb/py_packages.cc.o CMakeFiles/cadabra2.dir/pythoncdb/py_progress.cc.o CMakeFiles/cadabra2.dir/pythoncdb/py_properties.cc.o CMakeFiles/cadabra2.dir/pythoncdb/py_stopwatch.cc.o CMakeFiles/cadabra2.dir/pythoncdb/py_tableau.cc.o -L/usr/local/Cellar/glibmm@2.66/2.66.2/lib -L/usr/local/Cellar/glib/2.74.0/lib -L/usr/local/opt/gettext/lib -L/usr/local/Cellar/libsigc++@2/2.10.8/lib -Wl,-rpath,/usr/local/Cellar/glibmm@2.66/2.66.2/lib -Wl,-rpath,/usr/local/Cellar/glib/2.74.0/lib -Wl,-rpath,/usr/local/opt/gettext/lib -Wl,-rpath,/usr/local/Cellar/libsigc++@2/2.10.8/lib /usr/local/lib/libgmpxx.dylib /usr/local/lib/libgmp.dylib /usr/local/lib/libboost_system-mt.dylib
cd /tmp/cadabra2-20221105-78213-uterjo/cadabra2-2.3.8/core && /usr/bin/strip -x /tmp/cadabra2-20221105-78213-uterjo/cadabra2-2.3.8/core/cadabra2.cpython-310-darwin.so
[ 83%] Built target cadabra2
make: *** [all] Error 2</p>
<p>Do not report this issue to Homebrew/brew or Homebrew/core!</p>Installation troublehttps://cadabra.science/qa/2345/problems-installing-with-brew-on-macosSat, 05 Nov 2022 12:22:29 +0000