Basis-independent form of Pauli matrices For a system with two possible states $|e\rangle$ and $|g\rangle$, some sources refer to the Pauli matrices as,
$$
\sigma_z = |e\rangle\langle e| - |g\rangle\langle g|\\
\sigma_x = |e\rangle\langle g| + |g\rangle\langle e|\\
\sigma_y = -i|e\rangle\langle g| + i|g\rangle\langle e|
$$
Some sources present the Pauli matrices (without explicitly specifying the basis set) as,
$$
\sigma_z = \left(\begin{array}{cc}1&0\\0&-1\end{array}\right)\\
\sigma_x = \left(\begin{array}{cc}0&1\\1&0\end{array}\right)\\
\sigma_y = \left(\begin{array}{cc}0&-i\\i&0\end{array}\right)
$$
I observed that the two equation sets above tally for the basis set:
$$
|e\rangle = \left(\begin{array}{cc}1\\0\end{array}\right)\\
|g\rangle = \left(\begin{array}{cc}0\\1\end{array}\right)
$$
I would highly appreciate it if you could shed some light on the generic/basis independent form of the Pauli matrices. What form of Pauli matrices should I use for the following basis set?
$$
|e\rangle = \left(\begin{array}{cc}0\\1\end{array}\right)\\
|g\rangle = \left(\begin{array}{cc}1\\0\end{array}\right)
$$
 A: One has to distinguish between an operator and a matrix representation of the operator in particular basis. Matrix is a square table that knows nothing about a basis, whereas an operator may have different representation in different bases that is an operator may be represented by different matrices.
Pauli matrices are a fixed set of matrices used for describing two-level systems and spin-1/2. These are just fixed matrices, given by the second equation in the OP. On the other hand, spin-1/2 components or a two-level system Hamiltonian will be represented in terms of Pauli matrices differently.
If the above distinction between operators and matrices seems two abstract, let us think about wave functions and the basis vectors. In one basis we may have wave function
$$
|\psi\rangle=\begin{pmatrix}1\\0\end{pmatrix}
$$
In another basis the same wave function will be written as
$$
|\psi\rangle=\begin{pmatrix}\alpha\\\beta\end{pmatrix} =
\alpha \begin{pmatrix}1\\0\end{pmatrix} + \beta \begin{pmatrix}0\\1\end{pmatrix}
$$
is $\begin{pmatrix}1\\0\end{pmatrix}$ in the first equation different from $\begin{pmatrix}1\\0\end{pmatrix}$? Yes, these are unit vectors in different representations, but these are the same 2-by-1 matrix.
A: Set
\begin{align}
|e'\rangle & =|g\rangle=\left(\begin{array}{cc}0\\1\end{array}\right)
\tag{01a}\label{01a}\\
|g'\rangle & =|e\rangle=\left(\begin{array}{cc}1\\0\end{array}\right)
\tag{01b}\label{01b}
\end{align}
then 
\begin{align}
\sigma'_z &= |e'\rangle\langle e'| - |g'\rangle\langle g'|= |g\rangle\langle g| - |e\rangle\langle e|=-\sigma_z
\tag{02a}\label{02a} \\
\sigma'_x &= |e'\rangle\langle g'| + |g'\rangle\langle e'|= |g\rangle\langle e| + |e\rangle\langle g|=+\sigma_x
\tag{02b}\label{02b} \\
\sigma'_y & = -i|e'\rangle\langle g'| + i|g'\rangle\langle e'|= -i|g\rangle\langle e| + i|e\rangle\langle g|=-\sigma_y
\tag{02c}\label{02c}
\end{align}
