Beispiel #1
0
    def test_weights(self):
        self.assertEqual(parse_weight('3'), Weight([3]))

        self.assertEqual(parse_weight('1 2'), Weight([1, 2]))

        self.assertEqual(parse_weight('8 -9 1'), Weight([8, -9, 1]))

        self.assertEqual(parse_weight('  1  8 -5   -11  4 2 '),
                         Weight([1, 8, -5, -11, 4, 2]))
Beispiel #2
0
    def highest_root(self):
        if self.series == Series.A:
            return Weight(
                [1] + [0] * (self.rank - 2) + [1] if self.rank > 1 else [2]
            )

        if self.series == Series.B:
            return Weight([0, 1] + [0] * (self.rank - 2))

        if self.series == Series.C:
            return Weight([2] + [0] * (self.rank - 1))

        if self.series == Series.D:
            return Weight([0, 1] + [0] * (self.rank - 2))

        if self.series == Series.E:
            if self.rank == 6:
                return Weight([0, 0, 0, 0, 0, 1])
            elif self.rank == 7:
                return Weight([1, 0, 0, 0, 0, 0, 0])
            elif self.rank == 8:
                return Weight([0, 0, 0, 0, 0, 0, 1, 0])

        if self.series == Series.F:
            return Weight([1, 0, 0, 0])

        if self.series == Series.G:
            return Weight([1, 0])
    def test_covariants_higgs(self):
        covariants = EFT(sm_gauge_algebra, [phi, phic]).covariants(3)

        known_covariants = {
            (Weight([0, 0]), Weight([0, 0, 1]), (-0.5, )):
            Counter({
                (phic._to_operator(), 0): 1,
                (phi * phic**2, 0): 1
            }),
            (Weight([1, 1]), Weight([0, 0, 1]), (-0.5, )):
            Counter({(phic._to_operator(), 1): 1})
        }

        for key in known_covariants:
            self.assertEqual(covariants[key], known_covariants[key])
Beispiel #4
0
 def level_vector(self):
     return Weight(
         itertools.chain.from_iterable(
             simple_algebra.level_vector
             for simple_algebra in self
         )
     )
Beispiel #5
0
    def test_highest_root(self):
        known_highest_roots = {
            self.a1: Weight([2]),
            self.a2: Weight([1, 1]),
            self.b4: Weight([0, 1, 0, 0]),
            self.c6: Weight([2, 0, 0, 0, 0, 0]),
            self.d5: Weight([0, 1, 0, 0, 0]),
            self.e6: Weight([0, 0, 0, 0, 0, 1]),
            self.e7: Weight([1, 0, 0, 0, 0, 0, 0]),
            self.e8: Weight([0, 0, 0, 0, 0, 0, 1, 0]),
            self.f4: Weight([1, 0, 0, 0]),
            self.g2: Weight([1, 0])
        }

        for algebra, root in known_highest_roots.items():
            self.assertEqual(algebra.highest_root, root)
Beispiel #6
0
    def _semisimple_weight_system(self):
        algebras = self.algebra.simple_algebras
        split_highest_weight = self.algebra.split_weight(self.highest_weight)

        split_weights = (
            Irrep(algebra, weight).weight_system.weights.elements()
            for algebra, weight in zip(algebras, split_highest_weight))

        return WeightSystem(
            Weight(list(itertools.chain.from_iterable(weights)))
            for weights in itertools.product(*split_weights))
Beispiel #7
0
    def conjugate(self):
        lorentz_highest_weight = Weight(
            reversed(self.lorentz_irrep.highest_weight))

        return Field(name=self.name + "*",
                     lorentz_irrep=Irrep(lorentz_algebra,
                                         lorentz_highest_weight),
                     internal_irrep=self.internal_irrep.conjugate,
                     charges=[-charge for charge in self.charges],
                     statistics=self.statistics,
                     dimension=self.dimension,
                     number_of_derivatives=self.number_of_derivatives,
                     number_of_flavors=self.number_of_flavors)
Beispiel #8
0
    def differentiate(self, times, use_eom=True):
        if use_eom or self._force_use_eom:
            highest_weight = (Weight([times, times]) +
                              self.lorentz_irrep.highest_weight)
            lorentz_irreps = [Irrep(lorentz_algebra, highest_weight)]

        else:
            lorentz_irreps = (
                self.lorentz_irrep *
                vector.power(times, statistics=Statistics.BOSON)).elements()

        return (Field(name=self.name,
                      lorentz_irrep=lorentz_irrep,
                      internal_irrep=self.internal_irrep,
                      charges=self.charges,
                      statistics=self.statistics,
                      dimension=self.dimension + times,
                      number_of_derivatives=self.number_of_derivatives + times,
                      number_of_flavors=self.number_of_flavors)
                for lorentz_irrep in lorentz_irreps)
