Add CI Workflow + Entanglement utilities #8
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes Overview
bipartite_spectrum
andsingle_site_spectrum
contained within new module calledAnalysis
for all MPS analysis related functions.bipartite_spectrum
andsingle_site_spectrum
expand_label_index
function to fix issue of normalising MPS after extracting the label index when number of classes > 1 (wasn't normalized before).Details
bipartite_spectrum
takes in atrainedMPS
type, slices classes if necessary and compute the bipartite entanglement entropy spectrum (BEE vs bond location) on each class MPS.bipartite_spectrum
takes in atrainedMPS
type, slices classes if necessary and compute the single-site entanglement entropy spectrum (SEE vs site location) on each class MPS.Added some helper functions for
bipartite_spectrum
andsingle_site_spectrum
:rho_correct
which clamps small negative eigenvalues in the reduced density matrix eigendecomposition (which can occur due to numerical precision issues).von_neumann_entropy
which computes the Von Neumann entropy on the Schmidt decomposition of the MPS at a given cut location for the BEE.one_site_rdm
which computes the single site reduced density matrix (rdm) at a given site by first placing the MPS into canonical form with the orthogonality centre at the site of interest, then tracing over all other sites.single_site_entropy
: computes the entropy of the reduced density matrix as -tr(