Skip to content

Commit 057160e

Browse files
lkdvosleburgel
andauthored
Apply suggestions from code review
Co-authored-by: Lander Burgelman <[email protected]>
1 parent a9ac796 commit 057160e

File tree

1 file changed

+5
-5
lines changed
  • examples/quantum1d/7.xy-finiteT

1 file changed

+5
-5
lines changed

examples/quantum1d/7.xy-finiteT/main.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ md"""
4242
## Diagonalization of the Hamiltonian
4343
4444
The Hamiltonian can be diagonalized through a Bogoliubov transformation, leading to the following expression for the ground state energy
45-
The Hamiltonian can be diagonalized in terms of fermionic creation and annihilation operators.
45+
The Hamiltonian can be diagonalized in terms of fermionic creation and annihilation operators, giving
4646
4747
(TODO) Show the diagonalization of the Hamiltonian in terms of fermionic operators.
4848
@@ -69,7 +69,7 @@ H_dense = convert(TensorMap, H);
6969
vals = eigvals(H_dense)[Trivial()] ./ 6
7070
groundstate_energy(J, 6)
7171

72-
println("Exact (N=$N):\t", groundstate_energy(J, 6))
72+
println("Exact (N=6):\t", groundstate_energy(J, 6))
7373
println("Exact (N=Inf):\t", groundstate_energy(J, Inf))
7474
println("Numerical:\t", minimum(real(vals)))
7575

@@ -145,7 +145,7 @@ We can numerically compute the partition function by explicitly computing the tr
145145
To that end, we first need to build the time-evolution operator $e^{-\beta H}$, and then compute its trace.
146146
147147
In order to build the time-evolution operator, we can repurpose the `make_time_mpo` function, which constructs the time-evolution operator for the ground state.
148-
However, since we are interested in $e^{-\beta H}$, instead of $e^{-iH dt}$, we work with $d\tau = -i \beta$.
148+
However, since we are interested in $e^{-\beta H}$, instead of $e^{-iH dt}$, we work with $dt = -i \beta$.
149149
In particular, we can approximate the exponential using a Taylor series through the `TaylorCluster` algorithm.
150150
"""
151151

@@ -347,7 +347,7 @@ md"""
347347
348348
If we wish to push the results to even larger $\beta$ values, we can note that taking linear steps in $\beta$ is not the only option.
349349
To that end, we can use another trick to scan over an exponential range of $\beta$ values: [exponentiating by squaring](https://en.wikipedia.org/wiki/Exponentiation_by_squaring).
350-
In particular, we note that computing $x^n$ for integer (large) $n$ can typically be done more efficiently than computing $x * x * ... * x$.
350+
In particular, we note that computing $x^n$ for integer (large) $n$ can typically be done more efficiently than computing $x \cdot x \cdot \dots \cdot x$.
351351
To do so, we note that multiplication is associative, and regroup the factors in such a way that we can compute the result in a logarithmic number of steps.
352352
Here, we assume $n = 2^m$ for some integer $m$, and note that this could be generalized to any $n$ by decomposing $n$ into a sum of powers of $2$.
353353
Then, we can write
@@ -419,7 +419,7 @@ Finally, we can also note that the partition function is characterized by the fo
419419
\implies Z(\beta) = e^{-\beta H} \cdot Z(0)
420420
```
421421
422-
In other words, we can compute the partition function at $\beta$ by evolving the partition function at $0$ for a time $d\tau = -im \beta$.
422+
In other words, we can compute the partition function at $\beta$ by evolving the partition function at $0$ for a time $d\tau = -i \beta$.
423423
424424
The starting point for this approach could be either achieved through one of the techniques we have already discussed, but we can also start from the infinite temperature state directly.
425425
In particular, this state is given by the identity MPO, and we can evolve this state to compute the partition function at any $\beta$ value.

0 commit comments

Comments
 (0)