scqubits.core.diag.esys_jax_dense#
- scqubits.core.diag.esys_jax_dense(matrix, evals_count, **kwargs)[source]#
Diagonalization based on jax’s (dense) jax.scipy.linalg.eigh function. Both evals and evecs are returned.
If available, different backends/devics (e.g., particular GPUs) can be set though jax’s interface, see https://jax.readthedocs.io/en/latest/user_guides.html
Note, that jax’s documentation is inconsistent, and eigvals and/or subset_by_index seems not to be implemented. Hence, here we calculate all the eigenvalues and eigenvectors, but then only return the requested subset.
- Parameters:
matrix – ndarray or qutip.Qobj to be diagonalized
evals_count – how many eigenvalues/vectors should be returned
kwargs – optional settings that are passed onto the diagonalization routine
- Return type:
Union
[Tuple
[ndarray
,ndarray
],Tuple
[ndarray
,QutipEigenstates
]]- Returns:
a tuple of eigenvalues and eigenvectors. Eigenvectors are Qobjs if matrix is a Qobj instance