Skip to content

Commit

Permalink
Merge branch 'doc-writing' into angelariva-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
angelariva authored Nov 25, 2024
2 parents 0ad111c + 4f41325 commit 1e89842
Show file tree
Hide file tree
Showing 44 changed files with 1,154 additions and 317 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Documentation
on:
push:
branches:
- doc-writing
- master
tags: '*'
pull_request:

Expand Down
63 changes: 63 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: MPSDynamics.jl
message: >-
If you use this software, please cite it
type: software
authors:
- given-names: Angus J.
family-names: Dunnett
orcid: 'https://orcid.org/0000-0002-8579-7826'
- given-names: Thibaut
family-names: Lacroix
orcid: 'https://orcid.org/0000-0002-5190-040X'
- given-names: Angela
family-names: Riva
orcid: 'https://orcid.org/0009-0005-8509-9162'
- given-names: Brieuc
family-names: Le Dé
orcid: 'https://orcid.org/0000-0001-6004-0758'
identifiers:
- type: doi
value: 10.5281/zenodo.5106434
description: Zenodo Repository
- type: doi
value: 10.1063/5.0223107
description: J. Chem. Phys. Paper
url: 'https://github.com/shareloqs/MPSDynamics'
abstract: >-
Tensor network simulations for finite temperature, open
quantum system dynamics
license: GPL-3.0
preferred-citation:
type: article
authors:
- given-names: Thibaut
family-names: Lacroix
orcid: 'https://orcid.org/0000-0002-5190-040X'
affiliation: Institute of Theoretical Physics, Ulm University
- given-names: Brieuc
family-names: Le Dé
orcid: 'https://orcid.org/0000-0001-6004-0758'
affiliation: Sorbonne Université, CNRS, Institut des NanoSciences de Paris
- given-names: Angela
family-names: Riva
orcid: 'https://orcid.org/0009-0005-8509-9162'
affiliation: LPENS, Département de Physique, École Normale Supérieure, Centre Automatique et Systèmes (CAS), MINES ParisTech, Université PSL, Sorbonne Université, CNRS, Inria
- given-names: Angus J.
family-names: Dunnett
orcid: 'https://orcid.org/0000-0002-8579-7826'
affiliation: Multiverse Computing
- given-names: Alex W.
family-names: Chin
orcid: 'https://orcid.org/0000-0001-7741-5915'
affiliation: Sorbonne Université, CNRS, Institut des NanoSciences de Paris
doi: "10.1063/5.0223107"
journal: "The Journal of Chemical Physics"
month: 8
title: "MPSDynamics.jl: Tensor network simulations for finite-temperature (non-Markovian) open quantum system dynamics"
issue: 8
volume: 161
year: 2024
15 changes: 5 additions & 10 deletions ChainOhmT/gauss.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
using LinearAlgebra

