Measurement
ED_sectors.entanglement_entropy
ED_sectors.expectation
ED_sectors.k_eigsys
ED_sectors.k_eigvals
ED_sectors.measure_EE
ED_sectors.reduce_density_matrix
ED_sectors.k_eigvals
— Function.k_eigvals(H,k)
Computes the k
lowest-energy eigenvalues for the given Hamiltonian H
.
This is a simple wrapper for Julia's eigs
function, which uses the Lanczos algorithm. While this works with either sparse or full matrices for H
, sparse matrices are much faster. The cost of the algorithm increases with k
and should be only used when $k \ll \operatorname{dim}(H)$. If you only need the ground state, then just use k=1
.
ED_sectors.k_eigsys
— Function.k_eigsys(H, k)
Computes the k
lowest-energy eigenvalues and eigenvectors for the given Hamiltonian H
.
ED_sectors.expectation
— Function.expectation(psi, O)
expectation_rho(rho, O)
For a state psi
, computes the expectation value $\left<\psi|O|\psi\right>$ and operator O
. This is a simple wrapper for dot(psi, O*psi)
and works for any type of matrix O
.
For a density matrix rho
, computes the expectation value $\operatorname{Tr}[\rho O]$.
ED_sectors.reduce_density_matrix
— Function.reduce_density_matrix(phi, l)
Computes the reduced density matrix for the state psi
by tracing out all but the first l
spins.
At present this only works when the basis has no symmetries. Support for reduced density matrices with symmetries is coming soon.
ED_sectors.entanglement_entropy
— Function.entanglement_entropy(psi, l; epsilon = 10e-15)
Computes the entanglement entropy $S(l/L)$ for a state psi
. Removes eigenvalues smaller than a numerical cutoff because they often give underflow errors.
This uses reduce_density_matrix
, so it only works without symmetries.
ED_sectors.measure_EE
— Function.measure_EE(psi, basis)
Computes the entanglement entropy at all cuts in a wavefunction psi
in a basis basis
.