Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ with MPSKit. For example, to install the package with support for SU(N) symmetri
pkg> add TensorKit
```

Finally, several pre-defined operators, hamiltonians and statistical mechanics models are available in [MPSKitModels.jl](https://github.com/QuantumKitHub/MPSKitModels.jl). It is recommended to install this package too.
Finally, several pre-defined operators, Hamiltonians and statistical mechanics models are available in [MPSKitModels.jl](https://github.com/QuantumKitHub/MPSKitModels.jl). It is recommended to install this package too.

```julia-repl
pkg> add MPSKitModels
Expand All @@ -72,7 +72,7 @@ pkg> add MPSKitModels
## Quickstart

After following the installation process, it should now be possible to load the packages and
start simulating. For example, to obtain the groundstate of the 1D Ising model, we can use
start simulating. For example, to obtain the ground state of the 1D Ising model, we can use
the following code:

```julia
Expand Down
10 changes: 5 additions & 5 deletions docs/src/examples/quantum1d/1.ising-cft/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using MPSKit, MPSKitModels, TensorKit, Plots, KrylovKit
using LinearAlgebra: eigvals, diagm, Hermitian
````

The hamiltonian is defined on a finite lattice with periodic boundary conditions,
The Hamiltonian is defined on a finite lattice with periodic boundary conditions,
which can be implemented as follows:

````julia
Expand Down Expand Up @@ -45,8 +45,8 @@ H = periodic_boundary_conditions(transverse_field_ising(), L)
## Exact diagonalisation

In MPSKit, there is support for exact diagonalisation by leveraging the fact that applying
the hamiltonian to an untruncated MPS will result in an effective hamiltonian on the center
site which implements the action of the entire hamiltonian. Thus, optimizing the middle
the Hamiltonian to an untruncated MPS will result in an effective Hamiltonian on the center
site which implements the action of the entire Hamiltonian. Thus, optimizing the middle
tensor is equivalent to optimixing a state in the entire Hilbert space, as all other tensors
are just unitary matrices that mix the basis.

Expand Down Expand Up @@ -90,7 +90,7 @@ end
O_shift (generic function with 1 method)
````

We can then calculate the momentum of the groundstate as the expectation value of this
We can then calculate the momentum of the ground state as the expectation value of this
operator. However, there is a subtlety because of the degeneracies in the energy
eigenvalues. The eigensolver will find an orthonormal basis within each energy subspace, but
this basis is not necessarily a basis of eigenstates of the translation operator. In order
Expand Down Expand Up @@ -225,7 +225,7 @@ D = 64

````

Excitations on top of the groundstate can be found through the use of the quasiparticle
Excitations on top of the ground state can be found through the use of the quasiparticle
ansatz. This returns quasiparticle states, which can be converted to regular `FiniteMPS`
objects.

Expand Down
8 changes: 4 additions & 4 deletions docs/src/examples/quantum1d/2.haldane/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ To follow the tutorial you need the following packages:
using MPSKit, MPSKitModels, TensorKit, Plots, Polynomials
````

The Heisenberg model is defined by the following hamiltonian:
The Heisenberg model is defined by the following Hamiltonian:

```math
H = -J∑_{⟨i,j⟩} (X_i X_j + Y_i Y_j + Z_i Z_j)
```

This hamiltonian has an SU(2) symmetry, which we can enforce by using SU(2)-symmetric tensors:
This Hamiltonian has an SU(2) symmetry, which we can enforce by using SU(2)-symmetric tensors:

````julia
symmetry = SU2Irrep
Expand All @@ -36,7 +36,7 @@ J = 1
## Finite size extrapolation

We can start the analysis using finite-size methods.
The groundstate of this model can be approximated using finite MPS through the use of DMRG.
The ground state of this model can be approximated using finite MPS through the use of DMRG.

The typical way to find excited states is to minimize the energy while adding an error term
$$λ \left|gs\right> \left< gs\right|$$
Expand Down Expand Up @@ -120,7 +120,7 @@ plot!(p_size_extrapolation, x -> f(x); label = "fit")
A much nicer way of obtaining the Haldane gap is by working directly in the thermodynamic limit.
As was already hinted at by the edge modes, this model is in a non-trivial SPT phase.
Thus, care must be taken when selecting the symmetry sectors.
The groundstate has half-integer edge modes, thus the virtual spaces must also all carry half-integer charges.
The ground state has half-integer edge modes, thus the virtual spaces must also all carry half-integer charges.

In contrast with the finite size case, we now should specify a momentum label to the excitations.
This way, it is possible to scan the dispersion relation over the entire momentum space.
Expand Down
21 changes: 10 additions & 11 deletions docs/src/examples/quantum1d/3.ising-dqpt/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ In this tutorial we will try to reproduce the results from
using MPSKit, MPSKitModels, TensorKit
````

Dynamical quantum phase transitions (DQPT in short) are signatures of equilibrium phase transitions in a dynamical quantity - the loschmidth echo.
Dynamical quantum phase transitions (DQPT in short) are signatures of equilibrium phase transitions in a dynamical quantity - the Loschmidt echo.
This quantity is given by ``L(t) = \frac{-2}{N} ln(| < \psi(t) | \psi(0) > |) `` where ``N`` is the system size.
One typically starts from a groundstate and then quenches the hamiltonian to a different point.
Non analycities in the loschmidth echo are called 'dynamical quantum phase transitions'.
One typically starts from a ground state and then quenches the Hamiltonian to a different point.
Non analycities in the Loschmidt echo are called 'dynamical quantum phase transitions'.

In the mentioned paper they work with

Expand All @@ -27,9 +27,9 @@ In the mentioned paper they work with
and show that divergences occur when quenching across the critical point (g₀ → g₁) for ``t^*_n = t^*(n+\frac{1}{2})`` with ``t^* = \pi/e(g_1,k^*)``, ``cos(k^*) = (1+g_0 g_1) / (g_0 + g_1)``, `` e(g,k) = \sqrt{(g-cos k)^2 + sin^2 k}``.

The outline of the tutorial is as follows. We will pick ``g₀ = 0.5``, ``g₁ = 2.0``, and perform the time evolution at different system sizes and compare with the thermodynamic limit.
For those ``g`` we expect non-analicities to occur at ``t_n ≈ 2.35 (n + 1/2)``.
For those ``g`` we expect non-analyticities to occur at ``t_n ≈ 2.35 (n + 1/2)``.

First we construct the hamiltonian in mpo form, and obtain the pre-quenched groundstate:
First we construct the Hamiltonian in MPO form, and obtain the pre-quenched ground state:

````julia
L = 20
Expand Down Expand Up @@ -67,7 +67,7 @@ dt = 0.01
ψₜ, envs = timestep(ψₜ, H₁, 0, dt, TDVP2(; trscheme = truncrank(20)));
````

"envs" is a kind of cache object that keeps track of all environments in `ψ`. It is often advantageous to re-use the environment, so that mpskit doesn't need to recalculate everything.
"envs" is a kind of cache object that keeps track of all environments in `ψ`. It is often advantageous to re-use the environment, so that MPSKit doesn't need to recalculate everything.

Putting it all together, we get

Expand Down Expand Up @@ -102,7 +102,7 @@ finite_sim (generic function with 1 method)

## Infinite MPS quenching

Similarly we could start with an initial infinite state and find the pre-quench groundstate:
Similarly we could start with an initial infinite state and find the pre-quench ground state:

````julia
ψ₀ = InfiniteMPS([ℂ^2], [ℂ^10])
Expand Down Expand Up @@ -133,16 +133,15 @@ dot(ψ₀, ψ₀)
1.000000000000001 - 2.1950801504054652e-16im
````

so the loschmidth echo takes on the pleasant form
so the Loschmidt echo takes on the pleasant form

````julia
echo(ψ₀::InfiniteMPS, ψₜ::InfiniteMPS) = -2 * log(abs(dot(ψ₀, ψₜ)))
@assert isapprox(echo(ψ₀, ψ₀), 0, atol = 1.0e-10)
````

This time we cannot use a two-site scheme to grow the bond dimension, as this isn't implemented (yet).
Instead, we have to make use of the changebonds machinery.
Multiple algorithms are available, but we will only focus on `OptimalEpand()`.
We make use of the `changebonds` machinery to grow the bond dimension. This can also be achieved through a two-site scheme.
Multiple algorithms are available, but we will only focus on `OptimalExpand()`.
Growing the bond dimension by ``5`` can be done by calling:

````julia
Expand Down
8 changes: 4 additions & 4 deletions docs/src/examples/quantum1d/3.ising-dqpt/main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
{
"cell_type": "markdown",
"source": [
"Dynamical quantum phase transitions (DQPT in short) are signatures of equilibrium phase transitions in a dynamical quantity - the loschmidth echo.\n",
"Dynamical quantum phase transitions (DQPT in short) are signatures of equilibrium phase transitions in a dynamical quantity - the Loschmidt echo.\n",
"This quantity is given by $L(t) = \\frac{-2}{N} ln(| < \\psi(t) | \\psi(0) > |) $ where $N$ is the system size.\n",
"One typically starts from a groundstate and then quenches the hamiltonian to a different point.\n",
"Non analycities in the loschmidth echo are called 'dynamical quantum phase transitions'.\n",
"Non analycities in the Loschmidt echo are called 'dynamical quantum phase transitions'.\n",
"\n",
"In the mentioned paper they work with\n",
"\n",
Expand All @@ -34,7 +34,7 @@
"and show that divergences occur when quenching across the critical point (g₀ → g₁) for $t^*_n = t^*(n+\\frac{1}{2})$ with $t^* = \\pi/e(g_1,k^*)$, $cos(k^*) = (1+g_0 g_1) / (g_0 + g_1)$, $ e(g,k) = \\sqrt{(g-cos k)^2 + sin^2 k}$.\n",
"\n",
"The outline of the tutorial is as follows. We will pick $g₀ = 0.5$, $g₁ = 2.0$, and perform the time evolution at different system sizes and compare with the thermodynamic limit.\n",
"For those $g$ we expect non-analicities to occur at $t_n ≈ 2.35 (n + 1/2)$.\n",
"For those $g$ we expect non-analyticities to occur at $t_n ≈ 2.35 (n + 1/2)$.\n",
"\n",
"First we construct the hamiltonian in mpo form, and obtain the pre-quenched groundstate:"
],
Expand Down Expand Up @@ -174,7 +174,7 @@
{
"cell_type": "markdown",
"source": [
"so the loschmidth echo takes on the pleasant form"
"so the Loschmidt echo takes on the pleasant form"
],
"metadata": {}
},
Expand Down
18 changes: 9 additions & 9 deletions docs/src/examples/quantum1d/4.xxz-heisenberg/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using MPSKit, MPSKitModels, TensorKit, Plots

## Failure

First we should define the hamiltonian we want to work with.
First we should define the Hamiltonian we want to work with.
Then we specify an initial guess, which we then further optimize.
Working directly in the thermodynamic limit, this is achieved as follows:

Expand All @@ -33,7 +33,7 @@ single site InfiniteMPOHamiltonian{MPSKit.JordanMPOTensor{ComplexF64, TensorKit.

````

We then need an intial state, which we shall later optimize. In this example we work directly in the thermodynamic limit.
We then need an initial state, which we shall later optimize. In this example we work directly in the thermodynamic limit.

````julia
state = InfiniteMPS(2, 20)
Expand All @@ -48,7 +48,7 @@ single site InfiniteMPS:

````

The groundstate can then be found by calling `find_groundstate`.
The ground state can then be found by calling `find_groundstate`.

````julia
groundstate, cache, delta = find_groundstate(state, H, VUMPS());
Expand Down Expand Up @@ -261,7 +261,7 @@ groundstate, cache, delta = find_groundstate(state, H, VUMPS());
````

As you can see, VUMPS struggles to converge.
On it's own, that is already quite curious.
On its own, that is already quite curious.
Maybe we can do better using another algorithm, such as gradient descent.

````julia
Expand Down Expand Up @@ -309,9 +309,9 @@ state = InfiniteMPS(fill(2, 2), fill(20, 2))

````

In MPSKit, we require that the periodicity of the hamiltonian equals that of the state it is applied to.
This is not a big obstacle, you can simply repeat the original hamiltonian.
Alternatively, the hamiltonian can be constructed directly on a two-site unitcell by making use of MPSKitModels.jl's `@mpoham`.
In MPSKit, we require that the periodicity of the Hamiltonian equals that of the state it is applied to.
This is not a big obstacle, you can simply repeat the original Hamiltonian.
Alternatively, the Hamiltonian can be constructed directly on a two-site unit cell by making use of MPSKitModels.jl's `@mpoham`.

````julia
# H2 = repeat(H, 2); -- copies the one-site version
Expand Down Expand Up @@ -450,9 +450,9 @@ It are precisely those problems that we can solve by using symmetries.

## Symmetries

The XXZ Heisenberg hamiltonian is SU(2) symmetric and we can exploit this to greatly speed up the simulation.
The XXZ Heisenberg Hamiltonian is SU(2) symmetric and we can exploit this to greatly speed up the simulation.

It is cumbersome to construct symmetric hamiltonians, but luckily su(2) symmetric XXZ is already implemented:
It is cumbersome to construct symmetric Hamiltonians, but luckily SU(2) symmetric XXZ is already implemented:

````julia
H2 = heisenberg_XXX(ComplexF64, SU2Irrep, InfiniteChain(2); spin = 1 // 2);
Expand Down
14 changes: 7 additions & 7 deletions docs/src/examples/quantum1d/5.haldane-spt/index.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/src/examples/quantum1d/6.hubbard/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const U = 3.0
3.0
````

For this case, the groundstate energy has an analytic solution, which can be used to benchmark the numerical results.
For this case, the ground state energy has an analytic solution, which can be used to benchmark the numerical results.
It follows from Eq. (6.82) in []().

```math
Expand Down
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ println("<mps|𝕀₃|mps> = $N2")
```

Finally, the MPS can be optimized in order to determine groundstates of given Hamiltonians.
Using the pre-defined models in `MPSKitModels`, we can construct the groundstate for the
Using the pre-defined models in `MPSKitModels`, we can construct the ground state for the
transverse field Ising model:

```@example finitemps
Expand Down Expand Up @@ -177,7 +177,7 @@ println("<mps|𝕀₁|mps> = $N2")

