blocks¶
This submodule provides the basic implementaion 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:
object
Super class to derive from. Already implements default behaviour if sensible. Implements the transformations acting as the identity. => To be overwritten by 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
@indices
or@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
@indices
has 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)))
CAVEAT: Deviating from this pattern will break the package!
- __indexName__¶
Refers to the name for each of the indices used in the implementation of Block. CAVEAT: 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 this Block. CAVEAT: 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 parsing Block from string via regular expressions. CAVEAT: Do not modify!- Type:
- __neg__()¶
Changes the sign of the overall factor.
- Returns:
A copy of Block with negative overall factor.
- Return type:
- __str__()¶
Returns identifiable string representation of Block including 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.simplify
in parent has been forgotten.
- classmethod _toRegex()¶
Turns the specific Block implementation cls into a regex string to be used when parsing string representations of a LinearComb. The class name as well as any index or generalisation thereof are (expected to be) put into a regex group.
- Returns:
Regular expression matching the particular implementation of Block starting with the class name followed by an implementation-specific suffix. Typically some indices.
- Return type:
- classmethod _types()¶
Determines the types for the indices relevant for the (custom) Block implementation from the function-signature of Block.__init__. Type hints involving the exact types of the indices are mandatory!
- charge()¶
Implements conventional charge conjugation.
- Returns:
A copy of 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:
- 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. => Has to be adapted for non-trivial cases!
- class Colour(factor: int | Fraction | Complex = 1)¶
Bases:
Block
Right 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:
Block
Used to mask fermion EOM acting to the right when creating all variants.
- charge()¶
Implements conventional charge conjugation.
- Returns:
A copy of itself transformed accordingly.
- Return type:
- class D0l(factor: int | Fraction | Complex = 1)¶
Bases:
Block
Used to mask fermion EOM acting to the left when creating all variants.
- charge()¶
Implements conventional charge conjugation.
- Returns:
A copy of itself transformed accordingly.
- Return type:
- class DF(mu: sptIdx, factor: int | Fraction | Complex = 1)¶
Bases:
d
Used 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:
Block
Represents 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.
- Returns:
A copy of itself transformed accordingly.
- Return type:
- 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. => Has to be adapted for non-trivial cases!
- class M(factor: int | Fraction | Complex = 1)¶
Bases:
Block
Represents 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:
Block
Container for covariant derivatives acting on an algebra-valued object like F[mu,nu], Colour, DF[mu] etc.
CAVEAT: For internal use only!
- Parameters:
- charge()¶
Implements conventional charge conjugation.
- Returns:
A copy of itself transformed accordingly.
- Return type:
- 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. => Has to be adapted for non-trivial cases!
- class _DFl(mu: sptIdx, factor: int | Fraction | Complex = 1)¶
Bases:
d
Used 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:
Block
Represents 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:
M
Represents 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
,D0
acting in both directions within aLinearComb
.