Search found 465 matches

by Johannes
22 Mar 2021, 21:50
Forum: HowTos and FAQ for TeNPy
Topic: np conserved module
Replies: 3
Views: 8466

Re: np conserved module

If your model is conserving Sz, you should also make sure you conserve Sz during the time evolution for speedup. In this case, the expectation value splits up into \langle g.s. | \sigma_j^x(t)\sigma_0^x(0)|g.s. \rangle = \langle g.s. | \sigma_j^+(t)\sigma_0^-(0)|g.s. \rangle + \langle g.s. | \sigma_...
by Johannes
22 Mar 2021, 21:36
Forum: HowTos and FAQ for TeNPy
Topic: Particle Number Conservation
Replies: 7
Views: 10241

Re: Particle Number Conservation

As far as I understand the error message, it claims that strength_vals is an integer array and hence can not divided by 2. in place . On your side, there's a very easy fix: specifying g = 1. as a float instead of g = 1 as an int - as you do in the default parameters. On TeNPy side, this is likely so...
by Johannes
22 Mar 2021, 17:58
Forum: HowTos and FAQ for TeNPy
Topic: Particle Number Conservation
Replies: 7
Views: 10241

Re: Particle Number Conservation

Your couplings preserve the number of fermions and bosons independently , so you want to end up with qnumber=2 charges. Try using charges='independent' when combining the sites. Moreover, you double-count the N-terms compared to the hopping terms by explicitly adding plus_hc=True , at least if you i...
by Johannes
22 Mar 2021, 17:18
Forum: HowTos and FAQ for TeNPy
Topic: Exponentiation of operator / String order parameter
Replies: 11
Views: 142994

Re: Exponentiation of operator / String order parameter

The correlation function is built with the intention that the i and j are multiple values; that's why the position r of opstr[r] is the index inside the MPS, not relative to i : opstrs = [s.Id if j % 2 == 0 else npc.expm(1.j * np.pi * Sz) for j, s in enumerate(psi.sites)] psi.correlation_function(&q...
by Johannes
14 Mar 2021, 19:08
Forum: HowTos and FAQ for TeNPy
Topic: How to use TDVP for one site
Replies: 3
Views: 7440

Re: How to use TDVP for one site

Hi Pablo, The definition of TDVP in the context of MPS means to project the time evolution into the subspace/manifold of MPS at a fixed bond dimension. Single-Site TDVP is doing exactly that: whatever bond dimension you start with, it will keep that bond dimension. That means when you start from a p...
by Johannes
12 Mar 2021, 23:59
Forum: HowTos and FAQ for TeNPy
Topic: Energy gap for Odd and Even length
Replies: 2
Views: 5076

Re: Energy gap for Odd and Even length

Short answer: Honestly, I don't know. From my limited experience with Bose-Hubbard physics, I could certainly imagine this to be a physical effect. Some suggestions for further investigation: Double-check that you're converged in the Nmax parameter of the BosonSite, i.e. how many bosons can occupy a...
by Johannes
12 Mar 2021, 21:12
Forum: HowTos and FAQ for TeNPy
Topic: How to deal with different ChargeInfos
Replies: 2
Views: 11810

Re: How to deal with different ChargeInfos

I'm not completely sure if I understand what you want to do and what you mean with "Gutzwiller projection". As far as I understand, you have found an MPS of SpinHalfFermionSite -based model with both Sz and N conservation. Now you want to "project" into the subspace of fixed part...
by Johannes
12 Mar 2021, 00:59
Forum: HowTos and FAQ for TeNPy
Topic: Using BC_shift on cylinder
Replies: 1
Views: 5826

Re: Using BC_shift on cylinder

Indeed, as far as I understand your question, you're trying to describe what the bc_shift parameter does. This one allows for a (basically) arbitrary shift when going around the cylinder; I guess you want it to be 1 or 2 in the most cases. Have you seen this section of the user-guide that I added a ...
by Johannes
12 Mar 2021, 00:40
Forum: HowTos and FAQ for TeNPy
Topic: Dynamical spin Structure Factor/ Excitation Spectrum of Spin Ladder
Replies: 15
Views: 36144

Re: Dynamical spin Structure Factor/ Excitation Spectrum of Spin Ladder

The MPS.expectation_value method for a given \(|\phi\rangle\) gives you \(\langle\phi|A_i|\phi\rangle\), but you need
\(\langle\psi|A_i|\phi\rangle\) with \(|\phi\rangle = \exp(-i H t) B_j |\psi_0\rangle\).
The latter is exactly what MPSEnvironment.expectation_value provides.
by Johannes
11 Mar 2021, 22:55
Forum: HowTos and FAQ for TeNPy
Topic: Dynamical spin Structure Factor/ Excitation Spectrum of Spin Ladder
Replies: 15
Views: 36144

