Search found 422 matches

by Johannes
18 Nov 2020, 07:54
Forum: HowTos and FAQ for TeNPy
Topic: Lattice with different spins
Replies: 3
Views: 2560

Re: Lattice with different spins

Sure! just add the extra site into the unit cell. Since there are already two sites in the unit cell, it will get the unit-cell index 2, so you can specify the new added site to be [1, 1, 2] instead of [1, 1, 1] . You can do the whole process in a single step: irregular_lat = lattice.IrregularLattic...
by Johannes
08 Nov 2020, 14:20
Forum: HowTos and FAQ for TeNPy
Topic: Qn on muti-sites DMRG
Replies: 3
Views: 2807

Re: Qn on muti-sites DMRG

Let me get this straight: you initialize the state without c electrons and DMRG to keep the number of c electrons at 0, because you have no hopping terms to c (by explicitly setting t2 and t3 to 0). However, you have only two globally conserved charges: the total number of electrons, and the total s...
by Johannes
04 Nov 2020, 12:49
Forum: HowTos and FAQ for TeNPy
Topic: state overlap(probability)
Replies: 11
Views: 7887

Re: state overlap(probability)

You need to transpose at the right position, namely before you start grouping/reshaping the legs. psi.get_rho_segment([i,j]) returns a 4-leg tensor with labels ('p0', 'p1', 'p0*', 'p1*') for (ket left, ket right, bra left, bra right). Grouping the legs will give you two legs '(p0.p1)', '(p0*.p1*)' ,...
by Johannes
04 Nov 2020, 08:34
Forum: HowTos and FAQ for TeNPy
Topic: Lattice with different spins
Replies: 3
Views: 2560

Re: Lattice with different spins

The tenpy.models.lattice.IrregularLattice is doing exactly what you want. The idea is that you first generate the regular lattice (in your case a Honeycomb lattice) and then add/replace the extra site(s) for the Spin-1. If you want to conserve e.g. the total Sz, or the Sz of the spin-1/2 sites, you ...
by Johannes
02 Nov 2020, 09:48
Forum: HowTos and FAQ for TeNPy
Topic: state overlap(probability)
Replies: 11
Views: 7887

Re: state overlap(probability)

You have indices i,j, so I guess you're looking at two-site density matrices now. It works the same way, though: rho_ij = psi.get_rho_segment([i,j]) rho_ij_dense = rho_ij.transpose(['p0', 'p1', 'p0*', 'p1*']).to_ndarray() # has shape (2, 2, 2, 2) assert psi.sites[i].state_labels['up'] == 0 # ensure ...
by Johannes
26 Oct 2020, 16:59
Forum: HowTos and FAQ for TeNPy
Topic: state overlap(probability)
Replies: 11
Views: 7887

Re: state overlap(probability)

