sf.decompositions.covmat_to_hamil¶
-
covmat_to_hamil
(V, tol=1e-10)[source]¶ Converts a covariance matrix to a Hamiltonian.
Given a covariance matrix V of a Gaussian state \(\rho\) in the xp ordering, finds a positive matrix \(H\) such that
\[\rho = \exp(-Q^T H Q/2)/Z\]where \(Q = (x_1,\dots,x_n,p_1,\dots,p_n)\) are the canonical operators, and Z is the partition function.
For more details, see https://arxiv.org/abs/1507.01941
- Parameters
V (array) – Gaussian covariance matrix
tol (int) – the number of decimal places to use when determining if the matrix is symmetric
- Returns
positive definite Hamiltonian matrix
- Return type
array
code/api/strawberryfields.decompositions.covmat_to_hamil
Download Python script
Download Notebook
View on GitHub