Beispiel #9
0
 def test_split_weight(self):
     self.assertEqual(
         self.algebra.split_weight(Weight([
             1,
             2, 5,
             -8, 3, 4, 5, 4, 2, 11, 2, 4,
             0, -2, -3, -4, 5, 7, 6,
             4, 3, 4, 3, 4, 3, 4,
             0, 0
         ])),
         [
             Weight([1]),
             Weight([2, 5]),
             Weight([-8, 3, 4, 5, 4, 2, 11, 2, 4]),
             Weight([0, -2, -3, -4, 5, 7, 6]),
             Weight([4, 3, 4, 3, 4, 3, 4]),
             Weight([0, 0])
         ]
     )
    def test_positive_roots(self):
        known_positive_roots = {
            SimpleAlgebra(Series.A, 2): {
                Weight([1, 1]),
                Weight([2, -1]), Weight([-1, 2])
            },

            SimpleAlgebra(Series.C, 2): {
                Weight([2, 0]),
                Weight([0, 1]),
                Weight([2, -1]), Weight([-2, 2])
            },

            SimpleAlgebra(Series.G, 2): {
                Weight([1, 0]),
                Weight([-1, 3]),
                Weight([0, 1]),
                Weight([1, -1]),
                Weight([2, -3]), Weight([-1, 2])
            },

            SimpleAlgebra(Series.A, 3): {
                Weight([1, 0, 1]),
                Weight([1, 1, -1]), Weight([-1, 1, 1]),
                Weight([2, -1, 0]), Weight([-1, 2, -1]), Weight([0, -1, 2])
            },

            SimpleAlgebra(Series.B, 3): {
                Weight([0, 1, 0]),
                Weight([1, -1, 2]),
                Weight([1, 0, 0]), Weight([-1, 0, 2]),
                Weight([1, 1, -2]), Weight([-1, 1, 0]),
                Weight([2, -1, 0]), Weight([-1, 2, -2]), Weight([0, -1, 2])
            },

            SimpleAlgebra(Series.C, 3): {
                Weight([2, 0, 0]),
                Weight([0, 1, 0]),
                Weight([1, -1, 1]), Weight([-2, 2, 0]),
                Weight([1, 1, -1]), Weight([-1, 0, 1]),
                Weight([2, -1, 0]), Weight([-1, 2, -1]), Weight([0, -2, 2])
            },

            SimpleAlgebra(Series.A, 4): {
                Weight([1, 0, 0, 1]),

                Weight([1, 0, 1, -1]), Weight([-1, 1, 0, 1]),

                Weight([1, 1, -1, 0]), Weight([-1, 1, 1, -1]),
                Weight([0, -1, 1, 1]),

                Weight([2, -1, 0, 0]), Weight([-1, 2, -1, 0]),
                Weight([0, -1, 2, -1]), Weight([0, 0, -1, 2])
            },

            SimpleAlgebra(Series.D, 5): {
                Weight([0, 1, 0, 0, 0]),

                Weight([1, -1, 1, 0, 0]),

                Weight([-1, 0, 1, 0, 0]), Weight([1, 0, -1, 1, 1]),

                Weight([-1, 1, -1, 1, 1]), Weight([1, 0, 0, -1, 1]),
                Weight([1, 0, 0, 1, -1]),

                Weight([0, -1, 0, 1, 1]), Weight([-1, 1, 0, -1, 1]),
                Weight([-1, 1, 0, 1, -1]), Weight([1, 0, 1, -1, -1]),

                Weight([0, -1, 1, -1, 1]), Weight([0, -1, 1, 1, -1]),
                Weight([-1, 1, 1, -1, -1]), Weight([1, 1, -1, 0, 0]),

                Weight([0, 0, -1, 0, 2]), Weight([0, 0, -1, 2, 0]),
                Weight([0, -1, 2, -1, -1]), Weight([-1, 2, -1, 0, 0]),
                Weight([2, -1, 0, 0, 0])
            }
        }

        for algebra, roots in known_positive_roots.items():
            self.assertEqual(set(Irrep.positive_roots(algebra)), roots)
Beispiel #11
0
def lorentz_irrep(n, m):
    return Irrep(lorentz_algebra, Weight([round(2 * n), round(2 * m)]))
Beispiel #12
0
 def singlet(algebra):
     return Irrep(algebra, Weight([0] * algebra.rank))