1.) rho_i.to_ndarray() , if you really want to convert to a numpy array. 2) There is not a unique such value, because the density matrix is mixed . Work it out for a 2-spin system: the probability for the second spin to be down is P(\sigma_2 = \downarrow) = \Psi_{\uparrow\downarrow}\Psi_{\uparrow\do...
by Johannes
26 Oct 2020, 09:21
Forum: HowTos and FAQ for TeNPy
Topic: state overlap(probability)
Replies: 11
Views: 7887

Re: state overlap(probability)

Sure! Basically, what you want is P(\sigma_i=\downarrow_i) = \langle \Psi | \downarrow_i\rangle \langle \downarrow_i |\Psi \rangle = Tr_{\mathcal{H}}(|\Psi\rangle \langle \Psi | \downarrow_i\rangle \langle \downarrow_i |) = Tr_{\mathcal{H}_i}(\rho_i |\downarrow_i\rangle \langle \downarrow_i |) = \la...
by Johannes
21 Oct 2020, 18:00
Forum: HowTos and FAQ for TeNPy
Topic: Symmetries Of lattice
Replies: 10
Views: 6541

Re: Symmetries Of lattice

The all-up state which you start with is an *exact* eigenstate of the Heisenberg model (both the ferro-magnetic and anti-ferromagnetic one), and indeed it's the ground state (or one of them, to be precise) for the FM J=-1 case. The reason why you still go away is a bug: you're missing the Y-Y term i...
by Johannes
21 Oct 2020, 16:01
Forum: HowTos and FAQ for TeNPy
Topic: Symmetries Of lattice
Replies: 10
Views: 6541

Re: Symmetries Of lattice

Just to make sure, you really look at the Ferromagnetic Heisenberg model, and not the transverse field Ising model, right? Why do you preserve the parity, but not Sz? To clarify: the "parity" is not the same as "spin flip symmetric". The conserved "parity" is (sum_i Z_i...
by Johannes
21 Oct 2020, 12:55
Forum: Implementations
Topic: Implementing non on-site symmetries
Replies: 3
Views: 9896

Re: Implementing non on-site symmetries

Yeah, kind of what I was expecting from what I know you've been working on...
by Johannes
21 Oct 2020, 11:11
Forum: Implementations
Topic: Implementing non on-site symmetries
Replies: 3
Views: 9896

Re: Implementing non on-site symmetries

Ugh, that's a really tough one! First of all: Is it really necessary to do the mapping from fermions to bosons, or couldn't you maybe directly implement the fermionic model instead? (I'd guess not, but just to make sure...) My first reaction definitely is "That's impossible". TeNPy's np_co...
by Johannes
20 Oct 2020, 19:13
Forum: HowTos and FAQ for TeNPy
Topic: Symmetries Of lattice
Replies: 10
Views: 6541

Re: Symmetries Of lattice

The Ground state of the ferromagnetic Heisenberg model is degenerate, and I guess that you might get different states depending on whether you turn on parity conservation. The different ground states have different entanglement. What start did you start with? It fixes the charge sector you remain in...
by Johannes
13 Oct 2020, 14:49
Forum: HowTos and FAQ for TeNPy
Topic: Symmetries Of lattice
Replies: 10
Views: 6541

Re: Symmetries Of lattice

As far as I know, exploiting translation symmetry or other symmetries of the lattice is not possible. There is only the trick which was pointed out in the source code of entanglement_entropy_segment before. I've implemented in 61be6397b0fedb066199bf24e948a6f6f702f6c6 today to give entanglement_entro...
by Johannes
12 Oct 2020, 10:30
Forum: Releases
Topic: Release v0.7.2
Replies: 0
Views: 29845

Release v0.7.2

Another rather minor release. We've added a list of all papers using TeNPy to the documentation. Feel free to include your own works! And a slight simplicifation, which might affect your code: using the MultiCouplingModel is no longer necessary, just use the tenpy.models.model.CouplingModel directly...
by Johannes
23 Sep 2020, 08:21
Forum: HowTos and FAQ for TeNPy
Topic: finite open, finite periodic and infinite periodic chains
Replies: 10
Views: 9486

Re: finite open, finite periodic and infinite periodic chains

Yes, the MPS is still finite and OBC-style bc_MPS='finite' , with vectors at the boundary. It's just that the couplings in the MPO are topolically equivalent to a ring, as you drew it in your picture. Using the "default" order wouldn't change this, you would still need to define the MPS to...
by Johannes
22 Sep 2020, 07:39
Forum: HowTos and FAQ for TeNPy
Topic: Bond dimension is not increasing
Replies: 1
Views: 2066

Re: Bond dimension is not increasing

You set n_max=1, i.e. you consider hard-core bosons with at most 1 particle per site, and the model has particle number conservation. The product state from which you initialize is completely filled with one particle per site, such that the hopping term can't contribute - it would create one hole an...
by Johannes
21 Sep 2020, 14:43
Forum: HowTos and FAQ for TeNPy
Topic: New to tenpy
Replies: 2
Views: 2725

Re: New to tenpy

Take a look at the overview and readthe other "introductions". You want to use the tenpy.models.hubbard.FermiHubbardModel with the tenpy.models.lattice.Ladder (for the other ladders, implement your own "Lattice" class as described in the various introductions). The t,U,L are mode...
by Johannes
21 Sep 2020, 12:55
Forum: Releases
Topic: Release v0.7.0 and v0.7.1
Replies: 0
Views: 10229

Release v0.7.0 and v0.7.1

Version 0.7.0 and 0.7.1 have been released about 2 weeks ago and are available from pip and conda. Before updating , please read at least the section incompatible changes of the changelog. The highlight of the changes is the new support for time evolution with the W_{II} method for approximating the...
by Johannes
21 Sep 2020, 10:14
Forum: HowTos and FAQ for TeNPy
Topic: Loschmidt Echo
Replies: 2
Views: 2305

Re: Loschmidt Echo

Welcome! The MPS which you pass to the TEBDEngine gets modified in place (because we want to avoid unnecessary copies of MPS in case they are large). In other words, psi_0 and eng.epsi are the same MPS (namely the time evolved one). The solution is to make a copy of the MPS at some point, e.g. psi_0...
by Johannes
02 Sep 2020, 16:54
Forum: HowTos and FAQ for TeNPy
Topic: finite open, finite periodic and infinite periodic chains
Replies: 10
Views: 9486

Re: finite open, finite periodic and infinite periodic chains

Oops! There was a bug in init_lattice that the 'order' parameter was read out, but not used for 1D lattices (i.e. the Chain and Ladder). I've quickly fixed this in 9e020640e180d6fb9d09f534a9c91fa047cf6bab . After this fix, using order='folded' is really "enough", apart from making sure tha...
by Johannes
24 Aug 2020, 09:26
Forum: HowTos and FAQ for TeNPy
Topic: Possible bug to implement vanishing coupling strength?
Replies: 2
Views: 2465

Re: Possible bug to implement vanishing coupling strength?

While it does not work with the version v0.6.1, it works with the latest version of the master branch. The fix is about a year old, but wasn't included into the master branch until recently when we merged the MPO evolution with the W_I/W_II approximations... I guess it's time for a version bump agai...
by Johannes
21 Aug 2020, 09:51
Forum: HowTos and FAQ for TeNPy
Topic: Bosonic Haldane Model
Replies: 2
Views: 2527

Re: Bosonic Haldane Model

You're right, that's a double counting. Good catch, thanks for pointing it out! The Fermionic Hofstadter model has the same problem, of course. Additionally, one of the example models had the issue. I've fixed it in a8448f36c23fda6f2ea8217f4f8e938acb7f67df bart Did you see this? Any other consequenc...
by Johannes
20 Aug 2020, 09:29
Forum: HowTos and FAQ for TeNPy
Topic: Qn about iDMRG
Replies: 2
Views: 25167

Re: Qn about iDMRG

The model is H = J \sum_{i} (0.5 (S^+_i S^-_{i+1} + h.c.) + \Delta S^z_I S^z_{i+1} ) - h^z \sum_i S^z_i , which is in the ferromagnetic phase of the XXZ chain for \Delta = -1.7 . In other words, the True ground state is simply all down states (or all up states, if you have a non-zero h^z ). Indeed, ...
by Johannes
31 Jul 2020, 13:11
Forum: HowTos and FAQ for TeNPy
Topic: DMRG different results using SingleSiteEngine and TwoSiteEngine and how to keep certain filling
Replies: 1
Views: 2246

Re: DMRG different results using SingleSiteEngine and TwoSiteEngine and how to keep certain filling

Imposing a small bond dimension has slightly different effects on single-site vs. two-site DMRG. Take the extreme case of chi=1, in which case single-site DMRG (without a mixer) effectively does mean-field theory for a single site in an environment, while two-site dmrg finds the ground state of two ...
by Johannes
31 Jul 2020, 10:59
Forum: HowTos and FAQ for TeNPy
Topic: Entanglement spectrum by charge (specifically for iDMRG)
Replies: 4
Views: 3808

Re: Entanglement spectrum by charge (specifically for iDMRG)

For infinite systems, the absolute value of the charges has no physical meaning but is a pure gauge choice; physical is only the difference between charge values. Indeed, the absolute value depends on the choice of your initial state - did you get different results when you initialized with the down...