Eigen-vector/value Statistics (quanguru.QuantumToolbox.eigenVecVal)#

Contains functions to calculate eigen-vector/value statistics in various cases.

Functions#

_eigs(Mat)

Calculates eigenvalues and eigenvectors of a given matrix (intended for internal use).

_eigStat(Mat[, symp])

Calculates all the amplitudes |c_{i,k}|^{2} of entries |k\rangle := \begin{bmatrix} c_{1,k} \\ \vdots \\ c_{i,k} \\ \vdots \\c_{\mathcal{D},k} \end{bmatrix}_{\mathcal{D}\times 1} for all the eigenvectors \{|k\rangle\} of a given matrix.

_eigStatEig(EigVecs[, symp])

Calculates all the amplitudes |c_{i,k}|^{2} of entries |k\rangle := \begin{bmatrix} c_{1,k} \\ \vdots \\ c_{i,k} \\ \vdots \\c_{\mathcal{D},k} \end{bmatrix}_{\mathcal{D}\times 1} for a given list of eigenvectors \{|k\rangle\}.

_eigStatSymp(Mat)

Intended for internal use, and used in eigenvector statistics calculation of symplectic class.

_eigsStatEigSymp(EigVecs)

Intended for internal use, and used in eigenvector statistics calculation of symplectic class.

eigVecStatKet(basis, ket[, symp])

Calculates component amplitudes |c_{i,k}|^{2} of a ket |k\rangle := \sum_{i}c_{i,k}|i\rangle in a basis \{|i\rangle\}.

Function Name

Docstrings

Examples

Unit Tests

Tutorials

_eigs

      ✅

    ❌

    ❌

    ❌

_eigStat

      ✅

    ❌

    ❌

    ❌

_eigStatSymp

      ✅

    ❌

    ❌

    ❌

_eigStatEig

      ✅

    ❌

    ❌

    ❌

_eigsStatEigSymp

      ✅

    ❌

    ❌

    ❌

eigVecStatKet

      ✅

    ✅

    ❌

    ❌

_eigs(Mat: Union[scipy.sparse._base.spmatrix, numpy.ndarray]) tuple[source]#

Calculates eigenvalues and eigenvectors of a given matrix (intended for internal use).

Parameters

Mat (Matrix) – a matrix

Returns

tuple containing (eigenvalues, eigenvectors)

Return type

tuple

Examples

# TODO

_eigStat(Mat: Union[scipy.sparse._base.spmatrix, numpy.ndarray], symp: bool = False) List[float][source]#

Calculates all the amplitudes |c_{i,k}|^{2} of entries |k\rangle := \begin{bmatrix} c_{1,k}
\\ \vdots \\
c_{i,k}
\\ \vdots \\c_{\mathcal{D},k}
\end{bmatrix}_{\mathcal{D}\times 1} for all the eigenvectors \{|k\rangle\} of a given matrix.

symp is used to calculate eigenvector statistics of systems with degeneracies, corresponding to symplectic class by summing every odd entry amplitude with the following even entry amplitude.

Parameters
  • Mat (Matrix) – a matrix

  • symp (bool, optional) – If True (False) sum every odd entry amplitude with the following even entry amplitude.

Returns

list of entry amplitudes

Return type

floatList

Examples

# TODO

_eigStatSymp(Mat: Union[scipy.sparse._base.spmatrix, numpy.ndarray]) List[float][source]#

Intended for internal use, and used in eigenvector statistics calculation of symplectic class.

Parameters

Mat (Matrix) – a matrix

Returns

list of entry amplitudes

Return type

floatList

Examples

# TODO

_eigStatEig(EigVecs: Union[scipy.sparse._base.spmatrix, numpy.ndarray], symp=False) List[float][source]#

Calculates all the amplitudes |c_{i,k}|^{2} of entries |k\rangle := \begin{bmatrix} c_{1,k}
\\ \vdots \\
c_{i,k}
\\ \vdots \\c_{\mathcal{D},k}
\end{bmatrix}_{\mathcal{D}\times 1} for a given list of eigenvectors \{|k\rangle\}.

symp is used to calculate eigenvectors statistics of systems with degeneracies, corresponding to symplectic class by summing every odd entry amplitude with the following even entry amplitude.

Parameters
  • EigVecs (Matrix) – a list of ket vectors

  • symp (bool, optional) – If True (False) sum every odd entry amplitude with the following even entry amplitude.

Returns

list of entry amplitudes

Return type

floatList

Examples

# TODO

_eigsStatEigSymp(EigVecs: Union[scipy.sparse._base.spmatrix, numpy.ndarray]) List[float][source]#

Intended for internal use, and used in eigenvector statistics calculation of symplectic class.

Parameters

EigVecs (Matrix) – a list of ket vectors

Returns

list of entry amplitudes

Return type

floatList

Examples

# TODO

eigVecStatKet(basis: List[Union[scipy.sparse._base.spmatrix, numpy.ndarray]], ket: Union[scipy.sparse._base.spmatrix, numpy.ndarray], symp=True) Tuple[source]#

Calculates component amplitudes |c_{i,k}|^{2} of a ket |k\rangle := \sum_{i}c_{i,k}|i\rangle in a basis \{|i\rangle\}.

Main use is in eigenvector statistics.

Parameters
  • basis (matrixList) – a complete basis

  • ket (Matrix) – the ket state

Returns

list of component values in the basis

Return type

floatList

Examples

>>> ket = basis(2, 1)
>>> completeBasis = completeBasis(dimension=2)
>>> eigVecStatKet(basis=completeBasis, ket=ket)
[0, 1]