Search found 422 matches

by Johannes
11 Feb 2021, 00:57
Forum: HowTos and FAQ for TeNPy
Topic: Excited states using tenpy
Replies: 13
Views: 8459

Re: Excited states using tenpy

I've update the model userguide to inclue a new section on this.

by Johannes
11 Feb 2021, 00:33
Forum: HowTos and FAQ for TeNPy
Topic: Two component Bose-Hubbard model
Replies: 4
Views: 5397

Re: Two component Bose-Hubbard model

Your code looks right. I would have done it basically the same way :) In the newest version of TeNPy, tenpy.networks.site.multi_sites_combine_charges is deprecated in favor of tenpy.networks.site.set_common_charges , you should call it with set_common_charges([siteA, siteB], 'independent') . This sh...
by Johannes
10 Feb 2021, 19:23
Forum: HowTos and FAQ for TeNPy
Topic: Excited states using tenpy
Replies: 13
Views: 8459

Re: Excited states using tenpy

Yes, any strength given to add_onsite, add_coupling, or add_multi_coupling can be an array, as documented in these functions.
Thus also Jv, is allowed to be a numpy array. The shape it needs to have depend on the boundary conditions and shape of your lattice.

by Johannes
09 Feb 2021, 22:00
Forum: HowTos and FAQ for TeNPy
Topic: Excited states using tenpy
Replies: 13
Views: 8459

Re: Excited states using tenpy

the line states = dmrg_params['orthogonal_to'] = [] creates a new list and assigns it to both the variable name states and dmrg_params['orthogonal_to'] . Remember, in Python everything is an "object", and your variables really are just references to objects. Inside the loop, you first crea...
by Johannes
05 Feb 2021, 18:33
Forum: HowTos and FAQ for TeNPy
Topic: TDVP run time issue
Replies: 3
Views: 2670

Re: TDVP run time issue

1) How did you try to install TeNPy? It looks like it's using a version installed with `pip` into the local home directory. Can you try to pip uninstall physics-tenpy and then try to re-install TeNPy? Moreover, the svd_gesvd hints that you're using a very old version of scipy? What python are you us...
by Johannes
05 Feb 2021, 17:23
Forum: HowTos and FAQ for TeNPy
Topic: Excited states using tenpy
Replies: 13
Views: 8459

Re: Excited states using tenpy

1) That was intentional, you need a new copy each time in the loop! After all, you want to have a list of 3 different states in the end. You might at most argue that it's a bad idea to "restart" the whole DMRG from scratch for the excited states, if we already found a ground state. But the...
by Johannes
05 Feb 2021, 03:17
Forum: HowTos and FAQ for TeNPy
Topic: How to define a infiniteT MPS under canonical ensemble
Replies: 3
Views: 2519

Re: How to define a infiniteT MPS under canonical ensemble

This wasn't implemented yet in TeNPy , as you have probably seen by the ToDo entry. However, since today, it is: 64cd7a3a690e80b2876fce48e79675f060b52ab7 ;) The function from_infiniteT_canonical gives you an initial density matrix with fixed particle number on the physical sector, i.e. the canonical...
by Johannes
04 Feb 2021, 22:37
Forum: About the forum
Topic: Forum rules
Replies: 0
Views: 67989

Forum rules

Welcome! This forum is meant to be a community place for both the users and developers of the Tensor Network Python (TeNPy) package. The source code of this package is available on github . The official documentation (generated from the latest source code) has also a user-guide section with some tu...
by Johannes
04 Feb 2021, 19:37
Forum: HowTos and FAQ for TeNPy
Topic: finite open, finite periodic and infinite periodic chains
Replies: 10
Views: 9840

Re: finite open, finite periodic and infinite periodic chains

Even though the model is originially nearest-neighbor on the periodic chain, it will have longer-range interactions in the (open-boundary) MPS - with default ordering, there is one interaction going from site 0 to site L-1, or if you use the "folded" order, most of the originally nearest-n...
by Johannes
04 Feb 2021, 19:22
Forum: HowTos and FAQ for TeNPy
Topic: Warning Cons_N and Cons_Sz unused
Replies: 2
Views: 2010

Re: Warning Cons_N and Cons_Sz unused

That's why the warning is there - to help you spot typos :)
by Johannes
04 Feb 2021, 19:22
Forum: HowTos and FAQ for TeNPy
Topic: Modified Fermi-Hubbard model
Replies: 3
Views: 3098

Re: Modified Fermi-Hubbard model

Well, TEBD is nice because it is conceptually very simple - you just use a Suzuki-Trotter decomposition and straight forward iterations of (apply two site gate; compress & split to get back to MPS form). Grouping sites makes things more costly, however - formally TEBD scales as \mathcal{O}(\chi^...
by Johannes
04 Feb 2021, 03:17
Forum: HowTos and FAQ for TeNPy
Topic: Create a hump-like density profile in Fermi-Hubbard model
Replies: 1
Views: 2879

Re: Create a hump-like density profile in Fermi-Hubbard model

First of all, let me clarify: Do you want some uniform "background density" and then some more particles in the center? Or do you only want particles in the center? For 1): If you don't enforce charge conservation, DMRG is "allowed" to switch to another charge sector, even if you...
by Johannes
04 Feb 2021, 02:49
Forum: HowTos and FAQ for TeNPy
Topic: Excited states using tenpy
Replies: 13
Views: 8459

Re: Excited states using tenpy

you need to make a loop and run DMRG multiple times, each time orthogonalizing against the previous state: psi0 = MPS.from_product_state(...) states = dmrg_params['orthogonal_to'] = [] for i in range(3): psi = psi0.copy() results = dmrg.run(psi, M, dmrg_params) states.append(psi) # this also adds th...
by Johannes
04 Feb 2021, 01:30
Forum: HowTos and FAQ for TeNPy
Topic: Entanglement_entropy for finite ladder
Replies: 2
Views: 2633

