blocks¶
This submodule provides the basic implementation of Block and its subclasses.
Insertions of (subclasses of) Block are used to implement covariant
derivatives, field-strength tensors, etc. including their default
transformation properties.
Custom implementations of Block then allow for extensions to models with
non-trivial transformation properties, e.g., due to more complicated flavour
symmetries.
- class Block(factor: int | Fraction | Complex = 1)¶
Bases:
objectSuper class to derive from. Already implements default behaviour if sensible. Implements the transformations acting as the identity.
Important
For implementations of Block transforming non-trivially the corresponding transformations need to be overwritten by the appropriate non-trivial cases.
If the instance of a Block carries indices (or a more general suffix), those details must be specified via a decorator
@indicesor@defaultIndices, where the latter makes some implicit assumptions on how to read off the conventions used for the indices. This will set the class-attributes__indexType__,__indexName__and__suffix__to some non-trivial values. For more details how to declare indices, seeindices. CAVEAT: Do not modify those attributes directly!The name of the arguments passed to
@indiceshas to match exactly the names of the class members used internally, i.e.,testIdx = CustomIndex("testIdx", ["a", "b"]) @indices("(%s;%s)", mu = sptIdx, nu = testIdx) class MyBlock(Block): def __init__(self,x:sptIdx,y:testIdx,factor:int|Fraction|Complex=1): self.mu = x self.nu = y
The unique types used in the keyword arguments matching the actual type of the index are mandatory as they are used to decide how the data is to be processed when parsing custom Block implementations from file. Currently there are two cases
match = "123" if issubclass(f, CustomIndex): print(getattr(f,match)) else: print(f(int(match)))
Danger
Deviating from this pattern will break the package!
- __indexName__¶
Refers to the name for each of the indices used in the implementation of
Block.Danger
Do not modify!
- __indexType__¶
Refers to the type of each of the indices used in the implementation of
Block. Must be chosen accordingly to properly stringify and parse thisBlock.Danger
Do not modify!
- __suffix__¶
String representation of all the indices. Expected to contain as many %s as there are indices present in the implementation of
Block. This will be used for both calls to__str__as well as parsingBlockfrom string via regular expressions.Danger
Do not modify!
- Type:
- __massDim__¶
Refers to the canonical mass-dimension of the specific
Block.Danger
Do not modify!
- Type:
int|Fraction
- __neg__()¶
Changes the sign of the overall factor.
- __str__()¶
Returns identifiable string representation of
Blockincluding the appropriate index structure for non-trivial indices.- Returns:
String representation of implementation of
Block.- Return type:
- Raises:
AssertionError – If overall prefactor is non-trivial, i.e., call to
Block.simplifyin parent has been forgotten.
- classmethod _toRegex()¶
Turns the specific
Blockimplementation cls into a regex string to be used when parsing string representations of aLinearComb. The class name as well as any index or generalisation thereof are (expected to be) put into a regex group.
- classmethod _types()¶
Determines the types for the indices relevant for the (custom)
Blockimplementation.
- charge()¶
Implements conventional charge conjugation.
Danger
The original
Blockmay be changed.- Returns:
Itself transformed accordingly.
- Return type:
- chiralSpurion()¶
Implements conventional spurionic chiral transformation.
- Returns:
Anything other than masses or Dirac gamma matrices transforms trivially under chiral spurion.
- Return type:
- reflection(mu: int)¶
Implements conventional Euclidean reflection in direction mu.
Danger
The original
Blockmay be changed.
- rotation(plane: int)¶
Implements conventional 90 degree rotations in the chosen plane as defined in
rotPlanes.
- simplify()¶
Is expected to take care of any relations among different index permutations.
Caution
Has to be adapted for non-trivial cases.
- class Colour(factor: int | Fraction | Complex = 1)¶
Bases:
BlockRight now used as dummy to avoid explicit index contraction of Nc^2-1 elements. -> Could be implemented for Nc=2 w/o loss of generality?
- class D0(factor: int | Fraction | Complex = 1)¶
Bases:
BlockUsed to mask fermion EOM acting to the right when creating all variants.
- class D0l(factor: int | Fraction | Complex = 1)¶
Bases:
BlockUsed to mask fermion EOM acting to the left when creating all variants.
- class DF(mu: sptIdx, factor: int | Fraction | Complex = 1)¶
Bases:
dUsed to mask gluon EOM acting to the right when creating all variants.
- Parameters:
- class F(mu: sptIdx, nu: sptIdx, factor: int | Fraction | Complex = 1)¶
Bases:
BlockRepresents the field strength tensor
\[F_{\mu\nu} = [D_\mu,D_\nu]\]with all the expected transformation properties. Current convention is to keep mu<nu and otherwise introduce an overall minus sign.
- Parameters:
- charge()¶
Implements conventional charge conjugation.
Danger
The original
Blockmay be changed.- Returns:
Itself transformed accordingly.
- Return type:
- reflection(mu: int)¶
Implements conventional Euclidean reflection in direction mu.
Danger
The original
Blockmay be changed.
- rotation(plane: int)¶
Implements conventional 90 degree rotations in the chosen plane as defined in
rotPlanes.
- simplify()¶
Is expected to take care of any relations among different index permutations.
Caution
Has to be adapted for non-trivial cases.
- class M(factor: int | Fraction | Complex = 1)¶
Bases:
BlockRepresents the quark mass matrix when inserted into a singlet or a
Trace. Otherwise it is the average sum of quark masses of the bilinear (which is equivalent to the quark mass matrix for the singlet).
- class Multiplicative(factor: int | Fraction | Complex = 1)¶
-
Abstract class to hint at implementation of __mul__ during call to simplify.
- abstractmethod __mul__(factor)¶
Multiplication with instance of same type , i.e.,
self.__class__ is factor.__class__ == True
must be implemented for any subclass of Multiplicative.
- Parameters:
factor (Multiplicative) – 2nd factor of same type.
- Returns:
Product of this instance and factor.
- Return type:
- class _AlgebraBlock(blocks: list[Block], factor: int | Fraction | Complex = 1)¶
Bases:
BlockContainer for covariant derivatives acting on an algebra-valued object like F[mu,nu], Colour, DF[mu] etc.
CAVEAT: For internal use only!
- Parameters:
- __str__()¶
Overwritten default behaviour of str(self) to handle with collections of
Block.- Returns:
String representation of all instances of
Blockcontained within the_AlgebraBlock.- Return type:
- charge()¶
Implements conventional charge conjugation.
Danger
The original
Blockmay be changed.- Returns:
Itself transformed accordingly.
- Return type:
- reflection(mu: int)¶
Implements conventional Euclidean reflection in direction mu.
Danger
The original
Blockmay be changed.
- rotation(plane: int)¶
Implements conventional 90 degree rotations in the chosen plane as defined in
rotPlanes.
- simplify()¶
Is expected to take care of any relations among different index permutations.
Caution
Has to be adapted for non-trivial cases.
- class _DFl(mu: sptIdx, factor: int | Fraction | Complex = 1)¶
Bases:
dUsed to mask gluon EOM acting to the right when creating all variants.
CAVEAT: For internal use only!
- Parameters:
- class d(mu: sptIdx, factor: int | Fraction | Complex = 1)¶
Bases:
BlockRepresents a total derivative. Due to its transformation properties (vector-like) it is also used as a parent class of covariant derivatives and the gluonic EOM.
- Parameters:
- class dM(factor: int | Fraction | Complex = 1)¶
Bases:
MRepresents half the difference of quark masses of the left and right flavour in a
Bilinear,q.dM.Q = (m(q)-m(Q))/2 q.Q
i.e., dM vanishes when inserted into a singlet. In combination with M this allows to work out mass-differences arising from
D0l,D0acting in both directions within aLinearComb.Caution
Should only be used with explicit flavour notation. Has no knowledge about any user-defined flavour matrices and may thus lead to wrong results.