Pauli Bases¶
Orthonormality condition¶
We want to represent any arbitrary :math`d`-dimensional density matrix in a form:
where \(\rho_i\) are real numbers. Any Hermitian \(d \times d\) matrix has \(d^2\) free parameters, therefore a full basis \(\left\{ \hat{P}_i \right\}\) will have \(N = d^2\) elements. We will refer to \(d\) as Hilbert dimensionality (dim_hilbert in code), and \(N\) as Pauli dimensionality (dim_pauli).
We will call Pauli basis orthonormal, if it fulfills condition:
If this is the case, inverse transformation has the form:
We operate only in orthonormal bases in Quantumsim, an attempt to create non-orthonormal basis will raise an exception.
Common bases¶
The simplest example of a Pauli basis for \(2 \times 2\) Hermitian matrices is a basis, that consists of four matrices
unit matrix and three Pauli matrices, normalized by \(\sqrt{d}\), where
\(d = 2\) is a number of dimensions.
We will refer to this basis as IXYZ basis. It can be generalized to the
arbitrary number of dimensions, if we replace Pauli matrices with generalized
Gell-Mann matrices 1. This basis can be constructed in Quantumsim with
quantumsim.bases.gell_mann()
.
Another useful choice is formed by the following set of matrices:
We will refer to this basis as 0XY1 basis. It has an advantage, that probabilities of measuring 0 and 1 correspond in it to the coefficients in front of first and last element of this basis, without the necessity to compute trace explicitly. We can generalize this basis for arbitrary number of dimensions \(d\): first we take \(d\) matrices with 1 on a diagonal, for example for \(d=3\):
and then \(d^2-d\) of \(\hat{\sigma}_x\)- and \(\hat{\sigma}_y\)-like matrices:
This basis can be constructed in Quantumsim with
quantumsim.bases.general()
and is used as a default basis in Quantumsim.
State representation in Quantumsim¶
Suppose we have a system of \(N\) qubits. Let us fix a separate basis \(\left\{ \hat{P}^{(n)} \right\}\) for each qubit. Now, the density matrix can be represented as follows:
where the sum runs over all elements of this basis. In the case of full basis \(i_n \in \left[ 1 \ldots d_n^2 \right]\), but in general we do not limit ourselves to operating in full bases: if we know from the circuit, that some basis element is not needed, we will try to throw it away in the sake of memory and speed.