Exemplo n.º 1
0
 def c_der(self):
     n = self.num_of_inds
     factor = OpSum(i_op * Op(sigma4bar(n + 1, 0, -1)))
     f = Op(
         Tensor(self.c_name, [0] + list(range(-2, -n - 1, -1)),
                is_field=True,
                dimension=1.5,
                statistics=fermion))
     return factor * f.derivative(n + 1)
Exemplo n.º 2
0
def imaginary_part(op, complex_tensors):
    op_complex_tensors = [
        tensor for tensor in op.tensors
        if tensor.name in complex_tensors]
    op_real_tensors = [
        tensor for tensor in op.tensors
        if tensor.name not in complex_tensors]
    indices = concat([tensor.indices for tensor in op_complex_tensors])
    im_tensor = Tensor("$im", indices, content=op_complex_tensors)
    return Op(im_tensor) * Op(*op_real_tensors)
Exemplo n.º 3
0
def real_part(op, complex_tensors):
    op_complex_tensors = [
        tensor for tensor in op.tensors
        if tensor.name in complex_tensors]
    op_real_tensors = [
        tensor for tensor in op.tensors
        if tensor.name not in complex_tensors]
    indices = concat([tensor.indices for tensor in op_complex_tensors])
    re_tensor = Tensor("$re", indices, content=op_complex_tensors)
    return Op(re_tensor) * Op(*op_real_tensors)
Exemplo n.º 4
0
 def quadratic_terms(self):
     """Construct the quadratic terms (1/2)[(DS)^2 + M^2 S^2]."""
     n = self.num_of_inds
     f = Tensor(self.name,
                list(range(n)),
                is_field=True,
                dimension=1,
                statistics=boson)
     f_op = Op(f)
     kinetic_term = (OpSum(number_op(Fraction(1, 2))) *
                     Op(f).derivative(n + 1) * Op(f).derivative(n + 1))
     mass_term = number_op(-Fraction(1, 2)) * self.mass_sq * f_op * f_op
     return kinetic_term + OpSum(mass_term)
Exemplo n.º 5
0
def collect_powers(operator):
    """
    Collect all the tensors that are equal and return the correspondin
    powers.
    """
    new_tensors = []
    symbols = {}
    for tensor in operator.tensors:
        if tensor.is_field or tensor.name[0] == "$" or tensor.exponent is None:
            new_tensors.append(tensor)
        else:
            # Previusly collected exponent for same base and indices
            prev_exponent = symbols.get((tensor.name, tuple(tensor.indices)),
                                        0)

            # The exponents of a product are added
            symbols[(tensor.name, tuple(tensor.indices))] = (tensor.exponent +
                                                             prev_exponent)

    # Remove tensors with exponent 0
    new_op = Operator([])
    for (name, inds), exponent in symbols.items():
        if exponent != 0:
            new_op *= power_op(name, exponent, indices=inds)

    return new_op * Op(*new_tensors)
Exemplo n.º 6
0
 def _create_op_field(self, name):
     return Op(
         Tensor(name,
                list(range(self.num_of_inds)),
                is_field=True,
                dimension=1.5,
                statistics=fermion))
Exemplo n.º 7
0
 def quadratic_terms(self):
     """Construct the quadratic terms DSc DS + M^2 Sc S."""
     n = self.num_of_inds
     f = Tensor(self.name,
                list(range(n)),
                is_field=True,
                dimension=1,
                statistics=boson)
     c_f = Tensor(self.c_name,
                  list(range(n)),
                  is_field=True,
                  dimension=1,
                  statistics=boson)
     f_op = Op(f)
     c_f_op = Op(c_f)
     kinetic_term = Op(c_f).derivative(n + 1) * Op(f).derivative(n + 1)
     mass_term = number_op(-1) * self.mass_sq * c_f_op * f_op
     return kinetic_term + OpSum(mass_term)
Exemplo n.º 8
0
    def apply_diff_op(self, operator_sum):
        """
        Apply the diff. op. (D_mu D_nu - D^2 eta_{munu})/M^2.

        The index mu is to be contracted with the first free index of the
        operator sum J_mu provided as an argument.
        """
        n = self.num_of_inds
        inds_1 = [0] + list(range(-2, -n - 1, -1))
        inds_2 = list(range(-1, -n - 1, -1))
        generic_1 = Op(generic(*inds_1))
        generic_2 = Op(generic(*inds_2))
        generic_der_1 = apply_derivatives([0, -1], generic_1)
        generic_der_2 = apply_derivatives([0, 0], generic_2)
        structure = (
            OpSum(self.free_inv_mass_sq) * generic_der_1 +
            OpSum(number_op(-1) * self.free_inv_mass_sq) * generic_der_2)
        return structure.replace_all({"generic": operator_sum}, 6)
