예제 #1
0
 def setUp(self):
     self.a1 = SimpleAlgebra(Series.A, 1)
     self.a2 = SimpleAlgebra(Series.A, 2)
     self.b4 = SimpleAlgebra(Series.B, 4)
     self.c6 = SimpleAlgebra(Series.C, 6)
     self.d5 = SimpleAlgebra(Series.D, 5)
     self.e6 = SimpleAlgebra(Series.E, 6)
     self.e7 = SimpleAlgebra(Series.E, 7)
     self.e8 = SimpleAlgebra(Series.E, 8)
     self.f4 = SimpleAlgebra(Series.F, 4)
     self.g2 = SimpleAlgebra(Series.G, 2)
예제 #2
0
    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)
예제 #3
0
파일: parsing.py 프로젝트: vaspkit/basisgen
def _parse_simple_group(code):
    match = re.match(r'(?P<series>SU|SO|Sp)(?P<N>[0-9]+)', code)
    series = match.group('series')
    N = int(match.group('N'))

    if series == 'SU':
        return SimpleAlgebra(Series.A, N - 1)
    elif series == 'SO' and N % 2 == 1:
        return SimpleAlgebra(Series.B, round((N - 1) / 2))
    elif series == 'Sp':
        return SimpleAlgebra(Series.C, round(N/2))
    elif series == 'SO' and N == 4:
        return lorentz_algebra
    elif series == 'SO' and N % 2 == 0:
        return SimpleAlgebra(Series.D, round(N/2))
예제 #4
0
파일: parsing.py 프로젝트: vaspkit/basisgen
def _parse_simple_algebra(code):
    match = re.match(r'(?P<series>[ABCDEFG])(?P<rank>[0-9]+)', code)

    series = {
        'A': Series.A,
        'B': Series.B,
        'C': Series.C,
        'D': Series.D,
        'E': Series.E,
        'F': Series.F,
        'G': Series.G
    }[match.group('series')]

    return SimpleAlgebra(series, int(match.group('rank')))
예제 #5
0
    def setUp(self):
        self.a1 = SimpleAlgebra(Series.A, 1)
        self.a2 = SimpleAlgebra(Series.A, 2)
        self.a9 = SimpleAlgebra(Series.A, 9)
        self.c7 = SimpleAlgebra(Series.C, 7)
        self.e7 = SimpleAlgebra(Series.E, 7)
        self.g2 = SimpleAlgebra(Series.G, 2)

        self.algebras = [self.a1, self.a2, self.a9, self.c7, self.e7, self.g2]
        self.algebra = SemisimpleAlgebra(self.algebras)
예제 #6
0
from basisgen.algebras import Series, SimpleAlgebra, SemisimpleAlgebra
from basisgen.representations import Irrep
from basisgen.weights import Weight

lorentz_algebra = SemisimpleAlgebra(
    [SimpleAlgebra(Series.A, 1),
     SimpleAlgebra(Series.A, 1)])


def lorentz_irrep(n, m):
    return Irrep(lorentz_algebra, Weight([round(2 * n), round(2 * m)]))


scalar = lorentz_irrep(0, 0)
L_spinor = lorentz_irrep(1 / 2, 0)
R_spinor = lorentz_irrep(0, 1 / 2)
vector = lorentz_irrep(1 / 2, 1 / 2)
L_tensor = lorentz_irrep(1, 0)
R_tensor = lorentz_irrep(0, 1)
예제 #7
0
    def test_algebras(self):
        self.assertEqual(parse_algebra('A1'), SimpleAlgebra(Series.A, 1))

        self.assertEqual(parse_algebra('E7'), SimpleAlgebra(Series.E, 7))

        self.assertEqual(parse_algebra('D123'), SimpleAlgebra(Series.D, 123))

        self.assertEqual(parse_algebra('Sp8'), SimpleAlgebra(Series.C, 4))

        self.assertEqual(
            parse_algebra('SO4 x SU3 x SU2'),
            SemisimpleAlgebra([
                SimpleAlgebra(Series.A, 1),
                SimpleAlgebra(Series.A, 1),
                SimpleAlgebra(Series.A, 2),
                SimpleAlgebra(Series.A, 1)
            ]))

        self.assertEqual(
            parse_algebra(' A3+ F4+B23 +  A3  '),
            SemisimpleAlgebra([
                SimpleAlgebra(Series.A, 3),
                SimpleAlgebra(Series.F, 4),
                SimpleAlgebra(Series.B, 23),
                SimpleAlgebra(Series.A, 3)
            ]))
예제 #8
0
    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))
예제 #9
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)