GenGellMann: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Clarified identity matrix |
||
| Line 6: | Line 6: | ||
|upd=December 18, 2013 | |upd=December 18, 2013 | ||
|v=0.50}} | |v=0.50}} | ||
<tt>'''GenGellMann'''</tt> is a [[List of functions|function]] that produces generalized Gell-Mann matrices. That is, it produces Hermitian matrices that form a traceless orthogonal basis for the space of $d \times d$ complex matrices. | <tt>'''GenGellMann'''</tt> is a [[List of functions|function]] that produces generalized Gell-Mann matrices. That is, it produces Hermitian matrices that form a traceless orthogonal basis for the space of $d \times d$ complex matrices, together with the identity matrix. | ||
==Syntax== | ==Syntax== | ||
| Line 13: | Line 13: | ||
==Argument descriptions== | ==Argument descriptions== | ||
* <tt>IND1</tt> and <tt>IND2</tt>: Integers between <tt>0</tt> and <tt>DIM-1</tt>, inclusive. If <tt>IND1 == IND2</tt> then <tt>G</tt> will be diagonal. If <tt>IND1 < IND2</tt> then <tt>G</tt> will be real and have exactly 2 nonzero entries. If <tt>IND1 > IND2</tt> then <tt>G</tt> will be imaginary and have exactly 2 nonzero entries. | * <tt>IND1</tt> and <tt>IND2</tt>: Integers between <tt>0</tt> and <tt>DIM-1</tt>, inclusive. If <tt>IND1 == IND2</tt> then <tt>G</tt> will be diagonal (if both indices equal 0 then <tt>G</tt> will be the identity matrix, otherwise <tt>G</tt> will be traceless). If <tt>IND1 < IND2</tt> then <tt>G</tt> will be real and have exactly 2 nonzero entries. If <tt>IND1 > IND2</tt> then <tt>G</tt> will be imaginary and have exactly 2 nonzero entries. | ||
* <tt>DIM</tt>: The size of the output matrix. | * <tt>DIM</tt>: The size of the output matrix. | ||
* <tt>SP</tt> (optional, default 0): A flag (either 1 or 0) indicating that the generalized Gell-Mann matrix produced should or should not be sparse. | * <tt>SP</tt> (optional, default 0): A flag (either 1 or 0) indicating that the generalized Gell-Mann matrix produced should or should not be sparse. | ||
Latest revision as of 15:50, 8 April 2025
| GenGellMann | |
| Produces a generalized Gell-Mann operator | |
| Other toolboxes required | none |
|---|---|
| Related functions | GellMann GenPauli Pauli |
| Function category | Special states, vectors, and operators |
GenGellMann is a function that produces generalized Gell-Mann matrices. That is, it produces Hermitian matrices that form a traceless orthogonal basis for the space of $d \times d$ complex matrices, together with the identity matrix.
Syntax
- G = GenGellMann(IND1,IND2,DIM)
- G = GenGellMann(IND1,IND2,DIM,SP)
Argument descriptions
- IND1 and IND2: Integers between 0 and DIM-1, inclusive. If IND1 == IND2 then G will be diagonal (if both indices equal 0 then G will be the identity matrix, otherwise G will be traceless). If IND1 < IND2 then G will be real and have exactly 2 nonzero entries. If IND1 > IND2 then G will be imaginary and have exactly 2 nonzero entries.
- DIM: The size of the output matrix.
- SP (optional, default 0): A flag (either 1 or 0) indicating that the generalized Gell-Mann matrix produced should or should not be sparse.
Examples
Gives the Pauli operators when DIM = 2
>> GenGellMann(0,0,2) % identity
ans =
1 0
0 1
>> GenGellMann(0,1,2) % Pauli X
ans =
0 1
1 0
>> GenGellMann(1,0,2) % Pauli Y
ans =
0.0000 + 0.0000i 0.0000 - 1.0000i
0.0000 + 1.0000i 0.0000 + 0.0000i
>> GenGellMann(1,1,2) % Pauli Z
ans =
1 0
0 -1Gives the Gell-Mann operators when DIM = 3
>> GenGellMann(0,1,3)
ans =
0 1 0
1 0 0
0 0 0
>> GenGellMann(0,2,3)
ans =
0 0 1
0 0 0
1 0 0
>> GenGellMann(2,2,3)
ans =
0.5774 0 0
0 0.5774 0
0 0 -1.1547In Higher Dimensions
Generalized Gell-Mann matrices can be generated in arbitrary dimensions. It is recommended that you set SP = 1 if DIM is large in order to save memory.
>> GenGellMann(2,3,4)
ans =
0 0 0 0
0 0 0 0
0 0 0 1
0 0 1 0
>> GenGellMann(205,34,500,1) % a 500-by-500 sparse generalized Gell-Mann matrix
ans =
(206,35) 0.0000 + 1.0000i
(35,206) 0.0000 - 1.0000iSource code
Click here to view this function's source code on github.
External links
- Generalizations of the Pauli matrices at Wikipedia