Finally, the MPS can be optimized in order to determine groundstates of given Hamiltonians.
There are plenty of pre-defined models in `MPSKitModels`, but we can also manually construct
the groundstate for the transverse field Ising model:
the ground state for the transverse field Ising model:

```@example infinitemps
J = 1.0
Expand Down
10 changes: 5 additions & 5 deletions docs/src/man/algorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ If a particular algorithm is missing, feel free to let us know via an issue, or

## Groundstates

One of the most prominent use-cases of MPS is to obtain the groundstate of a given (quasi-) one-dimensional quantum Hamiltonian.
One of the most prominent use-cases of MPS is to obtain the ground state of a given (quasi-) one-dimensional quantum Hamiltonian.
In MPSKit.jl, this can be achieved through `find_groundstate`:

```@docs; canonical=false
Expand Down Expand Up @@ -58,7 +58,7 @@ IDMRG2

### VUMPS

[`VUMPS`](@ref) is an (I)DMRG inspired algorithm that can be used to variationally find the groundstate as a Uniform (infinite) Matrix Product State.
[`VUMPS`](@ref) is an (I)DMRG inspired algorithm that can be used to variationally find the ground state as a Uniform (infinite) Matrix Product State.
In particular, a local update is followed by a re-gauging procedure that effectively replaces the entire network with the newly updated tensor.
Compared to IDMRG, this often achieves a higher rate of convergence, since updates are felt throughout the system immediately.
Nevertheless, this algorithm only works whenever the state is injective, i.e. there is a unique ground state.
Expand Down Expand Up @@ -206,7 +206,7 @@ QuasiparticleAnsatz

