Search found 436 matches

by Johannes
08 Jan 2019, 13:49
Forum: HowTos and FAQ for TeNPy
Topic: the truncation in dmrg
Replies: 5
Views: 7353

Re: the truncation in dmrg

What's even more worrying is that the expectation values of say "Sz" are also changing :!: However, it's not a bug of TenPy, but there is a simple explanation for this behaviour :roll: The problem is that the ground state is degenerate (up to a finite size gap below the precision). You cho...
by Johannes
18 Dec 2018, 16:37
Forum: HowTos and FAQ for TeNPy
Topic: Unit cell with different types of sites
Replies: 4
Views: 5971

Re: Unit cell with different types of sites

This is actually a common problem that makes very much sense is comes from the fact that DMRG optimizes locally (just two sites at once) and the special initial state - product states are very special, having no entanglement at all... People often say that DMRG is "stuck in a local minima"...
by Johannes
05 Dec 2018, 17:33
Forum: Algorithms
Topic: Infinite DMRG state prediction
Replies: 2
Views: 14967

Re: Infinite DMRG state prediction

Hi Jason, Welcome to the forum :) very good question! In TeNPy, this is a bit hidden. Actually, the "state prediction" is in the line 103 of the toycode: theta0 = np.reshape(self.psi.get_theta2(i), [Heff.shape[0]]) # initial guess This line gets the "initial guess" for the ground...
by Johannes
21 Nov 2018, 20:45
Forum: HowTos and FAQ for TeNPy
Topic: Unit cell with different types of sites
Replies: 4
Views: 5971

Re: Unit cell with different types of sites

That's a very good question, thanks for asking! Each of the different Site classes get their own instance of the ChargeInfo class, but all the sites involved into one tensor network (e.g. a MPS or MPO) need to have the same ChargeInfo. When you don't conserve the boson number, both sites agree by sa...
by Johannes
19 Nov 2018, 09:07
Forum: Implementations
Topic: Multi-Site Expectation Value
Replies: 6
Views: 24642

Re: Multi-Site Expectation Value

thank you very much, I've now included these new MPS methods into the master branch.
by Johannes
13 Nov 2018, 15:08
Forum: Implementations
Topic: Multi-Site Expectation Value
Replies: 6
Views: 24642

Re: Multi-Site Expectation Value

Thanks! This function does more than just inserting Jordan wigner strings: it maps a representation of a term in the form [('N', 1), ('C', 5), ('Cd', 3)] into a form having operators on each site for some range, ['N', 'Id', 'JW Cd', 'JW', 'C'] . Some minor issues: I think it should be for j in range...
by Johannes
08 Nov 2018, 20:08
Forum: HowTos and FAQ for TeNPy
Topic: Ground state search in subspace with definite charge
Replies: 1
Views: 4548

Re: Ground state search in subspace with definite charge

Welcome :) The Mixer is designed in such a way that it preserves the symmetries of the Hamiltonian. Basically, it takes the state, calculates the reduced density matrix and applies H to it, and adds this to the original state with a small amplitude. In particular, if you turn on charge conservation ...
by Johannes
05 Nov 2018, 22:01
Forum: HowTos and FAQ for TeNPy
Topic: Extracting matrix elements of exp(-dt*H_bond)
Replies: 5
Views: 8395

Re: Extracting matrix elements of exp(-dt*H_bond)

Sorry for not getting back directly... 1) The idea is to gradually decrease the time step to reach convergence as quickly as possible. Thanks for pointing out the missing documentation, I've just updated it. There's a subtle thing that even when using a second or fourth order Trotter decomposition i...
by Johannes
05 Nov 2018, 19:52
Forum: Implementations
Topic: Lattice design issue
Replies: 4
Views: 19600

Re: Lattice design issue

I've updated the main repository with quite some changes in the models, so let me comment on this once more. Making the jungle of classes even worse, I've added two more classes: a common base Model and the CouplingMPOModel . Moreover, I've update most of the models in TeNPy to use this new Coupling...
by Johannes
25 Oct 2018, 19:45
Forum: HowTos and FAQ for TeNPy
Topic: Extracting matrix elements of exp(-dt*H_bond)
Replies: 5
Views: 8395

Re: Extracting matrix elements of exp(-dt*H_bond)

Yes, I understood that, so probably I wasn't clear enough. Let me try again by writing code: U_bond = eng._U[0][i] # this is the np_conserved Array representing exp(-dt* H_bond) on bond (i-1, i) U_bond[0, 0, 0, 0] # the entry corresponding to spin up on each site U_bond_np = U_bond.to_ndarray() # co...
by Johannes
25 Oct 2018, 08:28
Forum: HowTos and FAQ for TeNPy
Topic: Extracting matrix elements of exp(-dt*H_bond)
Replies: 5
Views: 8395

Re: Extracting matrix elements of exp(-dt*H_bond)

You can just directly read out the coefficients of an np_conserved Array A in the same way as for a numpy Array, for example A[0, 1] will give you a float, if A is a matrix with 2 indices. Even slices are supported, e.g. for A[:, 2] the result will be a np_conserved Array of dimension 1. If you pref...
by Johannes
19 Oct 2018, 15:09
Forum: Implementations
Topic: Multi-Site Expectation Value
Replies: 6
Views: 24642

Re: Multi-Site Expectation Value

It takes multiple onsite operators acting on n neighboring sites. To do that with MPS.expecation_value(), you need to generate a full n-site operator before by Hand, which becomes impossible for n > 15. This function contracts in a different order than the MPS.expectation_value(), so it stays "...
by Johannes
18 Oct 2018, 09:05
Forum: HowTos and FAQ for TeNPy
Topic: Implementing 'new' models
Replies: 7
Views: 10278

Re: Implementing 'new' models

It seemed not to be that hard after all, following your suggestions. That's what I hoped :) ... and the results completely disagree with those I got from the simple iTEBD code for the preceding ref. ... And that shouldn't happen :? Do you need to truncate strongly? Is there symmetry breaking? Or a ...
by Johannes
17 Oct 2018, 08:04
Forum: HowTos and FAQ for TeNPy
Topic: Implementing 'new' models
Replies: 7
Views: 10278

Re: Implementing 'new' models

Oh oh :o But there's a simple solution: update your TeNPy source to the newest version with a git pull (and if necessary, compile the np_conserved parts again). Since we are still in the 0.XX version numbers, I allowed myself to do a few backwards incompatible change(s). Moving the "bc" ke...
by Johannes
16 Oct 2018, 16:21
Forum: HowTos and FAQ for TeNPy
Topic: Implementing 'new' models
Replies: 7
Views: 10278

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: 10278

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: 34836

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: 26875

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: 23986

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: 34836

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: 34836

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: 23986

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: 19600

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: 19600

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: 23095

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...