dedalus.libraries.dedalus_sphere.spin_operators

Module Contents

indexing
threshold = 1e-12
class TensorOperator(function, codomain, indexing=indexing, threshold=threshold)

Class for lazy evaluation of spin/regularity tensor operations.

Variables:
• codomain (TensorCodomain object) – keeps track of the difference in rank of TensorOperators.

• indexing (tuple) – must be a permutation of (-1,+1) or (-1,0,+1)

• threshold (float (1e-12 default)) – send smaller values to 0.

• dimension (int) – number of basis indices.

self(rank):

all TensorOperator objects are callable on the input rank of a tensor.

self[sigma,tau]:

sigma,tau tuples of spin/regularity indices

self.generator(rank):

generate all lenght-rank tuples according to a given indexing.

self.array:

from self[sigma,tau] compute flattened (dimension**ranks[0],dimension**ranks[1]) np.ndarray.

property indexing
property threshold
property dimension
range(rank)
array(ranks)
class Identity(**kwargs)

Spin/regularity space identity transformation of arbitrary rank.

self[sigma,tau] = 1 if sigma == tau else 0
class Metric(**kwargs)

Spin-space representation of arbitrary-rank local Cartesian metric tensor. E.g.:

Id = e(+)e(-) + e(0)e(0) + e(-)e(+) = e(x)e(x) + e(y)e(y) + e(z)e(z)

self[sigma,tau] = 1 if sigma == -tau else 0
class Transpose(permutation=(1, 0), **kwargs)

Transpose operator for arbitrary rank tensor.

T[i,j,…,k] -> T[permutation(i,j,…,k)]

Default transposes 0 <–> 1 indices.

Variables:

permutation (tuple) – Relative to natural order, using Cauchy’s “one-line notation”.

self()
property permutation
class Trace(indices, **kwargs)

Class for contracting arbitrary indices down to a scalar in those indices:

sum_(i+j=0) T[..i,..j,..]

This can generalise to (e.g.):

sum_(i+j+k+l=0) T[..i,..j,..k,..l,..]

It might seem like we would prefer to do

sum_(i+j=0,k+l=0) T[..i,..j,..k,..l,..] = sum_(i+j=0) sum_(k+l=0) T[..i,..j,..k,..l,..]

However, we can accomplish the latter by multiple operations over two indices. Conversly, repeted apllication of 2-index sums cannot sum more than two indices simultaneously.

For a few examples:

len(indices) == 0:

Identity() S –> S

len(indices) == 1:
Selects spin=0 component from given axis:

V –> V[0]

len(indices) == 2:

T –> T[-,+] + T[0,0] + T[+,-]

Trace((0,)) @ Trace((1,)) produces T[0,0] individually.

Trace((0,1)) - Trace((0,)) @ Trace((1,)) produces T[-,+] + T[+,-] individually.

len(indices) == 3:

R[+,-,0]+R[-,+,0] + R[+,0,-]+R[-,0,+] + R[0,+,-]+R[0,-,+] + R[0,0,0]

We can select different scalars in this sum by application of lower-rank traces.

Variables:

indices (tuple of -1,0,+1)

property indices
class TensorProduct(element, action='left', **kwargs)

Action of multiplication by single spin-tensor basis element:

e(kappa) (X) T = sum_(sigma) T(sigma) e(kappa+sigma)

or

T (X) e(kappa) = sum_(sigma) T(sigma) e(sigma+kappa)

Variables:
• element (tuple) – single tensor basis element, kappa

• action (str ('left' or 'right'))

property element
property action
xi(mu, ell)

Normalised derivative scale factors. xi(-1,ell)**2 + xi(+1,ell)**2 = 1.

Parameters:
• mu (int) – regularity; -1,+1,0. xi(0,ell) = 0 by definition.

• ell (int) – spherical-harmonic degree.

class Intertwiner(L, **kwargs)

Regularity-to-spin map.

Q(ell)[spin,regularity]

Variables:

L (int) – spherical-harmonic degree

k: int mu, s

angular spherical wavenumbers.

forbidden_spin: tuple spin

filter spin components that don’t exist.

forbidden_regularity: tuple regularity

filter regularity components that don’t exist.

self[sigma,a]:

regularity-to-spin coupling coefficients

property L
k(mu, s)
forbidden_spin(spin)
forbidden_regularity(regularity)
class TensorCodomain(rank_change)

Class for keeping track of TensorOperator codomains.

Variables:

arrow (int) – relative change in rank between input and output.