### Finite excitations

For finite systems we can also do something else - find the groundstate of the hamiltonian +
For finite systems we can also do something else - find the ground state of the Hamiltonian +
``\\text{weight} \sum_i | \\psi_i ⟩ ⟨ \\psi_i ``. This is also supported by calling

```@example excitations
Expand Down Expand Up @@ -358,8 +358,8 @@ Jeckelmann

### fidelity susceptibility

The fidelity susceptibility measures how much the groundstate changes when tuning a
parameter in your hamiltonian. Divergences occur at phase transitions, making it a valuable
The fidelity susceptibility measures how much the ground state changes when tuning a
parameter in your Hamiltonian. Divergences occur at phase transitions, making it a valuable
measure when no order parameter is known.

```@docs; canonical=false
Expand Down
6 changes: 3 additions & 3 deletions docs/src/man/environments.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# [Environments](@id um_environments)

In many tensor network algorithms we encounter partially contracted tensor networks.
In DMRG for example, one needs to know the sum of all the hamiltonian contributions left and right of the site that we want to optimize.
If you then optimize the neighboring site to the right, you only need to add one new contribution to the previous sum of hamiltonian contributions.
In DMRG for example, one needs to know the sum of all the Hamiltonian contributions left and right of the site that we want to optimize.
If you then optimize the neighboring site to the right, you only need to add one new contribution to the previous sum of Hamiltonian contributions.

