Skip to content

Commit

Permalink
add new page for tools and mps-analysis related functions
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuabmoore committed Dec 23, 2024
1 parent b5b6ae1 commit 627d86c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ We provide [tutorials](https://jmoo2880.github.io/MPSTime.jl/dev/tutorial/) and
- [LATEST DOCS](https://jmoo2880.github.io/MPSTime.jl/) -- the latest documentation.

## Citation
If you use this software in your work, please read and cite the ([arXiv preprint](https://arxiv.org/abs/2412.15826)):
If you use this software in your work, please read and cite the [arXiv preprint](https://arxiv.org/abs/2412.15826):
```
@misc{MPSTime2024,
title={Using matrix-product states for time-series machine learning},
Expand Down
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ makedocs(
"Imputation" => "imputation.md",
"Synthetic Data Generation" => "synthdatagen.md",
"Encodings" => "encodings.md",
"Tools" => "Tools.md",
"Docstrings" => "docstrings.md",
"References" => "references.md",
]
Expand Down
8 changes: 0 additions & 8 deletions docs/src/docstrings.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,3 @@ MPSTime.symbolic_encoding
MPSTime.model_loss_func
MPSTime.model_bbopt
```

## Analysis
```@docs
MPSTime.von_neumann_entropy
MPSTime.rho_correct
MPSTime.bipartite_spectrum
MPSTime.single_site_spectrum
```
9 changes: 0 additions & 9 deletions docs/src/imputation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@ MPSTime supports univariate time-series imputation with three key patterns of mi
MPSTime can also handle any combination of these patterns.
For instance, you might need to impute a single contiguous block from $t = 10-30$, plus individual missing points at $t = 50$ and $t=80$.

#### Imputation Methods
We offer several options for imputing missing data points, based on how we estimate their values from the conditional probability distribution:
| __Method__ | Description | Type|
| ----------- | ----------- | ----------- |
| Mean | `:mean` |Deterministic |
| Median | `:median` |Deterministic|
| Mode | `:mode` |Deterministic|
| Inverse Transform Sampling | `:ITS` |Stochastic|

## Setup

The first step is to train an MPS (see [Tutorial](@ref)).
Expand Down
15 changes: 15 additions & 0 deletions docs/src/tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Tools


## Entanglement Entropy
What it is? What it tells us...
### Bipartite Entanglement Entropy (BEE)


### Single-Site Entanglement Entropy (SEE)

```@docs
MPSTime.von_neumann_entropy
MPSTime.bipartite_spectrum
MPSTime.single_site_spectrum
```
14 changes: 5 additions & 9 deletions src/Analysis/analyse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ end

"""
```Julia
bipartite_spectrum(mps::TrainedMPS; logfn::Function=log) -> Vector{Vector{Float64}}
```
Compute the bipartite entanglement entropy (BEE) of a trained MPS across each bond.
Given a single unlabeled MPS the BEE is defined as:
∑ α^2 log(α^2)
where α are the eigenvalues obtained from the shmidt decomposition.
```
Compute the bipartite entanglement entropy (BEE) of a trained MPS.
"""
function bipartite_spectrum(mps::TrainedMPS; logfn::Function=log)
Expand All @@ -67,12 +68,6 @@ function bipartite_spectrum(mps::TrainedMPS; logfn::Function=log)
return bees
end

"""
Check whether the reduced density matrix (rho) is positive semidefinite by
eigendecomposition.
\nIf the eigenvalue decomp of ρ yields negative but small (< tol) eigenvalues,
clamp to them to range [threshold, ∞] and reconstruct ρ.
"""
function rho_correct(rho::Matrix, eigentol::Float64=sqrt(eps()))

eigvals, eigvecs = eigen(rho) # do an eigendecomp on the rdm
Expand Down Expand Up @@ -118,8 +113,9 @@ function single_site_entropy(mps::MPS)
end

"""
single_site_spectrum(mps::TrainedMPS) -> Vector{Vector{Float64}}
```Julia
single_site_spectrum(mps::TrainedMPS) -> Vector{Vector{Float64}}
```
Compute the single-site entanglement entropy (SEE) spectrum of a trained MPS.
The single-site entanglement entropy (SEE) quantifies the entanglement at each site of the MPS. It is computed as:
Expand Down

0 comments on commit 627d86c

Please sign in to comment.