jose
  • Member for 8 years, 2 months
  • Last seen this week
  • Champaign, IL, United States
xAct xCoba: How to extract components of CTensors correctly
Accepted answer
3 votes

First of all, let's discuss why the answers are different: V[a] is a vector field, but V[{0, ch}] is a scalar field. Hence the operation cd[-b][V[{0, ch}]] is computing the covariant derivative of a ...

View answer
Dealing with covariant derivatives (xCoba)
Accepted answer
2 votes

You have a product of a Basis[-c, {1, B}], for some basis B, and a CTensor[comps, {B}][c] object. You can use ContractBasis to force the contraction of a Basis[...] object with anything. Or you can ...

View answer
Format data consistently with Around
2 votes

The different typesetting forms of Around are controlled via internal thresholds. The 0.123456(78) notation is only appropriate for cases in which the uncertainty is smaller than the (absolute value ...

View answer
Sorting Associations by DayName (day of week) using KeySort and/or KeySortBy
3 votes

An alternative to using SortBy[..., f] is to create a dedicated ordering function, which then can be used in any sorting operation. For example, let us write a WeekOrder function, from Monday to ...

View answer
Evaluating covariant derivative terms of a scalar function (xAct, xTras)
Accepted answer
1 votes

I'd recommend to do the following. Keep this part of your code: << xAct`xTras` ddim = 4; coords = {\[Tau][], r[], \[Theta][], \[Phi][]}; DefManifold[M4, ddim, {\[Alpha], \[Beta], \[Gamma], \[...

View answer
Neglecting higher order derivatives terms in xAct
Accepted answer
1 votes

Does something like this work? expr /. cd[_][cd[_][phi[]]] -> 0 for your covariant derivative cd and scalar field phi. This will remove second-order derivatives, but third-order and higher-order ...

View answer
How to delete duplicate graphics of the same kind?
Accepted answer
5 votes

Here is a suggestion from group theory: We need to define an action on squares for the eight elements of DihedralGroup[4]. In general, it would be enough to define it for the two generators and then ...

View answer
Generate symmetric random tensor
Accepted answer
6 votes

Along the same lines of the answer by Daniel Huber, I think what you need here is this combination: RandomSymmetrizedArray[dims_, sym_, dist_] := Normal@ SymmetrizedArray[_ :> RandomVariate[dist], ...

View answer
Improving performace of `GeoDistance` and `NearestNeighborGraph`
Accepted answer
9 votes

There are a few things that can be improved here: Don't call {"Latitude", "Longitude"} separately in EntityValue. It's better to use the "Position" property, that ...

View answer
Rotate Geographic map
7 votes

A possible way to rotate a map is to use the freedom provided by an oblique projection. Obliqueness adds the three degrees of freedom of a general 3D rotation, namely the {lat, lon} coordinates of the ...

View answer
Self loop on CityData graph?
Accepted answer
4 votes

GeoDistance is computing minimal distances between the polygons of the cities, and some cities are contiguous, i.e. their polygons are touching, so the result is zero. See the non-diagonal zeros in ...

View answer
Converting tensorial expressions in xAcT to LaTeX
Accepted answer
1 votes

xAct contains a full package dedicated to converting tensor expressions into LaTeX, called TexAct, and I'd recommend using that instead of the general TeXForm. For example, in your case: << xAct`...

View answer
Nice use case for symbolic tensors?
Accepted answer
6 votes

Tensor simplification can be an expensive computation, so it is not performed automatically. You need to use TensorReduce on symbolic tensor expressions, like you would use Simplify in more general ...

View answer
How to calculate arbitrary area on surface of sphere?
3 votes

A simple solution here is be to use the Geo functionality, in particular GeoArea, which can compute the area of any polygon on the surface of the sphere (or of an ellipsoid of revolution). There is ...

View answer
Creating 15x15 matrix out of two 6x6 matrices (by antisymmetrization)
2 votes

I'm not sure I'm interpreting correctly the question, but here is what I would do. This is for an arbitrary matrix $\Lambda$. First, construct the tensor product of the $\Lambda$ matrix and the $\...

View answer
Calculating Rubiks $ 2 \times 2 \times 2 $ Permutation using Cycles
Accepted answer
8 votes

I think some of the rotations must be corrected: rot1 = Cycles[{{1, 2, 4, 3}, {5, 24, 9, 7}, {6, 23, 10, 8}}]; rot2 = Cycles[{{21, 22, 24, 23}, {1, 11, 20, 10}, {2, 5, 19, 16}}]; rot3 = Cycles[{{11, ...

View answer
User interface Mathematica 12.1 terribly slow
27 votes

Dataset was restructured in the 12.1 release in order to support expanded formatting options and interactivity such as hiding and sorting. As a result, some Dataset outputs showed a slowdown due to ...

View answer
Fourth Order Tensor rotation
2 votes

There are multiple ways of implementing something like this, and the comments above give you good suggestions. Let me suggest another simple method, which is valid for arrays of any depth, not just 4. ...

View answer
How to plot countries with accurate area?
Accepted answer
6 votes

The area-preserving projections are listed in GeoProjectionData["EqualArea"]. Most of these projections have formulas for the sphere only, but some of them, like "Albers" or "LambertAzimuthal" in WL ...

View answer
use CTensor to define new tensor
3 votes

The pattern T[γ_, -δ_, -ζ_] only accepts abstract indices in the second and third indices, because something like {1, -ℬ} does not match a pattern like -δ_. Hence use something like T[γ, -δ, -ζ] ...

View answer
How to understand the symmetry of MMA's tensor
Accepted answer
6 votes

Symmetric[{1,2,3}] means that all six permutations of {1,2,3} are symmetries of the tensor: Equal[tensor, Transpose[tensor, #]] & /@ Permutations[{1, 2, 3}] (* {True, True, True, True, True, True}...

View answer
Is it possible to defining a scalar with CTensor?
Accepted answer
1 votes

You do not really need CTensor for this. You need to replace \[Phi][] by \[Phi]0[r[]]. There are multiple ways to implement that replacement/assignment. If you want to use CTensor, then you need the ...

View answer
How to compute functional derivative against vector in xAct, xTensor or xTras?
2 votes

In my opinion it only makes sense to take variational derivatives of scalar actions, that is, of the integral of a scalar Lagrangian times a volume form. Hence, xTensor complains if you try to ...

View answer
Error of Points in Mollweide Projection
Accepted answer
3 votes

I would try something like this: point1 = {Around[72.85, 60.6242], Around[210.26, 136.593]}; point2 = {Around[-25.17, 10.23], Around[104.70, 32.47]}; point3 = {Around[25.17, 10.22], Around[284.70, 48....

View answer
How to work with Levi civita tensor in xAxt?
2 votes

The LeviCivitaTensor symbol is a WL function that returns an array of 0's, 1's and -1's. It is not a xTensor function. The Levi-Civita tensor is called epsilon in xTensor, and there is one for each ...

View answer
Hammer projection to rectangular
Accepted answer
3 votes

You can do this with the Geo functionality, which knows the "Hammer" projection: GeoImage["World", GeoStyling[{Import["..."], "Projection" -> "Hammer"}], GeoProjection -> "Equirectangular"]

View answer
How to generate all $ 3 \times 3 $ matrices with $ a,a,a,a,b,b,b,c,c $?
5 votes

Let me give a GroupOrbits approach, imitating many aspects of the accepted solution. Start again with all permutations of the elements: list = {a, a, a, a, b, b, b, c, c}; perms = Permutations[list]; ...

View answer
How to set up symplectic geometry without(!) metric (with xAct/xTensor)?
1 votes

I think you should define the tensor Omega[-a, -b] and its inverse, say iOmega[a, b], as separate antisymmetric tensors, and use them systematically with those index configurations. Because there is ...

View answer
How to Creat a Symbolic Rank 4 Symmetric tensor
Accepted answer
4 votes

You can use the general language of symmetries (of which Symmetric and Antisymmetric are particular cases). Your symmetries (1), (2) and (3) correspond respectively to these generators: sym = { {...

View answer
How to define commutative covariant derivatives in xTensor
Accepted answer
1 votes

Covariant derivatives with upper indices do not make sense before introducing a metric. So this works: In[7]:= CD[-c]@CD[-b]@T[a] - CD[-b]@CD[-c]@T[a] // Simplification Out[7]= 0 Instead of ...

View answer