This kind of information is stored in the environment objects.
The goal is that the user should preferably never have to deal with these objects, but being aware of the inner workings may allow you to write more efficient code.
That is why they are nonetheless included in the manual.

## Finite Environments

When you create a state and a hamiltonian:
When you create a state and a Hamiltonian:

```julia
state = FiniteMPS(rand, ComplexF64, 20, ℂ^2, ℂ^10);
Expand Down
2 changes: 1 addition & 1 deletion docs/src/man/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ follows:
```

Finally, the definition of a MPO tensor, which is used to represent statistical mechanics
problems as well as quantum hamiltonians, is represented as:
problems as well as quantum Hamiltonians, is represented as:

```@raw html
<img src="../../assets/mpo_tensor_definition.png" alt="convention MPOTensor" class="color-invertible"/>
Expand Down
10 changes: 5 additions & 5 deletions examples/quantum1d/1.ising-cft/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using MPSKit, MPSKitModels, TensorKit, Plots, KrylovKit
using LinearAlgebra: eigvals, diagm, Hermitian

md"""
The hamiltonian is defined on a finite lattice with periodic boundary conditions,
The Hamiltonian is defined on a finite lattice with periodic boundary conditions,
which can be implemented as follows:
"""

Expand All @@ -21,8 +21,8 @@ md"""
## Exact diagonalisation

In MPSKit, there is support for exact diagonalisation by leveraging the fact that applying
the hamiltonian to an untruncated MPS will result in an effective hamiltonian on the center
site which implements the action of the entire hamiltonian. Thus, optimizing the middle
the Hamiltonian to an untruncated MPS will result in an effective Hamiltonian on the center
site which implements the action of the entire Hamiltonian. Thus, optimizing the middle
tensor is equivalent to optimixing a state in the entire Hilbert space, as all other tensors
are just unitary matrices that mix the basis.
"""
Expand Down Expand Up @@ -60,7 +60,7 @@ function O_shift(L)
end

md"""
We can then calculate the momentum of the groundstate as the expectation value of this
We can then calculate the momentum of the ground state as the expectation value of this
operator. However, there is a subtlety because of the degeneracies in the energy
eigenvalues. The eigensolver will find an orthonormal basis within each energy subspace, but
this basis is not necessarily a basis of eigenstates of the translation operator. In order
Expand Down Expand Up @@ -125,7 +125,7 @@ D = 64
ψ, envs, δ = find_groundstate(FiniteMPS(L_mps, ℂ^2, ℂ^D), H_mps, DMRG());

md"""
Excitations on top of the groundstate can be found through the use of the quasiparticle
Excitations on top of the ground state can be found through the use of the quasiparticle
ansatz. This returns quasiparticle states, which can be converted to regular `FiniteMPS`
objects.
"""
Expand Down
Loading
Loading