Psi Matrix

Dense and sparse builders for subsystem/environment matrices together with the cache-format heuristic used by entanglement calculations.

Subsystem/environment matrix builders and cache-format helpers.

edlgt.entanglement.psi_matrix.build_psi_matrix(psi, subsys_config_index, env_config_index, subsys_dim, env_dim)[source]

Build the dense subsystem/environment matrix of a state vector.

edlgt.entanglement.psi_matrix.build_sparse_psi_matrix(psi, subsys_config_index, env_config_index, subsys_dim, env_dim)[source]

Build a CSR subsystem/environment matrix directly from index maps.

edlgt.entanglement.psi_matrix.should_cache_psi_matrix_as_sparse(subsys_dim, env_dim, nnz, size_thresh, density_thresh)[source]

Decide whether a subsystem/environment matrix should be cached as CSR.