""" GAUSS Gauss quadrature rule.
"""
gauss(N,ab)
Given a weight function w encoded by the nx2 array ab of the
first n recurrence coefficients for the associated orthogonal
polynomials, the first column of ab containing the n alpha-
coefficients and the second column the n beta-coefficients,
the call xw = GAUSS(n,ab) generates the nodes and weights xw of
the n-point Gauss quadrature rule for the weight function w.
The nodes, in increasing order, are stored in the first
column, the n corresponding weights in the second column, of
the nx2 array xw.
Gauss quadrature rule for `N` sites on an interval `ab`. Given a weight function w encoded by the `N`x2 array `ab` of the first `N` recurrence coefficients for the associated orthogonal
polynomials, the first column of `ab` containing the `N` alpha-coefficients and the second column the `N` beta-coefficients, the call xw = gauss(N,ab) generates the nodes and weights xw of the `N`-point Gauss quadrature rule for the weight function w.
The nodes, in increasing order, are stored in the first column, the n corresponding weights in the second column, of the `N`x2 array xw.
"""
function gauss(N,ab)
N0 = size(ab,1)
Expand Down
16 changes: 4 additions & 12 deletions ChainOhmT/lanczos.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
""" LANCZOS Lanczos algorithm.
"""
lanczos(N,xw)
Given the discrete inner product whose nodes are contained
in the first column, and whose weights are contained in the
second column, of the nx2 array xw, the call ab=LANCZOS(n,xw)
generates the first n recurrence coefficients ab of the
corresponding discrete orthogonal polynomials. The n alpha-
coefficients are stored in the first column, the n beta-
coefficients in the second column, of the nx2 array ab.
Given the discrete inner product whose nodes are contained in the first column, and whose weights are contained in the second column, of the `N`x2 array `xw`, the call ab=lanczos(N,xw) generates the first `N` recurrence coefficients ab of the corresponding discrete orthogonal polynomials. The `N` alpha-coefficients are stored in the first column, the `N` beta-coefficients in the second column, of the `N`x2 array ab.
The script is adapted from the routine RKPW in
W.B. Gragg and W.J. Harrod, ``The numerically stable
reconstruction of Jacobi matrices from spectral data'',
Numer. Math. 44 (1984), 317-335.
The script is adapted from the routine RKPW in W.B. Gragg and W.J. Harrod, ``The numerically stable reconstruction of Jacobi matrices from spectral data'', Numer. Math. 44 (1984), 317-335.
"""
function lanczos(N,xw) #return ab
Ncap = size(xw,1)
Expand Down
11 changes: 3 additions & 8 deletions ChainOhmT/stieltjes.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
""" STIELTJES Discretized Stieltjes procedure.
"""
stieltjes(N,xw)
Given the discrete inner product whose nodes are contained
in the first column, and whose weights are contained in the
second column, of the nx2 array xw, the call ab=STIELTJES(n,xw)
generates the first n recurrence coefficients ab of the
corresponding discrete orthogonal polynomials. The n alpha-
coefficients are stored in the first column, the n beta-
coefficients in the second column, of the nx2 array ab.
Discretized Stieltjes procedure. Given the discrete inner product whose nodes are contained in the first column, and whose weights are contained in the second column, of the `N`x2 array `xw`, the call ab=stieltjes(N,xw) generates the first `N` recurrence coefficients ab of the corresponding discrete orthogonal polynomials. The `N` alpha- coefficients are stored in the first column, the `N` beta-coefficients in the second column, of the `N`x2 array ab.
"""
function stieltjes(N,xw) #return ab
#tiny = 10*realmin
Expand Down
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MPSDynamics"
uuid = "8fc8f346-e1eb-498f-94db-02ffe92d8134"
authors = ["angus-dunnett <[email protected]>", "Thibaut Lacroix <[email protected]>"]
version = "1.0.0"
version = "1.1.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand All @@ -25,5 +25,6 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"

[compat]
ITensors = "0.6"
TensorOperations = "4.0.7"
julia = "1.7"
63 changes: 58 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# MPSDynamics.jl
*Tensor network simulations for finite temperature, open quantum system dynamics.*

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5106435.svg)](https://doi.org/10.5281/zenodo.5106435) [![license](https://img.shields.io/badge/License-GPL_3.0-orange.svg)](https://github.com/angusdunnett/MPSDynamics/blob/master/LICENSE) [![documentation workflow](https://github.com/angusdunnett/MPSDynamics/actions/workflows/docs.yml/badge.svg)](https://angusdunnett.github.io/MPSDynamics/)


[![J. Chem. Phys.](https://img.shields.io/badge/J.%20Chem.%20Phys.%20-%2010.1063%2F5.0223107%20-%20navy)](https://doi.org/10.1063/5.0223107) [![ArXiv](https://img.shields.io/badge/arXiv-2406.07052-B31B1B.svg)](https://arxiv.org/abs/2406.07052) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11400776.svg)](https://doi.org/10.5281/zenodo.11400776) [![license](https://img.shields.io/badge/License-GPL_3.0-orange.svg)](https://github.com/shareloqs/MPSDynamics/blob/master/LICENSE) [![documentation workflow](https://github.com/shareloqs/MPSDynamics/actions/workflows/docs.yml/badge.svg)](https://shareloqs.github.io/MPSDynamics/)


This package is intended to provide an easy to use interface for performing tensor network simulations on Matrix Product
Expand Down Expand Up @@ -152,16 +154,37 @@ Import["~/MPSDynamics/XXXXX/dat_XXXXX.jld",{"HDF5","Datasets","/data/sz"}]

# Publications
Publications which make use of MPSDynamics:
* Lacroix et al. Making Quantum Collision Models Exact, *arXiv e-print*, November 2024
* [https://doi.org/10.48550/arXiv.2411.13166](https://doi.org/10.48550/arXiv.2411.13166)

* Le Dé et al. Extending Non-Perturbative Simulation Techniques for Open-Quantum Systems to Excited-State Proton Transfer and Ultrafast Non-Adiabatic Dynamics, *J. Chem. Theory Comput.*, October 2024
* [https://doi.org/10.1021/acs.jctc.4c00666](https://doi.org/10.1021/acs.jctc.4c00666)

* Lambertson et al. Computing Linear Optical Spectra in the Presence of Nonadiabatic Effects on Graphics Processing Units Using Molecular Dynamics and Tensor-Network Approaches, *J. Chem. Phys.*, 161, 114101, September 2024
* [https://doi.org/10.1063/5.0224316](https://doi.org/10.1063/5.0224316)

* Lacroix et al. Connectivity Matters: Impact of Bath Modes Ordering and Geometry in Open Quantum System Simulation with Matrix Product States, *arXiv e-print*, September 2024
* [https://doi.org/10.48550/arXiv.2409.04145](https://doi.org/10.48550/arXiv.2409.04145)

* Lacroix et al. MPSDynamics.jl: Tensor network simulations for finite-temperature (non-Markovian) open quantum system dynamics, *J. Chem. Phys.*, 161, 084116, August 2024
* [https://doi.org/10.1063/5.0223107](https://doi.org/10.1063/5.0223107)

* Le Dé et al. Managing Temperature in Open Quantum Systems Strongly Coupled with Structured Environments, *J. Chem. Phys.* 160, 244102, June 2024
* [https://doi.org/10.1063/5.0214051](https://doi.org/10.1063/5.0214051)

* Hunter et al. Environmentally Driven Symmetry Breaking Quenches Dual Fluorescence in Proflavine. *J.Phys. Chem. Lett.* 15, 4623−4632, April 2024
* [https://doi.org/10.1021/acs.jpclett.4c00677](https://doi.org/10.1021/acs.jpclett.4c00677)

* Lacroix et al. From Non-Markovian Dissipation to Spatiotemporal Control of Quantum Nanodevices. *Quantum* 8, 1305, April 2024
* [https://doi.org/10.22331/q-2024-04-03-1305](https://doi.org/10.22331/q-2024-04-03-1305)

* Riva et al. Thermal cycle and polaron formation in structured bosonic environments. *Phys. Rev. B* 108(19):195138, November 2023
* [https://doi.org/10.1103/PhysRevB.108.195138](https://doi.org/10.1103/PhysRevB.108.195138)

* Lacroix et al. Unveiling non-Markovian spacetime signaling in open quantum systems with long-range tensor network dynamics. *Phys. Rev. A* 104(5):052204, November 2021
* [https://link.aps.org/doi/10.1103/PhysRevA.104.052204](https://link.aps.org/doi/10.1103/PhysRevA.104.052204)

* Dunnett et al. Influence of non-adiabatic effects on linear absorption spectra in the condensed phase: Methylene blue. *J. Chem. Phys.* 155(14):144112, October 2021

* [http://aip.scitation.org/doi/10.1063/5.0062950](http://aip.scitation.org/doi/10.1063/5.0062950)

* Dunnett and Chin. Simulating quantum vibronic dynamics at finite temperatures with many body wave functions at 0K. *Front. Chem.* 8, January 2021
Expand All @@ -179,15 +202,45 @@ Publications which make use of MPSDynamics:
* [10.5281/zenodo.4352728](https://doi.org/10.5281/zenodo.4352728)

# Citation

If you use this package in your research, please cite it:
* Dunnett, A. (2021). angusdunnett/MPSDynamics: (v1.0). Zenodo. https://doi.org/10.5281/zenodo.5106435
If you use the package in your research, please consider citing it.
You can add the Zenodo record and the software paper to your BibTex file:

```tex
@misc{mpsdynamics_zenodo,
title = {shareloqs/{MPSDynamics}: v1.1},
shorttitle = {{MPSDynamics}.jl: v1.1},
url = {https://doi.org/10.5281/zenodo.11400776},
abstract = {Tensor network simulations for finite temperature, open quantum system dynamics},
publisher = {Zenodo},
author = {Dunnett, Angus J. and Lacroix, Thibaut and Riva, Angela and Le Dé, Brieuc},
month = may,
year = {2024},
doi = {10.5281/zenodo.11400776},
}
@article{mpsdynamicsjl_2024,
title = {{MPSDynamics}.jl: {Tensor} network simulations for finite-temperature (non-{Markovian}) open quantum system dynamics},
volume = {161},
issn = {0021-9606},
shorttitle = {{MPSDynamics}.jl},
url = {https://doi.org/10.1063/5.0223107},
doi = {10.1063/5.0223107},
number = {8},
journal = {The Journal of Chemical Physics},
author = {Lacroix, Thibaut and Le Dé, Brieuc and Riva, Angela and Dunnett, Angus J. and Chin, Alex W.},
month = aug,
year = {2024},
pages = {084116},
}
```

# How to Contribute
Contributions are welcome! Don't hesitate to contact us if you
* found a bug;
* have a suggestion on how to improve the code and/or documentation;
* would like to get involved in writing code and/or documentation.

Feel free to open an [issue](https://github.com/shareloqs/MPSDynamics/issues) on Github :)

# References

Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "0.26"
Documenter = "1.4"
6 changes: 3 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ makedocs(
modules = [MPSDynamics],
highlightsig = true,
sitename = "MPSDynamics.jl",
authors = "Angus Dunnett, Thibaut Lacroix, Brieuc Le Dé, Angela Riva",
authors = "Angus J. Dunnett, Thibaut Lacroix, Brieuc Le Dé, Angela Riva",
pages = [
"index.md",
"user-guide.md",
"nutshell.md",
"Examples" => ["./examples/sbm.md", "./examples/puredephasing.md", "./examples/timedep.md", "./examples/anderson-model.md", "./examples/bath-observables.md"],
"Examples" => ["./examples/sbm.md", "./examples/puredephasing.md", "./examples/timedep.md", "./examples/anderson-model.md", "./examples/bath-observables.md", "./examples/protontransfer.md"],
"theory.md",
"Methods" => "methods.md",
"dev.md"
Expand All @@ -24,5 +24,5 @@ makedocs(
deploydocs(
repo = "github.com/shareloqs/MPSDynamics.git",
devurl = "docs",
devbranch = "doc-writing"
devbranch = "master"
)
14 changes: 0 additions & 14 deletions docs/make.jl~

This file was deleted.

12 changes: 10 additions & 2 deletions docs/src/convergence.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ In this section, we analyze the numerical accuracy of our simulations by outlini
### Chain length $N$
In numerical simulations, a truncation on the number of chain modes (and therefore the chain length) is introduced to handle a finite chain instead of a semi-infinite one. This truncation, denoted as NN, corresponds to a sampling of the modes in the original environment.

The chain length $N$ is directly connected to the simulation time as follows: excitations injected into the chain propagate as a wavefront traveling along the chain. Perturbations to the initial state outside this wavefront are exponentially suppressed. Therefore, truncating the chain basis beyond the expanding wavefront ensures that the resulting sampling error is also exponentially small.
The chain length $N$ is directly connected to the simulation time as follows: excitations injected into the chain propagate as a wavefront traveling along the chain. Perturbations to the initial state outside this wavefront are exponentially suppressed. Therefore, truncating the chain basis beyond the expanding wavefront ensures that the resulting sampling error is also exponentially small [^woods_simulating_2015][^DeVega_howto_2015].

To optimize the chain length for a given simulation time and set of chain coefficients, the following procedure can be used:

Expand All @@ -23,7 +23,8 @@ N_opt = findchainlength(T, cpars; eps=10^-4, verbose=false)
```

### Local dimension $d$
Another critical truncation is imposed on the local dimension $d$ of each tensor in the MPS that undergoes dynamic evolution. The local dimension dd corresponds to the number of Fock states retained in the Hilbert space of each chain mode. Since harmonic oscillators are, in principle, infinite-dimensional systems, truncating their Hilbert space to a finite $d$ is necessary for numerical computations. The choice of $d$ determines the maximum number of excitations per site in the MPS and must be carefully tuned to capture the relevant physics while ensuring numerical convergence.
Another critical truncation is imposed on the local dimension $d$ of each tensor in the MPS that undergoes dynamic evolution. The local dimension $d$ corresponds to the number of Fock states retained in the Hilbert space of each chain mode. Since harmonic oscillators are, in principle, infinite-dimensional systems, truncating their Hilbert space to a finite $d$ is necessary for numerical computations. The choice of $d$ determines the maximum number of excitations per site in the MPS and must be carefully tuned to capture the relevant physics while ensuring numerical convergence.
For a bath that initially contains only a finite number of particles, i.e. any bath in practice, the error originating from the local Hilbert space truncation vanishes exponentially as $d$ increases[^woods_simulating_2015].

A practical guideline for choosing $d$ can be derived by considering the physical states being simulated. For example, for coherent states, the occupation number follows a Poisson distribution. In such cases, the average occupation number is given by the mean $\langle n \rangle$, and the probability of observing a state with occupation number $n$ decreases exponentially for $n \gg \langle n \rangle$. Thus, the truncation $d$ should be chosen such that the cumulative probability of truncation error is negligible.

Expand All @@ -40,3 +41,10 @@ Below are the main time-evolution algorithms and their corresponding convergence
- Adaptive Time-Dependent Variational Principle (DTDVP):
- Selected using: `method = :DTDVP`.
- The convergence parameter is the target precision for the adaptive algorithm. Multiple precision values can be provided to test convergence: `convparams = [prec1, prec2, prec3]`
=======
###


# References
[^woods_simulating_2015]: Woods, M. P.; Cramer, M.; Plenio, M. B. Simulating Bosonic Baths with Error Bars. Phys. Rev. Lett. 2015, 115 (13), 130401. https://doi.org/10.1103/PhysRevLett.115.130401.
[^DeVega_howto_2015]: De Vega, I.; Schollwöck, U.; Wolf, F. A. How to Discretize a Quantum Bath for Real-Time Evolution. Phys. Rev. B 2015, 92 (15), 155126. https://doi.org/10.1103/PhysRevB.92.155126.
Loading

0 comments on commit 1e89842

Please sign in to comment.