Search found 422 matches

by Johannes
16 Oct 2018, 16:21
Forum: HowTos and FAQ for TeNPy
Topic: Implementing 'new' models
Replies: 7
Views: 9637

Re: Implementing 'new' models

All of tenpy (DMRG etc) uses the np_conserved module for tensors, as this is necessary for implementing symmetries. The basic idea is that the `Array` defined there has a very similar interface as numpy arrays, instead of numpy.tensordot(...) you can just use np_conserved.tensordot(...) etc. Our `Ar...
by Johannes
16 Oct 2018, 13:31
Forum: HowTos and FAQ for TeNPy
Topic: Implementing 'new' models
Replies: 7
Views: 9637

Re: Implementing 'new' models

This is exactly the place where you're supposed to ask these questions ;-) I know that the documentation of each function and class is a bit overwhelming in the beginning, and it's hard to get an overview. Some more introductory notes are in the userguide section of the tenpy documentation, for you ...
by Johannes
16 Oct 2018, 13:01
Forum: HowTos and FAQ for TeNPy
Topic: MPS that is both conserved and in a superposition
Replies: 4
Views: 34112

Re: MPS that is both conserved and in a superposition

So this is the state |0...01....1> which has a fixed, well defined particle number L//2, and can be initialized with MPS.from_product_state(). This is a highly non-uniform state, with particles only on the right half. Instead, I would highly recommend to use a more uniform initial state |1010101...>...
by Johannes
11 Oct 2018, 10:14
Forum: Implementations
Topic: MultiCouplingModel and Toric Code as example
Replies: 7
Views: 18555

Re: MultiCouplingModel and Toric Code as example

I checked explicitly, that the Hamiltonian is correct for Lx=1, Ly=3 by multipliying out the MPO matrices. I get the terms X_0 X_6 X_7 X_{11} + X_2 X_7 X_8 X_9 + X_4 X_9 X_{10} X_{11} + Z_0 Z_1 Z_2 Z_7 + Z_2 Z_3 Z_4 Z_9 + Z_0 Z_4 Z_5 Z_{11} starting in the MPS unit cell of sites 0-5, which is exactl...
by Johannes
09 Oct 2018, 22:47
Forum: HowTos and FAQ for TeNPy
Topic: About calculating the momentum for entanglement spectrum
Replies: 4
Views: 17489

Re: About calculating the momentum for entanglement spectrum

What is the value of the "ov" returned by compute_K()? Is your DMRG converged well? Do you maybe expect/have symmetry breaking? An entanglement entropy of 3.3 at some bonds is already quite large, did you choose the bond dimension large enough that you are fairly converged and have accepta...
by Johannes
09 Oct 2018, 22:34
Forum: HowTos and FAQ for TeNPy
Topic: MPS that is both conserved and in a superposition
Replies: 4
Views: 34112

Re: MPS that is both conserved and in a superposition

As a side note for future readers : The question makes more sense if you ask for doing a real-time evolution instead of DMRG. Formally, one can decompose the state as |psi> = \sum_n c_n |psi_n\rangle where |\psi_n\rangle is a state with well defined partice number n. Evolving each of theses states s...
by Johannes
09 Oct 2018, 22:15
Forum: HowTos and FAQ for TeNPy
Topic: MPS that is both conserved and in a superposition
Replies: 4
Views: 34112

Re: MPS that is both conserved and in a superposition

I'm not sure I understand what you want to do. Charge conservation can be used when your Hamiltonian commutes with the (total) particle number operator, which is the case for the usual Bose Hubbard model. In other words, the Hamiltonian is block-diagonal with a block consisting of the subspace with ...
by Johannes
02 Oct 2018, 14:50
Forum: HowTos and FAQ for TeNPy
Topic: About calculating the momentum for entanglement spectrum
Replies: 4
Views: 17489

Re: About calculating the momentum for entanglement spectrum

Thanks for pointing that out, Leon! Looks like this forum was a good idea :) I've added your reference [2] to the documentation of compute_K(), in particular the appendix in the arXiv version of the paper has some very nice figures and explanations. (It will take one night until you see it in the on...
by Johannes
01 Oct 2018, 16:40
Forum: Implementations
Topic: Lattice design issue
Replies: 4
Views: 13540

Re: Lattice design issue

In response to the pull request #10 and to continue with this thread: I completely agree that it's stupid to define each model multiple times. Using the trick above I got it down to two classes - one for a Chain derived from the NearestNeigborModel and once for generic 2D lattices (which include qua...
by Johannes
02 Sep 2018, 21:09
Forum: Implementations
Topic: Lattice design issue
Replies: 4
Views: 13540

Re: Lattice design issue

I followed your suggestions and moved the boundary conditions completely into the lattice, thanks for bringing that up! As a side remark: I still distinguish the "lattice" boundary conditions bc strictly from the bc_MPS . This is necessary since somebody might want to consider a finite MPS...
by Johannes
31 Aug 2018, 10:08
Forum: Implementations
Topic: Parallel iDMRG with mpi4py
Replies: 6
Views: 15999

Re: Parallel iDMRG with mpi4py

I dunno which version is better or of any direct comparisons :-). It could be interesting to do that, but I guess they converge equivalent. The Ueda approach reminds me on a block decimation approach like TEBD. This helps me to understand what is going on during the simulation better, e.g. it takes...
by Johannes
31 Aug 2018, 09:50
Forum: Implementations
Topic: Parallel iDMRG with mpi4py
Replies: 6
Views: 15999

Re: Parallel iDMRG with mpi4py

Am I right that one has to reload preloaded modules like numpy/scipy after setting the number of threads or is there any other way to do that? I don't think you need to reload scipy or numpy. It's still the same library, using the same underlying MKL, it's just a sinlge parameter, which can be chan...
by Johannes
30 Aug 2018, 12:43
Forum: Implementations
Topic: Parallel iDMRG with mpi4py
Replies: 6
Views: 15999

Re: Parallel iDMRG with mpi4py

Hi Mirco, I see, so they are basically the same in the limit of half as many nodes as sites. I wonder whether the full parallelization of Ueda's approach requires more or less iterations/sweeps to reach convergence. As far as I see, compared to the sweeping it needs more (two-site) updates to carry ...
by Johannes
29 Aug 2018, 10:09
Forum: Implementations
Topic: Parallel iDMRG with mpi4py
Replies: 6
Views: 15999

Re: Parallel iDMRG with mpi4py

Hey Mirco, parallelization of DMRG is a great idea which will probably benefit many people! Using mpi4py seems a good idea to me. As you said, it's included in the intel python distribution, and also in the anaconda distribution - these two are the recommended ones in the installation instructions, ...
by Johannes
29 Aug 2018, 09:15
Forum: HowTos and FAQ for TeNPy
Topic: Different coupling terms on different sites
Replies: 5
Views: 10208

Re: Different coupling terms on different sites

As we are contracting the entire MPS to calculate for energy, is my understanding correct in saying that it does not matter which site we choose in this case? Yes, that's correct! Based on what I understand, iDMRG can still be calculated for such a system but the only way to obtain the energy is di...
by Johannes
28 Aug 2018, 15:50
Forum: HowTos and FAQ for TeNPy
Topic: Different coupling terms on different sites
Replies: 5
Views: 10208

Re: Different coupling terms on different sites

Taking the energy as returned by the DMRG code is a perfectly reasonable thing ;-) And it's what I would recommend you for now. In general, you could still try to get the energy from local expectation values and/or correlation functions, but you would need to carefully figure all the terms out and s...
by Johannes
27 Aug 2018, 15:04
Forum: Implementations
Topic: Lattice design issue
Replies: 4
Views: 13540

Re: Lattice design issue

On one hand I agree that this would be very cool to have an single "TFIModel" with some specified nearest neighbor couplings. On the other hand, I see some problems with that: When you only want to derive the Model from the MPOModel, this approach is fine, but what if you want to derive fr...
by Johannes
27 Aug 2018, 13:11
Forum: Implementations
Topic: MultiCouplingModel and Toric Code as example
Replies: 7
Views: 18555

Re: MultiCouplingModel and Toric Code as example

ok, which initial state and parameters are you using? Mixer enabled? I checked with the following code import numpy as np from tenpy.models.toric_code import ToricCode from tenpy.networks.mps import MPS from tenpy.algorithms import dmrg for Lx in [1, 2, 3, 4]: print("="*80) print("Lx ...
by Johannes
27 Aug 2018, 11:22
Forum: Implementations
Topic: MultiCouplingModel and Toric Code as example
Replies: 7
Views: 18555

Re: MultiCouplingModel and Toric Code as example

You're right, L_x is just the number of "rings" of the cylinder included into the MPS unit cell. I agree that the energy per site shouldn't depend on L_x, so it's a bad sign if it does, there's probably something wrong then :(
by Johannes
27 Aug 2018, 11:18
Forum: HowTos and FAQ for TeNPy
Topic: Different coupling terms on different sites
Replies: 5
Views: 10208

Re: Different coupling terms on different sites

To answer first in general (That's the perfect place to ask this ;-)): If you give the strength parameter to add_coupling , it is tiled to the "correct" size of the couplings. You are right, for onsite terms in add_onsite , this is simply the Ls of the lattice. Now what is the "correc...
by Johannes
23 Aug 2018, 15:56
Forum: Implementations
Topic: MultiCouplingModel and Toric Code as example
Replies: 7
Views: 18555

MultiCouplingModel and Toric Code as example

Since I've recently added the MultiCouplingModel , it's time to add a simple model actually using it. I think the exactly solvable toric code is a good example, so here is my implementation: """Kitaev's exactly solvable toric code model. As we put the model on a cylinder, the name &qu...
by Johannes
22 Jul 2018, 23:16
Forum: Other News
Topic: We got a forum!
Replies: 0
Views: 14578

We got a forum!

It's a bit wired to make the announcement that I've set up this forum in this forum, but I guess that's the first thing to announce to the world once this forum is set up :D
Anyways, I'm awaiting your questions, suggestions and contributions. Happy posting!