Matrices¶
Known matrices related to physics
-
sympy.physics.matrices.
mdft
(n)[source]¶ Returns an expression of a discrete Fourier transform as a matrix multiplication. It is an n X n matrix.
References
[R422] https://en.wikipedia.org/wiki/DFT_matrix Examples
>>> from sympy.physics.matrices import mdft >>> mdft(3) Matrix([ [sqrt(3)/3, sqrt(3)/3, sqrt(3)/3], [sqrt(3)/3, sqrt(3)*exp(-2*I*pi/3)/3, sqrt(3)*exp(-4*I*pi/3)/3], [sqrt(3)/3, sqrt(3)*exp(-4*I*pi/3)/3, sqrt(3)*exp(-8*I*pi/3)/3]])
-
sympy.physics.matrices.
mgamma
(mu, lower=False)[source]¶ Returns a Dirac gamma matrix
in the standard (Dirac) representation.
If you want
, use
gamma(mu, True)
.We use a convention:
References
[R423] http://en.wikipedia.org/wiki/Gamma_matrices Examples
>>> from sympy.physics.matrices import mgamma >>> mgamma(1) Matrix([ [ 0, 0, 0, 1], [ 0, 0, 1, 0], [ 0, -1, 0, 0], [-1, 0, 0, 0]])
-
sympy.physics.matrices.
msigma
(i)[source]¶ Returns a Pauli matrix
with
References
[R424] http://en.wikipedia.org/wiki/Pauli_matrices Examples
>>> from sympy.physics.matrices import msigma >>> msigma(1) Matrix([ [0, 1], [1, 0]])
-
sympy.physics.matrices.
pat_matrix
(m, dx, dy, dz)[source]¶ Returns the Parallel Axis Theorem matrix to translate the inertia matrix a distance of
for a body of mass m.
Examples
To translate a body having a mass of 2 units a distance of 1 unit along the
-axis we get:
>>> from sympy.physics.matrices import pat_matrix >>> pat_matrix(2, 1, 0, 0) Matrix([ [0, 0, 0], [0, 2, 0], [0, 0, 2]])