Pauli: Difference between revisions

From QETLAB
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 8: Line 8:
<tt>'''Pauli'''</tt> is a [[List of functions|function]] that produces the 2-by-2 Pauli X, Y, Z, or identity operator, as defined here:
<tt>'''Pauli'''</tt> is a [[List of functions|function]] that produces the 2-by-2 Pauli X, Y, Z, or identity operator, as defined here:


$X = \begin{bmatrix}0 & 1\\ 1 & 0\end{bmatrix}, Y = \begin{bmatrix}0 & -i\\ i & 0\end{bmatrix}, Z = \begin{bmatrix}1 & 0\\ 0 & -1\end{bmatrix}, I = \begin{bmatrix}1 & 0\\ 0 & 1\end{bmatrix}.$
:<math>X = \begin{bmatrix}0 & 1\\ 1 & 0\end{bmatrix}, \ \ Y = \begin{bmatrix}0 & -i\\ i & 0\end{bmatrix}, \ \ Z = \begin{bmatrix}1 & 0\\ 0 & -1\end{bmatrix}, \ \ I = \begin{bmatrix}1 & 0\\ 0 & 1\end{bmatrix}.</math>


==Syntax==
==Syntax==
Line 47: Line 47:
   0.0000 + 0.0000i  0.0000 - 1.0000i
   0.0000 + 0.0000i  0.0000 - 1.0000i
   0.0000 + 1.0000i  0.0000 + 0.0000i
   0.0000 + 1.0000i  0.0000 + 0.0000i
>> Pauli('z',1) % sparse Pauli Z operator
ans =
  (1,1)        1
  (2,2)      -1
</pre>
</pre>


==External links==
==External links==
* [http://en.wikipedia.org/wiki/Pauli_matrices Pauli matrices] at Wikipedia
* [http://en.wikipedia.org/wiki/Pauli_matrices Pauli matrices] at Wikipedia

Revision as of 19:09, 18 December 2013

Pauli
Produces a Pauli operator

Other toolboxes required opt_args
Related functions GellMann
GenPauli

Pauli is a function that produces the 2-by-2 Pauli X, Y, Z, or identity operator, as defined here:

<math>X = \begin{bmatrix}0 & 1\\ 1 & 0\end{bmatrix}, \ \ Y = \begin{bmatrix}0 & -i\\ i & 0\end{bmatrix}, \ \ Z = \begin{bmatrix}1 & 0\\ 0 & -1\end{bmatrix}, \ \ I = \begin{bmatrix}1 & 0\\ 0 & 1\end{bmatrix}.</math>

Syntax

  • P = Pauli(IND)
  • P = Pauli(IND,SP)

Argument descriptions

  • IND: An index indicating which Pauli operator you would like to be generated. Values of 1, 2, 3, and 0 correspond to the Pauli X, Y, Z, and identity operators, respectively. Values of 'x', 'y', and 'z' are also accepted, and indicate the Pauli X, Y, and Z operators, respectively.
  • SP (optional, default 0): A flag (either 1 or 0) indicating that the Pauli operator produced should or should not be sparse.

Examples

>> Pauli('x')

ans =

     0     1
     1     0

>> Pauli(1)

ans =

     0     1
     1     0

>> Pauli(0)

ans =

     1     0
     0     1

>> Pauli('y')

ans =

   0.0000 + 0.0000i   0.0000 - 1.0000i
   0.0000 + 1.0000i   0.0000 + 0.0000i

>> Pauli('z',1) % sparse Pauli Z operator

ans =

   (1,1)        1
   (2,2)       -1