Re: Entanglement_entropy for finite ladder

Let's look at the example Ladder image: https://tenpy.readthedocs.io/en/latest/reference/tenpy-models-lattice-Ladder-1.png The MPS follows the red dashed line 0 - 1 - 2 -3 -4 -5- ... When you cut the MPS at the bond between 3 and 4, it will split the system in regions left = {0, 1, 2, 3} and right={...
by Johannes
04 Feb 2021, 01:11
Forum: HowTos and FAQ for TeNPy
Topic: Modified Fermi-Hubbard model
Replies: 3
Views: 3098

Re: Modified Fermi-Hubbard model

If you have at most next-nearest neighbor interactions in a 1D chain, you can group sites and then perform TEBD. In general, I'd recommend to switch to another time evolution algorithm, though: either TDVP or the tenpy.algorithms.mpo_evolution.ExpMPOEvolution can deal with longer range. The latter e...
by Johannes
04 Feb 2021, 01:06
Forum: HowTos and FAQ for TeNPy
Topic: DMRG with fixed bond dimension
Replies: 2
Views: 1947

Re: DMRG with fixed bond dimension

Welcome, Rike!

chi_min can only avoid reducing the bond dimension, not increase it further.
In addition to setting chi_min to the same value as chi_max, you should set svd_min to 0.
by Johannes
04 Feb 2021, 00:36
Forum: HowTos and FAQ for TeNPy
Topic: How to obtain full spectrum of given Model?
Replies: 1
Views: 2415

Re: How to obtain full spectrum of given Model?

Clearly, you can only do this for small system sizes, where you can also do a full exact diagonalization. DMRG really is not a good algorithm at finding excited states, as I explained in the earlier posting You should just use exact diagonalization to find (all) the excited states, and then convert ...
by Johannes
04 Feb 2021, 00:03
Forum: HowTos and FAQ for TeNPy
Topic: Basis for a fermion chain
Replies: 1
Views: 1504

Re: Basis for a fermion chain

I'm not sure what exactly you mean with "occupation-number-representation basis". You have a local basis of occupations, e.g. for spin-less fermions just |0\rangle, |1\rangle> = c^\dagger |0\rangle , or for spin-full fermions |0\rangle , |\uparrow\rangle \equiv c^\dagger_\uparrow|0\rangle,...
by Johannes
03 Feb 2021, 23:44
Forum: HowTos and FAQ for TeNPy
Topic: Relation between bond energies and total expected value of energy of MPS
Replies: 1
Views: 2178

Re: Relation between bond energies and total expected value of energy of MPS

You tried to find *all* possible eigenstates, right? Really, DMRG is not good at finding highly excited states - that's not what it is designed for ;) What fails is not the calculation of the energy, but the trick of finding excited eigenstates with an algorithm (DMRG) looking for the ground state. ...
by Johannes
02 Dec 2020, 21:00
Forum: HowTos and FAQ for TeNPy
Topic: Symmetries Of lattice
Replies: 10
Views: 6732

Re: Symmetries Of lattice

Sorry for the late reply; your post was displayed on another page that I didn't see. To see how you can use Sz conservation, take a look at the implementation of the tenpy.models.xxz_chain.XXZChain2 The lines self.add_coupling(Jxx * 0.5, u1, 'Sp', u2, 'Sm', dx, plus_hc=True) self.add_coupling(Jz, u1...
by Johannes
01 Dec 2020, 09:36
Forum: HowTos and FAQ for TeNPy
Topic: Entanglement spectrum by charge (specifically for iDMRG)
Replies: 4
Views: 3934

Re: Entanglement spectrum by charge (specifically for iDMRG)

Wow, I'm even mentioned in the acknowledgement :)

Thanks for coming back on this! It's great to see what people can do with TeNPy.
I've right away updated the list of papers citing TeNPy, your paper is now included 8-)
by Johannes
26 Nov 2020, 11:38
Forum: HowTos and FAQ for TeNPy
Topic: Initial CAT state
Replies: 5
Views: 5864

Re: Initial CAT state

Given that you talked about charges, I'll assume that you try to conserve the total Sz spin. In this case, the all-up state and the Neel state are in completely different sectors, and you can not add them up in a single MPS! Instead, you can and should run DMRG independently in each of these sectors...
by Johannes
26 Nov 2020, 10:44
Forum: HowTos and FAQ for TeNPy
Topic: Initial CAT state
Replies: 5
Views: 5864

Re: Initial CAT state

There is a reason that MPS.add doesn't support adding states of infinite MPS: usually, you really want to avoid writing infinte MPS cat states. I would advice against using it as an initial state for iDMRG... If you do that, you just try to find two ground states at the same time. DMRG should at som...
by Johannes
26 Nov 2020, 07:37
Forum: HowTos and FAQ for TeNPy
Topic: Initial CAT state
Replies: 5
Views: 5864

Re: Initial CAT state

Hi Pasa, from_product_state and from_singlets call that function in the end. The source code of from_Bflat might serve as an example. The first argument really is just a list of the B tensor that make up the MPS, in the form of numpy arrays. The topic title indicates that you want to write a cat sta...
by Johannes
18 Nov 2020, 21:37
Forum: HowTos and FAQ for TeNPy
Topic: Qn on muti-sites DMRG
Replies: 3
Views: 2870

Re: Qn on muti-sites DMRG

DMRG scales with (at least) the third power of the local dimension. Using a GroupedSite forces the local dimension to 2^3 = 8, so you can expect a very significant speedup of roughly \frac{8^3}{3\cdot 2^3} when switching to separate sites. To implement it, simply use a lattice with a non-trivial uni...