Exemplo n.º 9
0
 def quadratic_terms(self):
     """
     Construct the terms (i Fc (D F) - i (D Fc) F - (FF + Fc Fc))/2
     """
     n = self.num_of_inds
     f = Op(
         Tensor(self.name,
                list(range(n)),
                is_field=True,
                dimension=1.5,
                statistics=fermion))
     f1 = Op(
         Tensor(self.name, [n] + list(range(1, n)),
                is_field=True,
                dimension=1.5,
                statistics=fermion))
     c_f = Op(
         Tensor(self.c_name,
                list(range(n)),
                is_field=True,
                dimension=1.5,
                statistics=fermion))
     c_f1 = Op(
         Tensor(self.c_name, [n] + list(range(1, n)),
                is_field=True,
                dimension=1.5,
                statistics=fermion))
     half = OpSum(number_op(Fraction(1, 2)))
     kin = (c_f * f).replace_first(self.name, self.der())
     kinc = -(c_f * f).replace_first(self.c_name, self.c_der())
     mass1 = self.mass * Op(epsUp(0, n)) * f * f1
     mass2 = self.mass * c_f * c_f1 * Op(epsUpDot(0, n))
     return half * (kin + kinc + OpSum(mass1, -mass2))
Exemplo n.º 10
0
 def quadratic_terms(self):
     n = self.num_of_inds
     f1 = Op(
         Tensor(self.name,
                list(range(n)),
                is_field=True,
                dimension=1,
                statistics=boson))
     f1c = Op(
         Tensor(self.c_name,
                list(range(n)),
                is_field=True,
                dimension=1,
                statistics=boson))
     f2c = Op(
         Tensor(self.c_name, [n] + list(range(1, n)),
                is_field=True,
                dimension=1,
                statistics=boson))
     kin1 = -f1c.derivative(n) * f1.derivative(n)
     kin2 = f2c.derivative(0) * f1.derivative(n)
     mass_term = OpSum(self.mass_sq * f1c * f1)
     return kin1 + kin2 + mass_term
Exemplo n.º 11
0
 def quadratic_terms(self):
     n = self.num_of_inds
     f1 = Op(
         Tensor(self.name,
                list(range(n)),
                is_field=True,
                dimension=1,
                statistics=boson))
     f2 = Op(
         Tensor(self.name, [n] + list(range(1, n)),
                is_field=True,
                dimension=1,
                statistics=boson))
     half = OpSum(number_op(Fraction(1, 2)))
     kin1 = -half * f1.derivative(n) * f1.derivative(n)
     kin2 = half * f2.derivative(0) * f1.derivative(n)
     mass_term = half * OpSum(self.mass_sq * f1 * f1)
     return kin1 + kin2 + mass_term
Exemplo n.º 12
0
uR = FieldBuilder("uR", 1.5, fermion)
r"""Up quark right-handed doublet"""
uRc = FieldBuilder("uRc", 1.5, fermion)
r"""Conjugate of the up quark right-handed doublet"""

bFS = FieldBuilder("bFS", 2, boson)
r""":math:`U(1)` gauge field strength :math:`B_{\mu\nu}`"""
wFS = FieldBuilder("wFS", 2, boson)
r""":math:`SU(2)` gauge field strength :math:`W^a_{\mu\nu}`"""
gFS = FieldBuilder("gFS", 2, boson)
r""":math:`SU(3)` gauge field strength :math:`G^A_{\mu\nu}`"""

# Equations of motion

eom_phi = (
    Op(D(0, D(0, phi(-1)))),
    OpSum(Op(mu2phi(), phi(-1)),
          -number_op(2) * Op(lambdaphi(), phic(0), phi(0), phi(-1)),
          -Op(yec(0, 1), eRc(2, 1), lL(2, -1, 0)),
          -Op(ydc(0, 1), dRc(2, 3, 1), qL(2, 3, -1, 0)),
          -Op(Vc(0, 1), yu(0, 2), qLc(3, 4, 5, 1), uR(3, 4, 2), epsSU2(5, -1))))