Re: Dynamical spin Structure Factor/ Excitation Spectrum of Spin Ladder

Your new question is probably the follow up on this, so I guess I'm already a bit too late (Sorry :oops: ), but let me comment anyways. The first "standard" thing to do is to just calculate the next excited states (assuming that you have a finite system) using the "orthogonal_to"...
by Johannes
11 Mar 2021, 08:50
Forum: HowTos and FAQ for TeNPy
Topic: Non-Hermitian problem while using self-defined model
Replies: 2
Views: 5380

Re: Non-Hermitian problem while using self-defined model

Wow, that sounds like some interesting physics! Sometimes, it's helpful to double-check the terms produced by the model. In your case, print(M.all_coupling_terms().to_TermList()) prints -1.00000 * B gJW_0 Bd_1 + -1.00000 * Bd gJWd_0 B_1 + -1.00000 * B gJW_1 Bd_2 + -1.00000 * Bd gJWd_1 B_2 + ... Here...
by Johannes
11 Mar 2021, 03:08
Forum: HowTos and FAQ for TeNPy
Topic: Fourier Transform Product state
Replies: 1
Views: 4855

Re: Fourier Transform Product state

The MPS does not know about the Hamiltonian, so it can't have an "energy" per se. Instead, you have a model you ran DMRG with, and you can compute the energy from the MPO of that model as E = model.H_MPO.expectation_value(psi) giving you the value E = \langle \psi | H |\psi \rangle . (For ...
by Johannes
11 Mar 2021, 02:36
Forum: HowTos and FAQ for TeNPy
Topic: Product state of rotated spins for SpinHalfFermionSite
Replies: 2
Views: 5467

Re: Product state of rotated spins for SpinHalfFermionSite

Hi Tana, first of all, welcome to TeNPy, and sorry that I didn't reply earlier. I hope this still helps. The issue which you ran into is quite simple: the SpinHalfFermionSite represents a 4-dimensional local Hilbert space (with states "empty", "spin-up", "spin-down", &q...
by Johannes
11 Mar 2021, 02:22
Forum: HowTos and FAQ for TeNPy
Topic: RuntimeWarning and how to fix it
Replies: 3
Views: 6783

Re: RuntimeWarning and how to fix it

Hmmm. I'm still a bit worried, because after all we should usually avoid taking inverses of small singular values all-together for numerical stability. I tried to track down where it came from and found that it basically stems from this line in MPS.compress_svd() not truncating tiny singualar values...
by Johannes
11 Mar 2021, 00:50
Forum: HowTos and FAQ for TeNPy
Topic: RuntimeWarning and how to fix it
Replies: 3
Views: 6783

Re: RuntimeWarning and how to fix it

Hi Ruben, I have seen this warning before as well, but not so much lately. I vaguely remember that I also tried printing the S values and/or checking that none of them was 0 or negative, but couldn't quite pinpoint it.When testing S=S**-1. for different values like S = np.array([1.e-2, 1.e-15, 1.e-2...
by Johannes
25 Feb 2021, 07:06
Forum: HowTos and FAQ for TeNPy
Topic: How to define a infiniteT MPS under canonical ensemble
Replies: 5
Views: 27813

Re: How to define a infiniteT MPS under canonical ensemble

I played around with this a little bit. When you choose a smaller time step, the error gets smaller, it's O(dt). Further, I noticed that the error is coming from the state not being in canonical form: If you call psi.canonical_form_finite() right before measurements, at least this error is gone, as ...
by Johannes
11 Feb 2021, 23:05
Forum: HowTos and FAQ for TeNPy
Topic: np conserved module
Replies: 3
Views: 8466

Re: np conserved module

Why do you need the state Sx|psi> in the first place? As you know, S^x=0.5* (S^+ + S^-) and thus applying Sx to a state S|\psi\rangle with fixed Sz will give you a superposition of |\phi^\pm\rangle := S^\pm |\psi\rangle . In other words, S^x |\psi\rangle does not have a well defined Sz charge, and c...
by Johannes
11 Feb 2021, 02:20
Forum: HowTos and FAQ for TeNPy
Topic: Convergence Problem for Quantum Impurity Systems
Replies: 2
Views: 4833

Re: Convergence Problem for Quantum Impurity Systems

Sorry for the late reply. In general, I think DMRG should be suitable for such problems. I could understand that it fails for tiny/zero values of lambda, but for O(1) values of lambda it should definitely work. (In fact, I think that people have successfully used DMRG as an impurity solver for DMFT....
by Johannes
11 Feb 2021, 00:57
Forum: HowTos and FAQ for TeNPy
Topic: Excited states using tenpy
Replies: 13
Views: 34310

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

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

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

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

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

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: 5
Views: 27813

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