qit.utils¶
Utilities¶
This module contains utility functions which do not logically fit anywhere else.
Mathematical utilities¶
|
Greatest common divisor. |
|
Least common multiple. |
|
Majorization partial order of real vectors. |
Matrix functions¶
|
Array commutator. |
|
Array anticommutator. |
|
This is how kron should work, dammit. |
|
Like kron but adding instead of multiplying. |
|
Matrix rank. |
|
Construct an orthonormal basis for the range of A using SVD |
|
Kernel of a matrix. |
|
Kernel of a superoperator matrix restricted to the Hermitian subspace. |
|
Projector corresponding to vector v. |
|
Returns eigenvalues and eigenvectors of a Hermitian matrix, sorted in nonincreasing order. |
|
Multiply a vector by an exponentiated matrix. |
Random matrices¶
Random Hermitian n*n matrix. |
|
|
Random U(n) matrix. |
|
Random SU(n) matrix. |
|
Random diagonal unitary matrix. |
|
Random n-partition of unity. |
Random n*n positive semidefinite matrix. |
|
|
Random GL(n, C) matrix. |
|
Random SL(n, C) matrix. |
Superoperators¶
|
Flattens a matrix into a vector. |
|
Reshapes a vector into a matrix. |
|
Superoperator equivalent for multiplying from the left. |
|
Superoperator equivalent for multiplying from the right. |
|
Superoperator equivalent for multiplying both from left and right. |
|
Liouvillian superoperator for a set of Lindblad operators. |
|
Fixed point states of a Liouvillian superoperator. |
Convert a Liouvillian superoperator to a Choi matrix. |
Physics¶
|
Angular momentum matrices. |
|
Bosonic ladder operators. |
|
Fermionic ladder operators. |
Bases, decompositions¶
|
Spectral decomposition of a Hermitian matrix. |
|
Gell-Mann matrices. |
|
Hermitian tensor-product basis for End(H). |
Miscellaneous¶
|
Memoization decorator for functions with immutable args, returns deep copies. |
|
Operator consisting of k-local terms, given as a list. |
|
Real dot product of a vector and a tuple of operators. |
|
Dimension vector for an all-qubit system. |
|
SU(2) rotation \(\theta_\phi\) (NMR notation). |
|
SU(2) x-rotation. |
|
SU(2) y-rotation. |
|
SU(2) z-rotation. |
|
Populates a 2D triangular surface with evenly spaced points for Delaunay triangulation. |
Functions
|
SU(2) rotation \(\theta_\phi\) (NMR notation). |
|
SU(2) x-rotation. |
|
SU(2) y-rotation. |
|
SU(2) z-rotation. |
|
Array anticommutator. |
|
Angular momentum matrices. |
|
Bosonic ladder operators. |
|
Real dot product of a vector and a tuple of operators. |
|
Array commutator. |
|
Memoization decorator for functions with immutable args, returns deep copies. |
|
Returns eigenvalues and eigenvectors of a Hermitian matrix, sorted in nonincreasing order. |
|
Multiply a vector by an exponentiated matrix. |
|
Fermionic ladder operators. |
|
Greatest common divisor. |
|
Gell-Mann matrices. |
|
Reshapes a vector into a matrix. |
|
Least common multiple. |
|
Superoperator equivalent for multiplying from the left. |
|
Superoperator equivalent for multiplying both from left and right. |
|
Majorization partial order of real vectors. |
|
This is how kron should work, dammit. |
|
Kernel of a matrix. |
|
Kernel of a superoperator matrix restricted to the Hermitian subspace. |
|
Operator consisting of k-local terms, given as a list. |
|
Construct an orthonormal basis for the range of A using SVD |
|
Projector corresponding to vector v. |
|
Dimension vector for an all-qubit system. |
|
Random GL(n, C) matrix. |
|
Random SL(n, C) matrix. |
|
Random SU(n) matrix. |
|
Random U(n) matrix. |
|
Random diagonal unitary matrix. |
Random Hermitian n*n matrix. |
|
Random n*n positive semidefinite matrix. |
|
|
Random n-partition of unity. |
|
Matrix rank. |
|
Superoperator equivalent for multiplying from the right. |
|
Spectral decomposition of a Hermitian matrix. |
|
Fixed point states of a Liouvillian superoperator. |
|
Liouvillian superoperator for a set of Lindblad operators. |
Convert a Liouvillian superoperator to a Choi matrix. |
|
|
Hermitian tensor-product basis for End(H). |
|
Like kron but adding instead of multiplying. |
|
Populates a 2D triangular surface with evenly spaced points for Delaunay triangulation. |
|
Flattens a matrix into a vector. |