GenGellMann: Difference between revisions

From QETLAB
Jump to navigation Jump to search
Created page with "{{Function |name=GenGellMann |desc=Produces a generalized Gell-Mann operator |req=opt_args |rel=GellMann<br />GenPauli<br />Pauli |upd=December 18, 2013 |v=1.0..."
 
No edit summary
Line 2: Line 2:
|name=GenGellMann
|name=GenGellMann
|desc=Produces a generalized Gell-Mann operator
|desc=Produces a generalized Gell-Mann operator
|req=[[opt_args]]
|rel=[[GellMann]]<br />[[GenPauli]]<br />[[Pauli]]
|rel=[[GellMann]]<br />[[GenPauli]]<br />[[Pauli]]
|cat=[[List of functions#Special_states,_vectors,_and_operators|Special states, vectors, and operators]]
|upd=December 18, 2013
|upd=December 18, 2013
|v=1.00}}
|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.


Line 19: Line 19:
==Examples==
==Examples==
===Gives the Pauli operators when <tt>DIM = 2</tt>===
===Gives the Pauli operators when <tt>DIM = 2</tt>===
<pre>
<syntaxhighlight>
>> GenGellMann(0,0,2) % identity
>> GenGellMann(0,0,2) % identity


Line 47: Line 47:
     1    0
     1    0
     0    -1
     0    -1
</pre>
</syntaxhighlight>


===Gives the Gell-Mann operators when <tt>DIM = 3</tt>===
===Gives the Gell-Mann operators when <tt>DIM = 3</tt>===
<pre>
<syntaxhighlight>
>> GenGellMann(0,1,3)
>> GenGellMann(0,1,3)


Line 74: Line 74:
         0    0.5774        0
         0    0.5774        0
         0        0  -1.1547
         0        0  -1.1547
</pre>
</syntaxhighlight>


===In Higher Dimensions===
===In Higher Dimensions===
Generalized Gell-Mann matrices can be generated in arbitrary dimensions. It is recommended that you set <tt>SP = 1</tt> if <tt>DIM</tt> is large in order to save memory.
Generalized Gell-Mann matrices can be generated in arbitrary dimensions. It is recommended that you set <tt>SP = 1</tt> if <tt>DIM</tt> is large in order to save memory.
<pre>
<syntaxhighlight>
>> GenGellMann(2,3,4)
>> GenGellMann(2,3,4)


Line 94: Line 94:
  (206,35)    0.0000 + 1.0000i
  (206,35)    0.0000 + 1.0000i
   (35,206)    0.0000 - 1.0000i
   (35,206)    0.0000 - 1.0000i
</pre>
</syntaxhighlight>
 
{{SourceCode|name=GenGellMann}}


==External links==
==External links==
* [http://en.wikipedia.org/wiki/Generalizations_of_the_Pauli_matrices Generalizations of the Pauli matrices] at Wikipedia
* [http://en.wikipedia.org/wiki/Generalizations_of_the_Pauli_matrices Generalizations of the Pauli matrices] at Wikipedia

Revision as of 15:15, 29 September 2014

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.

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 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    -1

Gives 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.1547

In 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.0000i

Source code

Click here to view this function's source code on github.