Search found 465 matches

by Johannes
13 May 2020, 20:08
Forum: HowTos and FAQ for TeNPy
Topic: Square of MPO
Replies: 3
Views: 9499

Re: Square of MPO

I'm not sure if the error estimate of arXiv:1711.01104 could be generalized to infinite systems, that would actually be quite usefull.
by Johannes
13 May 2020, 06:53
Forum: HowTos and FAQ for TeNPy
Topic: Square of MPO
Replies: 3
Views: 9499

Re: Square of MPO

I finally took the time to implement at least the "naive" approach of contracting the network with the squared MPO for <psi| H H |psi> in the new variance . Right now it works only for finite systems - for infinite MPS, this is a whole new story, since there is no direct notion of overlaps...
by Johannes
07 May 2020, 19:41
Forum: HowTos and FAQ for TeNPy
Topic: Translationally Invariant MPS from Single Site DMRG
Replies: 4
Views: 14038

Re: Translationally Invariant MPS from Single Site DMRG

Nice workaround! I'd formulate it slightly differnt, though. If we know that there is a translationally invariant, canonical MPS, let's call it C^i_{ab} , then it is related to the MPS tensors found by DMRG via a unitary matrix U : B_0^i = U C^i \quad\text{and}\quad B_1^i = C^i U^{\dagger}. In gener...
by Johannes
07 May 2020, 06:26
Forum: HowTos and FAQ for TeNPy
Topic: entanglement_entropy_segment doubt
Replies: 13
Views: 45988

Re: entanglement_entropy_segment doubt

First of all: the segment [0, 1, 2, 3, 4, 5] is only equivalent to psi.entanglement_entropy()[6] on a finite system. In an infinite system, psi.entanglement_entropy()[6] takes region A to be [..., -4, -3, -2, -1, 0, 1, 2, 3, 4, 5], which is a single cut dividing the system into left and right halfs,...
by Johannes
06 May 2020, 02:08
Forum: HowTos and FAQ for TeNPy
Topic: Translationally Invariant MPS from Single Site DMRG
Replies: 4
Views: 14038

Re: Translationally Invariant MPS from Single Site DMRG

As long as you have more than one tensor in you MPS, they will be different, even with single site DMRG. DMRG optimizes the tensors one after another (in the "sweep"), which immediately breaks the translation invariance in the beginning. If you model is translation invariant and the ground...
by Johannes
05 May 2020, 23:26
Forum: HowTos and FAQ for TeNPy
Topic: code issue TFI2D model implementation
Replies: 1
Views: 8878

Re: code issue TFI2D model implementation

Please include at least the error message for requests like this. It seems to be just a python issue, line 31 of the code above, lattice is not defined. When adding the line from tenpy.models import lattice in the beginning, it runs fine. I presume you want to extend the TFI model and add further te...
by Johannes
05 May 2020, 22:51
Forum: HowTos and FAQ for TeNPy
Topic: Preparing state with specified particle filling
Replies: 4
Views: 12440

Re: Preparing state with specified particle filling

We allow a fractional filling n/L where n \in \mathbb{Z} is the number of particles, and L the number of sites in the MPS (or for infinite MPS: in the MPS unit cell). So a filling of 3/10 particles is "commensurate" in that sense. Incommensurate would be and average filling of an irration ...
by Johannes
05 May 2020, 22:27
Forum: HowTos and FAQ for TeNPy
Topic: entanglement_entropy_segment doubt
Replies: 13
Views: 45988

Re: entanglement_entropy_segment doubt

Read the documentation at entanglement_entropy_segment . There is another parameter first_site , where this segment starts. If you use segment=[0, 1, 2] and don't specify first_site , it will default to the segments on sites [0, 1, 2] [1, 2, 3] [2, 3, 4] ... Each of them gives you one number, result...
by Johannes
05 May 2020, 21:17
Forum: HowTos and FAQ for TeNPy
Topic: Define spin-1 Boson site
Replies: 1
Views: 9179

Re: Define spin-1 Boson site

