Esempio n. 1
0
def collect_conjugates(coef, conjugates):
    if conjugates == None:
        return coef
    
    ctensors = [t for t in conjugates if conjugates[t] != t]
    new_op_sum = OpSum()
    
    def convert_tensor(tensor):
        if tensor.name == "$i":
            return tensor
        new_tensor = copy.copy(tensor)
        new_tensor.name = conjugates[tensor.name]
        return new_tensor

    rest_ops = coef
    while len(rest_ops) > 0:
        op, num = rest_ops[0]
        opc = Operator(map(convert_tensor, op.tensors))
        for i, (other, other_num) in enumerate(rest_ops[1:]):
            if ((other == opc and other_num == num) or
                (other == -opc and other_num == -num)):
                rest_ops = rest_ops[1:i+1] + rest_ops[i+2:]
                new_op_sum += OpSum(
                number_op(2 * num) * real_part(op, ctensors))
                break
            if ((other == -opc and other_num == num) or
                (other == opc and other_num == -num)):
                rest_ops = rest_ops[1:i+1] + rest_ops[i+2:]
                new_op_sum += OpSum(
                number_op(2 * num) * i_op * imaginary_part(op, ctensors))
                break
        else:
            rest_ops = rest_ops[1:]
            new_op_sum += OpSum(number_op(num) * op)
    return sum_numbers(new_op_sum)
Esempio n. 2
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))
Esempio n. 3
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)
Esempio n. 4
0
 def equations_of_motion(self, interaction_lagrangian):
     variation = interaction_lagrangian.variation(self.name, fermion)
     c_variation = interaction_lagrangian.variation(self.c_name, fermion)
     inv_mass = OpSum(self.free_inv_mass)
     return [(self.c_name,
              -inv_mass * self.pre_eps(self.der() + c_variation)),
             (self.name, inv_mass * self.app_eps(self.c_der() + variation))]
Esempio n. 5
0
 def apply_diff_op(self, operator_sum):
     """Apply the differential operator -D^2/M^2."""
     final_op_sum = OpSum()
     for operator in operator_sum.operators:
         new_ind = operator.max_index + 1
         final_op_sum += apply_derivatives(
             [new_ind, new_ind], -self.free_inv_mass_sq * operator)
     return final_op_sum
Esempio n. 6
0
 def quadratic_terms(self):
     """
     Construct the terms (1/2) [i FLc (D FL) - i (D FLc) FL + i FRc D FR
     - i (D FRc) FR] - M (FLc FR + FRc FL)
     """
     n = self.num_of_inds
     fL, fR, fLc, fRc = map(
         self._create_op_field,
         [self.L_name, self.R_name, self.Lc_name, self.Rc_name])
     half = OpSum(number_op(Fraction(1, 2)))
     kinL = (fLc * fL).replace_first(self.L_name, self.L_der())
     kinR = (fRc * fR).replace_first(self.R_name, self.R_der())
     kinLc = (fLc * fL).replace_first(self.Lc_name, self.Lc_der())
     kinRc = (fRc * fR).replace_first(self.Rc_name, self.Rc_der())
     mass1 = self.mass * fLc * fR
     mass2 = self.mass * fRc * fL
     return half * (kinL + kinR + kinLc + kinRc) + OpSum(-mass1, -mass2)
Esempio n. 7
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)
Esempio n. 8
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
Esempio n. 9
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)
Esempio n. 10
0
 def equations_of_motion(self, interaction_lagrangian):
     L_variation = -interaction_lagrangian.variation(self.L_name, fermion)
     R_variation = -interaction_lagrangian.variation(self.R_name, fermion)
     Lc_variation = interaction_lagrangian.variation(self.Lc_name, fermion)
     Rc_variation = interaction_lagrangian.variation(self.Rc_name, fermion)
     op_sum_inv_mass = OpSum(self.free_inv_mass)
     return [
         (self.L_name, op_sum_inv_mass * (self.R_der() + Rc_variation)),
         (self.R_name, op_sum_inv_mass * (self.L_der() + Lc_variation)),
         (self.Lc_name, op_sum_inv_mass * (self.Rc_der() + R_variation)),
         (self.Rc_name, op_sum_inv_mass * (self.Lc_der() + L_variation))
     ]
Esempio n. 11
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)
Esempio n. 12
0
    def apply_propagator(self, operator_sum, max_order, max_dim):
        """
        Apply the vector propagator [(M^2 + D^2) eta_{munu} - D_mu D_nu]^(-1).

        Args:
            operator_sum (OperatorSum): the propagator is to be applied to it
            max_order=2 (int): maximum order in the derivatives to which
                               the propagator is to be expanded 
            max_dim=4 (int): maximum dimension of the resulting operators

        Return:
            OperatorSum of the operators with the propagator applied.
        """
        final_op_sum = operator_sum
        for order in range(0, max_order + 1, 2):
            operator_sum = self.apply_diff_op(operator_sum)
            final_op_sum += operator_sum
        coef_op = self.free_inv_mass_sq
        return OpSum(*[
            op * coef_op for op in final_op_sum.operators
            if op.dimension <= max_dim
        ])
Esempio n. 13
0
def integrate(heavy_fields, interaction_lagrangian, max_dim=6, verbose=True):
    """
    Integrate out heavy fields.

    Heavy field classes: ``RealScalar``, ``ComplexScalar``, ``RealVector``, 
    ``ComplexVector``, ``VectorLikeFermion`` or ``MajoranaFermion``.

    Args:
        heavy_fields (list of heavy fields): to be integrated out
        interaction_lagrangian (``matchingtools.operators.OperatorSum``):
            from which to integrate out the heavy fields
        max_dim (int): maximum dimension of the operators in the effective
            lagrangian
        verbose (bool): specifies whether to print messages signaling
            the start and end of the integration process.
    """
    if verbose:
        sys.stdout.write("Integrating... ")
        sys.stdout.flush()

    eoms = dict(
        concat([
            field.equations_of_motion(interaction_lagrangian)
            for field in heavy_fields
        ]))
    replaced_eoms = {
        field_name: replacement.replace_all(eoms, max_dim - 2)
        for field_name, replacement in eoms.items()
    }
    quadratic_lagrangian = sum(
        [field.quadratic_terms() for field in heavy_fields], OpSum())
    total_lagrangian = quadratic_lagrangian + interaction_lagrangian
    result = total_lagrangian.replace_all(replaced_eoms, max_dim)

    if verbose:
        sys.stdout.write("done.\n")

    return result
Esempio n. 14
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
Esempio n. 15
0
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}
"""

eom_phic = (
    Op(D(0, D(0, phic(-1)))),
    OpSum(Op(mu2phi(), phic(-1)),
Esempio n. 16
0
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_{})_{{{}{}}}",
    "fSU3": r"f_{{{}{}{}}}"
}
Esempio n. 17
0
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))))
r"""
Substitute :math:`\epsilon_{\alpha\beta}\epsilon_{\dot{\alpha}\dot{\beta}}`
Esempio n. 18
0
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)

# Transformations of the effective Lgrangian
Esempio n. 19
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
    (Op(eRc(0, -1), sigma4(1, 0, 2), eR(2, -2), eRc(3, -3), sigma4(1, 3, 4),
Esempio 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)),
Esempio 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}`.
"""

rule_SU2_free_eps = ((Op(epsSU2(-1, -2), epsSU2(-3, -4)),
                      OpSum(Op(kdelta(-1, -3), kdelta(-2, -4)),