Density Matrix
Helpers for diagonalizing dense or sparse reduced density matrices and for building projectors from their dominant eigenvectors.
Density-matrix helpers used by entanglement and LBO workflows.
- edlgt.entanglement.density_matrix.diagonalize_density_matrix(rho)[source]
Diagonalize a dense or sparse Hermitian density matrix.
- edlgt.entanglement.density_matrix.get_projector_for_efficient_density_matrix(rho_eigvals, rho_eigvecs, threshold)[source]
Build a projector from the dominant eigenvectors of a density matrix.
- edlgt.entanglement.density_matrix.flux_block_projector(rho, flux_sig, truncation, flux_tol=1e-09)[source]
Diagonalize a density matrix within symmetry blocks and keep dominant modes.
Used by the plaquette-block LBO: group the RDM basis rows by a conserved “signature” (for lattice gauge theories, the block’s boundary electric flux – a superselection label, so the RDM is block-diagonal in it), diagonalize each block separately, and keep the eigenmodes above a probability threshold. Because every kept eigenvector lives inside a single signature block, any operator diagonal in the signature (e.g. the boundary electric-field generators) stays diagonal after projection – so link symmetries survive the truncation.
- Parameters:
rho (
numpy.ndarrayorscipy.sparse matrix) –(D, D)Hermitian reduced density matrix (densified if sparse).flux_sig (
numpy.ndarray) –(D, L)real signatures; rows with identical signatures form one symmetry block.L = 0(no signature) puts every row in one block.truncation (
float) – Keep eigenvectors with eigenvalue (probability) strictly above this.flux_tol (
float, optional) – Quantization tolerance when grouping rows by signature.
- Returns:
proj (
numpy.ndarray) –(D, k)complex column projector, columns ordered by decreasing eigenvalue; each column is supported on a single signature block.info (
dict) – Diagnostics:kept_dim(k),subsys_dim(D),n_flux_blocks,kept_eigvals,discarded_weight(the truncation error,1 - sum(kept)), and the off-block residual ofrho(offblock_residual_abs/_rel) measuring how well the signature is conserved – it must be ~machine-eps for the block-wise eigendecomposition (anddiscarded_weight) to be exact.