r"""
Rule using the Higgs doublet equation of motion. 
Substitute :math:`D^2\phi` by

.. math::
    \mu^2_\phi \phi- 2\lambda_\phi (\phi^\dagger\phi) \phi
    - y^{e*}_{ij} \bar{e}_{Rj} l_{Li} - y^{d*}_{ij} \bar{d}_{Rj} q_{Li}
    + V^*_{ki} y^u_{kj} i\sigma^2 \bar{q}^T_{Li} u_{Rj}
"""
Exemplo n.º 13
0
r"""
Totally antisymmetric tensor :math:`\epsilon_{ABC}` with three
:math:`SU(3)` triplet indices such that :math:`\epsilon_{123}=1`.
"""

TSU3 = TensorBuilder("TSU3")
r"""
:math:`SU(3)` generators :math:`(T_A)_{BC}` (half of the Gell-Mann matrices).
"""

fSU3 = TensorBuilder("fSU3")
r"""
:math:`SU(3)` structure constants :math:`f_{ABC}`.
"""

rule_SU3_eps = (Op(epsSU3(0, -1, -2), epsSU3(0, -3, -4)),
                OpSum(-Op(kdelta(-1, -4), kdelta(-3, -2)),
                      Op(kdelta(-1, -3), kdelta(-2, -4))))

rule_fierz_SU3 = (Op(TSU3(0, -1, -2), TSU3(0, -3, -4)),
                  OpSum(
                      number_op(Fraction(1, 2)) *
                      Op(kdelta(-1, -4), kdelta(-3, -2)),
                      -number_op(Fraction(1, 6)) *
                      Op(kdelta(-1, -2), kdelta(-3, -4))))

rules_SU3 = [rule_SU3_eps, rule_fierz_SU3]