where spin operator \mathbf{S}_i = \sum_{\sigma,\sigma'} b^\dagger_{\sigma,\sigma'} S_{\sigma,\sigma'} b_{\sigma,\sigma'} , with standard spin-1 matrice S_{\sigma,\sigma'} . I guess you meant the usual definiton S^\alpha_i = \sum_{\sigma,\sigma'} (b^\alpha_{i,\sigma})^\dagger S^\alpha_{\sigma,\sigm...
by Johannes
05 May 2020, 20:16
Forum: HowTos and FAQ for TeNPy
Topic: Question about generating random MPS
Replies: 1
Views: 10031

Re: Question about generating random MPS

This is an overflow error; the norm of the `psi` increases with each tensor added. You can observe this by using psi.canonical_form_finite(renormalize=False) and printing psi.norm of the final state. The norm blows up exponentially with the number of tensors. Trying a few normalizations, I found tha...
by Johannes
01 Apr 2020, 23:18
Forum: HowTos and FAQ for TeNPy
Topic: Excited states of effective Hamiltonian
Replies: 1
Views: 6741

Re: Excited states of effective Hamiltonian

Indeed, the guess should be very close to the actual ground state if DMRG converged well; this will lead to problems for Lanczos. Did choosing a different initial state help? You can also try to e.g. apply Sx or Sz operators on the initial guess of the ground state, if you have some idea of what the...
by Johannes
23 Mar 2020, 23:40
Forum: HowTos and FAQ for TeNPy
Topic: Adding disorders and adding a site to 1D SSH chain
Replies: 2
Views: 32929

Re: Adding disorders and adding a site to 1D SSH chain

You want to simulate it on a finite system, right? The SSH chain is just a regular chain with alternating coupling strength. Given that, I think it might be easier in this case to really use the "Chain" with a single-site unit cell instead of a Lattice with a two-site unit cell. In particu...
by Johannes
23 Mar 2020, 18:41
Forum: HowTos and FAQ for TeNPy
Topic: 2D DMRG with boundary conditions and lattice index
Replies: 2
Views: 7859

Re: 2D DMRG with boundary conditions and lattice index

(1): Looks good to me. In fact, that's code taken from CouplingMPOModel.init_lattice() for the case of a 2D lattice. (2): Yes. You might want to take a look at mps2lat_values in that case. Use it like this: exp_vals_mps = psi.expectation_value("N") exp_vals_lat = model.lat.mps2lat_values(e...
by Johannes
11 Mar 2020, 16:36
Forum: Algorithms
Topic: Kinetic energy
Replies: 3
Views: 56147

Re: Kinetic energy

I think the question aims at how to get the terms contained in the kinetic energy. Actually, there's some functionality in the tenpy.models.model.CouplingModel , which is not explicitly used in most of the pre-defined models, though, and a bit hidden in the documentation. When one calls add_coupling...
by Johannes
11 Mar 2020, 05:12
Forum: HowTos and FAQ for TeNPy
Topic: leading eigenvector of transfer matrix
Replies: 6
Views: 23836

Re: leading eigenvector of transfer matrix

You cannot/should not take the transfer matrix of a single site, if you have a two-site unit cell in your MPS. Sometimes, the charge values will not even allow you, and even if they do, it there is a different gauge on the two bonds - which can and will be the case if there are degenerate singular v...
by Johannes
11 Mar 2020, 04:10
Forum: HowTos and FAQ for TeNPy
Topic: leading eigenvector of transfer matrix
Replies: 6
Views: 23836

Re: leading eigenvector of transfer matrix

BTW, in this sense, the normalization factors of the left (to square singular value) and right eigenvector (identity) of right canonical form should cancel each other out, right? However, in a real case it seems will change the largest amplitude of the transfer matrix (the largest eigenvalue will b...
by Johannes
10 Mar 2020, 23:23
Forum: HowTos and FAQ for TeNPy
Topic: leading eigenvector of transfer matrix
Replies: 6
Views: 23836

Re: leading eigenvector of transfer matrix

It's just a matter of normalization.
Eigenvalues get normalized to np.linalg.norm(v) = 1, but in this case you want np.sum(v) = 1.

At the end of your code, add

Python: Select all

vdiag = v.diagonal()
print(vdiag/np.sum(vdiag))
print(psi.get_SL(0)**2)
and compare the results, the prints should give the same
by Johannes
05 Mar 2020, 00:02
Forum: HowTos and FAQ for TeNPy
Topic: Semi-infinite Ising chain with boundary
Replies: 1
Views: 7594

Re: Semi-infinite Ising chain with boundary

That's an excellent question! TeNPy supports 'segment' boundary conditions, which you can basically use to do that. What we had in mind for those boundary conditions is the folling: Run DMRG in an infinite system Extract or "cut out" a subsystem with a finite length from it, giving you an ...
by Johannes
07 Feb 2020, 08:18
Forum: Implementations
Topic: Readthedocs vs Github pages
Replies: 4
Views: 68915

Re: Readthedocs vs Github pages

Okay, I paid for the Gold membership of readthedocs to remove the ads (That's the drawback, it costs money. But I don't mind supporting ReadTheDocs with a few dollars a month, their service to the community is great :) ) I've also updated the references from within the TeNPy repository and the links...
by Johannes
07 Feb 2020, 06:14
Forum: HowTos and FAQ for TeNPy
Topic: Problems with modelling a fermionic ladder
Replies: 3
Views: 8717

Re: Problems with modelling a fermionic ladder

Now I face the problem that in order to see the Ising-like phase transition I want to calculate the correlation function <\Psi_0 |T^y_i T^y_{i+r} |\Psi_0> with T^y_i= \frac{1}{2}(-i c^\dagger_{i,u}c_{i,d}+i c^\dagger_{i,d}c_{i,u}) where u and d are again the rungs of the ladder. Since the Ladder ge...
by Johannes
05 Feb 2020, 08:00
Forum: HowTos and FAQ for TeNPy
Topic: How to calculate particular correlation function only between the nearest neighbors sites in my lattice?
Replies: 4
Views: 11881

Re: How to calculate particular correlation function only between the nearest neighbors sites in my lattice?

Looks good! May I ask how for an example what you calculated in the end (roughly)? It probably suffices for terms with the same operators on both sites (e.g. density-density correlations "N_i N_j"), but might not be enough for more complicated pair correlations with different operators (e....
by Johannes
05 Feb 2020, 07:50
Forum: HowTos and FAQ for TeNPy
Topic: Problems with modelling a fermionic ladder
Replies: 3
Views: 8717

Re: Problems with modelling a fermionic ladder

You got it almost right. Just a single, but crucial typo in term 1.2 (which you correctly identified as the problem): In the second line (h.c. term), you have a 0 instead of a 1 in the fourth argument. This makes the Hamiltonian non-hermitian and obviously leads to problems when running DMRG (The La...
by Johannes
01 Feb 2020, 00:11
Forum: HowTos and FAQ for TeNPy
Topic: Convergence issues in XXZ model with increasing bond dimension
Replies: 3
Views: 11306

Re: Convergence issues in XXZ model with increasing bond dimension

No, you got that wrong. A value of update_env=0 does not imply that you're not doing iDMRG; the DMRG engine will still grow the environments on the left and right by one unit cell in each sweep. A nonzero update_env > 0 tells the DMRG engine to do the specified number of environment_sweeps without d...
by Johannes
30 Jan 2020, 21:55
Forum: Implementations
Topic: Readthedocs vs Github pages
Replies: 4
Views: 68915

Re: Readthedocs vs Github pages

[mention]Leon[/mention], [mention]mpsforphysics[/mention] , [mention]JakobUnfried[/mention] do you have any preferences?
by Johannes
30 Jan 2020, 21:43
Forum: HowTos and FAQ for TeNPy
Topic: How to calculate particular correlation function only between the nearest neighbors sites in my lattice?
Replies: 4
Views: 11881

Re: How to calculate particular correlation function only between the nearest neighbors sites in my lattice?

You need to do some postprocessing, there is currently no function for that in TeNPy. However, I agree that it would be very useful to have it. If you write the function, it would be great if you could post it here such that we can include it in TeNPy (or you just submit a pull request on github). Y...