Example #1
0
    def __init__(self, i, j):
        il = lorentz_key(i) if (i < 0) else i
        jl = lorentz_key(j) if (j < 0) else j
        array = [
            tensor([
                tensor([1], None),
                tensor([0], None),
                tensor([0], None),
                tensor([0], None)
            ], jl),
            tensor([
                tensor([0], None),
                tensor([-1], None),
                tensor([0], None),
                tensor([0], None)
            ], jl),
            tensor([
                tensor([0], None),
                tensor([0], None),
                tensor([-1], None),
                tensor([0], None)
            ], jl),
            tensor([
                tensor([0], None),
                tensor([0], None),
                tensor([0], None),
                tensor([-1], None)
            ], jl)
        ]

        super(Metric, self).__init__(array, il)
Example #2
0
    def __init__(self,i,j):
        il = lorentz_key(i) if (i<0) else i
        jl = lorentz_key(j) if (j<0) else j
        array = [tensor([tensor([ 1], None), tensor([ 0], None), tensor([ 0], None), tensor([ 0], None)], jl),
                 tensor([tensor([ 0], None), tensor([-1], None), tensor([ 0], None), tensor([ 0], None)], jl),
                 tensor([tensor([ 0], None), tensor([ 0], None), tensor([-1], None), tensor([ 0], None)], jl),
                 tensor([tensor([ 0], None), tensor([ 0], None), tensor([ 0], None), tensor([-1], None)], jl)]

        super(Metric,self).__init__(array,il)
Example #3
0
    def __init__(self,i,j,k,l):

        perms = list(permutations([0,1,2,3]))
        
        il = lorentz_key(i) if (i<0) else i
        jl = lorentz_key(j) if (j<0) else j
        kl = lorentz_key(k) if (k<0) else k
        ll = lorentz_key(l) if (l<0) else l
        tmp = new(il, 4,{jl:4,kl:4,ll:4})

        for perm in perms:
            tmp.__setitem__({il:perm[0], jl:perm[1], kl:perm[2], ll:perm[3]}, 
                            tensor([parity(list(perm))], None))
        
        super(Epsilon,self).__init__(tmp._array, tmp._toplevel_key)
Example #4
0
 def __init__(self, mu, i, j):
     mul = lorentz_key(mu) if (mu<0) else mu
     array = [gamma_0(i,j),
              gamma_1(i,j),
              gamma_2(i,j),
              gamma_3(i,j),]
     
     super(Gamma,self).__init__(array, mul)
Example #5
0
    def __init__(self, mu, i, j):
        mul = lorentz_key(mu) if (mu < 0) else mu
        array = [
            gamma_0(i, j),
            gamma_1(i, j),
            gamma_2(i, j),
            gamma_3(i, j),
        ]

        super(Gamma, self).__init__(array, mul)
Example #6
0
    def __init__(self, i, j, k, l):

        perms = list(permutations([0, 1, 2, 3]))

        il = lorentz_key(i) if (i < 0) else i
        jl = lorentz_key(j) if (j < 0) else j
        kl = lorentz_key(k) if (k < 0) else k
        ll = lorentz_key(l) if (l < 0) else l
        tmp = new(il, 4, {jl: 4, kl: 4, ll: 4})

        for perm in perms:
            tmp.__setitem__(
                {
                    il: perm[0],
                    jl: perm[1],
                    kl: perm[2],
                    ll: perm[3]
                }, tensor([parity(list(perm))], None))

        super(Epsilon, self).__init__(tmp._array, tmp._toplevel_key)
Example #7
0
    def __init__(self,i,n):
        # our inde scheme starts at 0, so subtract 1 from n
        # when naming the momenta
        k = n-1
        il = lorentz_key(i) if (i<0) else i
        p_str = "p{0}[{1}]"
        array = [tensor([c_variable(p_str.format(k,vect_gauge_dict[0]))], None), 
                 tensor([c_variable(p_str.format(k,vect_gauge_dict[1]))], None), 
                 tensor([c_variable(p_str.format(k,vect_gauge_dict[2]))], None), 
                 tensor([c_variable(p_str.format(k,vect_gauge_dict[3]))], None)]

        super(P,self).__init__(array,il)
Example #8
0
    def __init__(self, i, n):
        # our inde scheme starts at 0, so subtract 1 from n
        # when naming the momenta
        k = n - 1
        il = lorentz_key(i) if (i < 0) else i
        p_str = "p{0}[{1}]"
        array = [
            tensor([c_variable(p_str.format(k, vect_gauge_dict[0]))], None),
            tensor([c_variable(p_str.format(k, vect_gauge_dict[1]))], None),
            tensor([c_variable(p_str.format(k, vect_gauge_dict[2]))], None),
            tensor([c_variable(p_str.format(k, vect_gauge_dict[3]))], None)
        ]

        super(P, self).__init__(array, il)
Example #9
0
    def __init__(self, i, n):
        # our inde scheme starts at 0, so subtract 1 from n
        # when naming the momenta
        k = n - 1
        il = lorentz_key(i) if (i < 0) else i
        p_str = "p{0}{1}"
        array = [
            tensor([parse_expr(p_str.format(k, 0))], None),
            tensor([parse_expr(p_str.format(k, 1))], None),
            tensor([parse_expr(p_str.format(k, 2))], None),
            tensor([parse_expr(p_str.format(k, 3))], None)
        ]

        super(P, self).__init__(array, il)
Example #10
0
        test *= int(anticomm[{
            'mu': ind,
            'nu': ind,
            'i': i,
            'j': i
        }]._array[0] == -2)
for i in range(4):
    test *= int(anticomm[{'mu': 0, 'nu': 0, 'i': i, 'j': i}]._array[0] == 2)
require(test, "Dirac matrix anticommutator")

vector = tensor([
    tensor([2], None),
    tensor([0], None),
    tensor([0], None),
    tensor([2], None)
], lorentz_key('mu_5'))
vector2 = tensor([
    tensor([2], None),
    tensor([0], None),
    tensor([0], None),
    tensor([2], None)
], lorentz_key('mu_5'))
require(((vector * vector2)._array[0] == 0), "Mass")

vector = tensor([
    tensor([2], None),
    tensor([0], None),
    tensor([0], None),
    tensor([2], None)
], lorentz_key('mu_5'))
vector2 = tensor([