Beispiel #13
0
def parse_weight(code):
    return Weight(map(int, code.split()))
    def test_su3_tensor_products(self):
        SU3_algebra = SimpleAlgebra(Series.A, 2)

        name_irrep_table = {
            '1': Irrep(SU3_algebra, Weight([0, 0])),
            '3': Irrep(SU3_algebra, Weight([1, 0])),
            '6': Irrep(SU3_algebra, Weight([2, 0])),
            '8': Irrep(SU3_algebra, Weight([1, 1])),
            '10': Irrep(SU3_algebra, Weight([3, 0])),
            '15': Irrep(SU3_algebra, Weight([2, 1])),
            "15'": Irrep(SU3_algebra, Weight([4, 0])),
            '21': Irrep(SU3_algebra, Weight([0, 5])),
            '24': Irrep(SU3_algebra, Weight([1, 3])),
            '27': Irrep(SU3_algebra, Weight([2, 2]))
        }

        def SU3_irrep(name):
            if name in name_irrep_table:
                return name_irrep_table[name]
            else:
                return name_irrep_table[name[:-1]].conjugate

        known_decompositions = [
            (
                SU3_irrep('3*') * SU3_irrep('3*'),
                [SU3_irrep('3'), SU3_irrep('6*')]
            ),
            (
                SU3_irrep('3') * SU3_irrep('3*'),
                [SU3_irrep('1'), SU3_irrep('8')]
            ),
            (
                SU3_irrep('6') * SU3_irrep('3'),
                [SU3_irrep('8'), SU3_irrep('10')]
            ),
            (
                SU3_irrep('6') * SU3_irrep('3*'),
                [SU3_irrep('3'), SU3_irrep('15')]
            ),
            (
                SU3_irrep('6') * SU3_irrep('6'),
                [SU3_irrep('6*'), SU3_irrep('15'), SU3_irrep("15'")]
            ),
            (
                SU3_irrep('6') * SU3_irrep('6*'),
                [SU3_irrep('1'), SU3_irrep('8'), SU3_irrep('27')]
            ),
            (
                SU3_irrep('8') * SU3_irrep('3'),
                [SU3_irrep('3'), SU3_irrep('6*'), SU3_irrep('15')],
            ),
            (
                SU3_irrep('8') * SU3_irrep('6*'),
                [SU3_irrep('3'), SU3_irrep('6*'),
                 SU3_irrep('15'), SU3_irrep('24')]
            ),
            (
                SU3_irrep('8') * SU3_irrep('8'),
                [SU3_irrep('1'), SU3_irrep('8'), SU3_irrep('8'),
                 SU3_irrep('10'), SU3_irrep('10*'), SU3_irrep('27')]
            )
        ]

        for product, decomposition in known_decompositions:
            self.assertEqual(product, collections.Counter(decomposition))
Beispiel #15
0
 def join_weights(self, weights):
     return Weight(itertools.chain.from_iterable(weights))
Beispiel #16
0
 def sum_of_positive_roots(self):
     return Weight([1] * self.rank)
    def test_representation(self):
        known_weights = {
            Irrep(
                SimpleAlgebra(Series.D, 5),
                Weight([0, 0, 0, 0, 1])
            ):
            collections.Counter([
                Weight([0, 0, 0, 0, 1]),
                Weight([0, 0, 1, 0, -1]),
                Weight([0, 1, -1, 1, 0]),
                Weight([1, -1, 0, 1, 0]), Weight([0, 1, 0, -1, 0]),
                Weight([-1, 0, 0, 1, 0]), Weight([1, -1, 1, -1, 0]),
                Weight([-1, 0, 1, -1, 0]), Weight([1, 0, -1, 0, 1]),
                Weight([-1, 1, -1, 0, 1]), Weight([1, 0, 0, 0, -1]),
                Weight([0, -1, 0, 0, 1]), Weight([-1, 1, 0, 0, -1]),
                Weight([0, -1, 1, 0, -1]),
                Weight([0, 0, -1, 1, 0]),
                Weight([0, 0, 0, -1, 0])
            ]),

            Irrep(
                SimpleAlgebra(Series.E, 6),
                Weight([1, 0, 0, 0, 0, 0])
            ):
            collections.Counter([
                Weight([1, 0, 0, 0, 0, 0]),
                Weight([-1, 1, 0, 0, 0, 0]),
                Weight([0, -1, 1, 0, 0, 0]),
                Weight([0, 0, -1, 1, 0, 1]),
                Weight([0, 0, 0, -1, 1, 1]), Weight([0, 0, 0, 1, 0, -1]),
                Weight([0, 0, 0, 0, -1, 1]), Weight([0, 0, 1, -1, 1, -1]),
                Weight([0, 0, 1, 0, -1, -1]), Weight([0, 1, -1, 0, 1, 0]),
                Weight([0, 1, -1, 1, -1, 0]), Weight([1, -1, 0, 0, 1, 0]),

                Weight([0, 1, 0, -1, 0, 0]), Weight([1, -1, 0, 1, -1, 0]),
                Weight([-1, 0, 0, 0, 1, 0]),

                Weight([1, -1, 1, -1, 0, 0]), Weight([-1, 0, 0, 1, -1, 0]),
                Weight([1, 0, -1, 0, 0, 1]), Weight([-1, 0, 1, -1, 0, 0]),
                Weight([1, 0, 0, 0, 0, -1]), Weight([-1, 1, -1, 0, 0, 1]),
                Weight([-1, 1, 0, 0, 0, -1]), Weight([0, -1, 0, 0, 0, 1]),
                Weight([0, -1, 1, 0, 0, -1]),
                Weight([0, 0, -1, 1, 0, 0]),
                Weight([0, 0, 0, -1, 1, 0]),
                Weight([0, 0, 0, 0, -1, 0])
            ])
        }

        for irrep, weights in known_weights.items():
            self.assertEqual(irrep.weight_system.weights, weights)