Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# sympy.physics.mgamma

All Samples(16)  |  Call(14)  |  Derive(0)  |  Import(2)
```Returns a Dirac gamma matrix gamma^mu in the standard
(Dirac) representation.

If you want gamma_mu, use gamma(mu, True).

We use a convention:

gamma^5 = I * gamma^0 * gamma^1 * gamma^2 * gamma^3
gamma_5 = I * gamma_0 * gamma_1 * gamma_2 * gamma_3 = - gamma^5
(more...)
```

```        def mgamma(mu,lower=False):
"""Returns a Dirac gamma matrix gamma^mu in the standard
(Dirac) representation.

If you want gamma_mu, use gamma(mu, True).

We use a convention:

gamma^5 = I * gamma^0 * gamma^1 * gamma^2 * gamma^3
gamma_5 = I * gamma_0 * gamma_1 * gamma_2 * gamma_3 = - gamma^5

http://en.wikipedia.org/wiki/Gamma_matrices

"""
if not mu in [0,1,2,3,5]:
raise IndexError("Invalid Dirac index")
if mu == 0:
mat = (
(1,0,0,0),
(0,1,0,0),
(0,0,-1,0),
(0,0,0,-1)
)
elif mu == 1:
mat = (
(0,0,0,1),
(0,0,1,0),
(0,-1,0,0),
(-1,0,0,0)
)
elif mu == 2:
mat = (
(0,0,0,-I),
(0,0,I,0),
(0,I,0,0),
(-I,0,0,0)
)
elif mu == 3:
mat = (
(0,0,1,0),
(0,0,0,-1),
(-1,0,0,0),
(0,1,0,0)
)
elif mu == 5:
mat = (
(0,0,1,0),
(0,0,0,1),
(1,0,0,0),
(0,1,0,0)
)
m= Matrix(mat)
if lower:
if mu in [1,2,3,5]:
m = - m
return m
```

```    ones, sqrt, pprint, simplify, Eq, sympify

from sympy.physics import msigma, mgamma

#gamma^mu
gamma0 = mgamma(0)
gamma1 = mgamma(1)
gamma2 = mgamma(2)
gamma3 = mgamma(3)
```

```    ones, sqrt, pprint, simplify, trim, Eq, sympify