latex_SU3 = {
    "epsSU3": r"\epsilon_{{{}{}{}}}",
    "TSU3": r"(T_{})_{{{}{}}}",
Exemplo n.º 14
0
 def app_eps(self, op_sum):
     n = self.num_of_inds
     F = generic(*([0] + list(range(-2, -n - 1, -1))))
     return Op(F, epsDown(0, -1)).replace_first("generic", op_sum)
Exemplo n.º 15
0
 def pre_eps(self, op_sum):
     n = self.num_of_inds
     F = generic(*([0] + list(range(-2, -n - 1, -1))))
     return Op(epsDownDot(0, -1), F).replace_first("generic", op_sum)
Exemplo n.º 16
0
r"""
Totally antisymmetric tensor with four Lorentz vector indices
:math:`\epsilon_{\mu\nu\rho\sigma}` where :math:`\epsilon_{0123}=1`.
"""

sigmaTensor = TensorBuilder("sigmaTensor")
r"""
Lorentz tensor 
:math:`\sigma^{\mu\nu}=\frac{i}{4}\left(
\sigma^\mu_{\alpha\dot{\gamma}}\bar{\sigma}^{\nu\dot{\gamma}\beta}-
\sigma^\nu_{\alpha\dot{\gamma}}\bar{\sigma}^{\mu\dot{\gamma}\beta}
\right)`.
"""

rule_Lorentz_free_epsUp = (
    Op(epsUp(-1, -2), epsUpDot(-3, -4)),
    OpSum(number_op(Fraction(1, 2)) * Op(
        sigma4bar(0, -3, -1), sigma4bar(0, -4, -2))))
r"""
Substitute :math:`\epsilon^{\alpha\beta}\epsilon^{\dot{\alpha}\dot{\beta}}`
by

.. math::
    -\frac{1}{2} \bar{\sigma}^{\mu,\dot{\alpha}\alpha}
    \bar{\sigma}^{\dot{\beta}\beta}_\mu
"""

rule_Lorentz_free_epsDown = (
    Op(epsDown(-1, -2), epsDownDot(-3, -4)),
    OpSum(number_op(Fraction(1, 2)) * Op(
        sigma4(0, -1, -3), sigma4(0, -2, -4))))
Exemplo n.º 17
0
# Auxiliary operators for intermediate calculations

O5aux = flavor_tensor_op("O5aux")
O5auxc = flavor_tensor_op("O5auxc")

Olqqqaux = flavor_tensor_op("Olqqqaux")
Olqqqauxc = flavor_tensor_op("Olqqqauxc")

rules_basis_defs_dim_6_5 = [

    # Standard Model dimension 6 four-fermion operators

    # LLLL type
    (Op(lLc(0, 1, -1), sigma4bar(2, 0, 3), lL(3, 1, -2), lLc(4, 5, -3),
        sigma4bar(2, 4, 6),
        lL(6, 5, -4)), OpSum(number_op(2) * O1ll(-1, -2, -3, -4))),
    (Op(qLc(0, 1, 2, -1), sigma4bar(3, 0, 4), qL(4, 1, 2,
                                                 -2), qLc(5, 6, 7, -3),
        sigma4bar(3, 5, 8),
        qL(8, 6, 7, -4)), OpSum(number_op(2) * O1qq(-1, -2, -3, -4))),
    (Op(qLc(0, 1, 2, -1), sigma4bar(3, 0, 4), TSU3(5, 1, 6), qL(4, 6, 2, -2),
        qLc(7, 8, 9, -3), sigma4bar(3, 7, 10), TSU3(5, 8, 11),
        qL(10, 11, 9, -4)), OpSum(number_op(2) * O8qq(-1, -2, -3, -4))),
    (Op(lLc(0, 1, -1), sigma4bar(2, 0, 3), lL(3, 1, -2), qLc(4, 5, 6, -3),
        sigma4bar(2, 4, 7), qL(7, 5, 6, -4)), OpSum(O1lq(-1, -2, -3, -4))),
    (Op(lLc(0, 1, -1), sigma4bar(2, 0, 3), sigmaSU2(4, 1, 5), lL(3, 5, -2),
        qLc(6, 7, 8, -3), sigma4bar(2, 6, 9), sigmaSU2(4, 8, 10),
        qL(9, 7, 10, -4)), OpSum(O3lq(-1, -2, -3, -4))),

    # RRRR type
Exemplo n.º 18
0
lambdaDYD = TensorBuilder("lambdaDYD")
lambdaDYDc = TensorBuilder("lambdaDYDc")

DL = FieldBuilder("DL", 1.5, fermion)
DR = FieldBuilder("DR", 1.5, fermion)
DLc = FieldBuilder("DLc", 1.5, fermion)
DRc = FieldBuilder("DRc", 1.5, fermion)
DYL = FieldBuilder("DYL", 1.5, fermion)
DYR = FieldBuilder("DYR", 1.5, fermion)
DYLc = FieldBuilder("DYLc", 1.5, fermion)
DYRc = FieldBuilder("DYRc", 1.5, fermion)

interaction_lagrangian = -OpSum(
    # Linear part
    Op(lambdaDq(0, 1), DRc(2, 3, 0), phic(4), qL(2, 3, 4, 1)),
    Op(lambdaDqc(0, 1), qLc(2, 3, 4, 1), phi(4), DR(2, 3, 0)),
    Op(lambdaDYd(0, 1), DYLc(2, 3, 4, 0), epsSU2(4, 5), phic(5), dR(2, 3, 1)),
    Op(lambdaDYdc(0, 1), dRc(2, 3, 1), epsSU2(4, 5), phi(5), DYL(2, 3, 4, 0)),

    # D - DY interaction
    Op(lambdaDYD(0, 1), DYRc(2, 3, 4, 0), epsSU2(4, 5), phic(5), DL(2, 3, 1)),
    Op(lambdaDYDc(0, 1), DLc(2, 3, 1), epsSU2(4, 5), phi(5), DYR(2, 3, 4, 0)))

# Integration

heavy_D = VectorLikeFermion("D", "DL", "DR", "DLc", "DRc", 3)
heavy_DY = VectorLikeFermion("DY", "DYL", "DYR", "DYLc", "DYRc", 4)

heavy_fields = [heavy_D, heavy_DY]
effective_lagrangian = integrate(heavy_fields, interaction_lagrangian, 6)
Exemplo n.º 19
0
def display_operator(operator, structures, inds, num, no_parens=None,
                     numeric=None):
    if numeric is None:
        numeric = []
    
    # Nice representation for fractions.Fraction and integers
    if isinstance(num, (int, Fraction)):
        pre = "+ " if num > 0 else "- "
        n = abs(num.numerator)
        d = num.denominator
        pre_up = "" if n == 1 else str(n)
        pre_down = "" if d == 1 else str(d)
    else:
        pre = "+ (" + str(num) + ")"
        pre_up = ""
        pre_down = ""
        
    if operator.tensors[0].name == "$i":
        i_up = "i "
        operator = Op(*operator.tensors[1:])
    else:
        i_up = ""

    # Assign the indices    
    assigned_inds = {}
    left_inds = inds[:]
    n = num_of_free_inds(operator)
    for i in range(n):
        assigned_inds[-i - 1] = left_inds[i]
    left_inds = left_inds[n:]
    for tensor in operator.tensors:
        for index in tensor.indices:
            if index not in assigned_inds.keys():
                if index > -1:
                    assigned_inds[index] = left_inds[0]
                    left_inds = left_inds[1:]

    # Main tensors in with positive and negative powers
    numerator = " ".join(
        [display_tensor(tensor, structures, assigned_inds, no_parens)
         for tensor in operator.tensors
         if ((tensor.exponent is None or tensor.exponent > -1) and
             tensor.name not in numeric)])
    denominator = " ".join(
        [display_tensor(tensor, structures, assigned_inds, no_parens)
         for tensor in operator.tensors
         if ((tensor.exponent is not None and tensor.exponent < 0) and
             tensor.name not in numeric)])

    # Numeric factors with symbolic expression as tensors
    num_up = " ".join(
        [display_tensor(tensor, structures, assigned_inds, no_parens)
         for tensor in operator.tensors
         if ((tensor.exponent is None or tensor.exponent > -1) and
             tensor.name in numeric)])
    num_down = " ".join(
        [display_tensor(tensor, structures, assigned_inds, no_parens)
         for tensor in operator.tensors
         if ((tensor.exponent is not None and tensor.exponent < 0) and
             tensor.name in numeric)])

    return "{} \\frac{{{} {} {} {}}}{{{} {} {}}}".format(
        pre,
        pre_up, num_up, i_up, numerator,
        pre_down, num_down, denominator)
Exemplo n.º 20
0
from matchingtools.transformations import apply_rules

from matchingtools.output import Writer

# Creation of the model

sigma = TensorBuilder("sigma")
kappa = TensorBuilder("kappa")
lamb = TensorBuilder("lamb")

phi = FieldBuilder("phi", 1, boson)
phic = FieldBuilder("phic", 1, boson)
Xi = FieldBuilder("Xi", 1, boson)

interaction_lagrangian = -OpSum(
    Op(kappa(), Xi(0), phic(1), sigma(0, 1, 2), phi(2)),
    Op(lamb(), Xi(0), Xi(0), phic(1), phi(1)))

# Integration

heavy_Xi = RealScalar("Xi", 1, has_flavor=False)

heavy_fields = [heavy_Xi]
max_dim = 6
effective_lagrangian = integrate(heavy_fields, interaction_lagrangian, max_dim)

# Transformations of the effective Lgrangian

fierz_rule = (Op(sigma(0, -1, -2), sigma(0, -3, -4)),
              OpSum(
                  number_op(2) * Op(kdelta(-1, -4), kdelta(-3, -2)),
Exemplo n.º 21
0
"""

epsSU2quadruplets = TensorBuilder("epsSU2quadruplets")
r"""
Two-index that gives a singlet when contracted with two
:math:`SU(2)` quadruplets.
"""

fSU2 = TensorBuilder("fSU2")
r"""
Totally antisymmetric tensor with three :math:`SU(2)` triplet indices
given by :math:`f_{abc}=\frac{i}{\sqrt{2}}\epsilon_{abc}` with
:math:`\epsilon_{123}=1`.
"""

rule_SU2_fierz = ((Op(sigmaSU2(0, -1, -2), sigmaSU2(0, -3, -4)),
                   OpSum(
                       number_op(2) * Op(kdelta(-1, -4), kdelta(-3, -2)),
                       -Op(kdelta(-1, -2), kdelta(-3, -4)))))
r"""
Subtitute :math:`\sigma^a_{ij} \sigma^a_{kl}` by
:math:`2\delta_{il}\delta_{kj} - \delta_{ij}\delta{kl}`.
"""

rule_SU2_product_sigmas = ((Op(sigmaSU2(0, -1, 1), sigmaSU2(0, 1, -2)),
                            OpSum(number_op(3) * Op(kdelta(-1, -2)))))
r"""
Subtitute :math:`\sigma^a_{ij}\sigma^a_{jk}` by
:math:`3\delta_{ik}`.
"""