That's currently not supported at the moment, as imaginary time evolution is generally much slower than variational methods like DMRG.
Why would you prefer TDVP over DMRG?
Search found 465 matches
- 21 Aug 2023, 13:12
- Forum: HowTos and FAQ for TeNPy
- Topic: imaginary time evolution with TDVP
- Replies: 1
- Views: 11711
- 02 Aug 2023, 16:26
- Forum: HowTos and FAQ for TeNPy
- Topic: Particle Number Conservation in tJ model
- Replies: 1
- Views: 15584
Re: Particle Number Conservation in tJ model
The tenpy.models.tj_model.tJModel defines the options cons_N and cons_Sz - just set them as you need them, and make sure your initial state is in the charge sector you want - for the initial product state you wrote, you get average density of 2/4 = 1/2 and spin Sz=0. You can also easily define a cus...
- 02 Aug 2023, 15:30
- Forum: HowTos and FAQ for TeNPy
- Topic: How to use the 'sort_mpo_legs' feature
- Replies: 1
- Views: 11701
Re: How to use the 'sort_mpo_legs' feature
The MPO tensors in W are sparse, and without the 'sort_mpo_legs': True, we try to capture that, resulting in fewer small blocks for tensordots involving a H.get_W(i) rather than bigger blocks (as dictated by charge conservation). For this benchmark comparison, we wanted to compare "apples to ap...
- 02 Aug 2023, 15:15
- Forum: Algorithms
- Topic: How are periodic boundary conditions implemented?
- Replies: 4
- Views: 68875
Re: How are periodic boundary conditions implemented?
I learned the trick in private communications from Ian McCulloch several years back, but I'm also not sure who was the first to suggest/use it, sor I can't provide a reference...
- 17 Jul 2023, 16:57
- Forum: HowTos and FAQ for TeNPy
- Topic: Calculating Time Evolution Only Once
- Replies: 4
- Views: 22070
Re: Calculating Time Evolution Only Once
I'd always try to exploit "trivial" parallelization first, where you can just distribute jobs (say for different Hamiltonian parameters, or in your case different initial states) to different nodes on a cluster. If you can't do that because you're working on a local machine, keep it as ind...
- 17 Jul 2023, 16:31
- Forum: HowTos and FAQ for TeNPy
- Topic: DMRG on 2D triangular lattice for J1-J2 spin-1/2 model
- Replies: 1
- Views: 12973
Re: DMRG on 2D triangular lattice for J1-J2 spin-1/2 model
You need to be aware of symmetries in your system. The SU(2)-symmetric heisenberg interactions in particular preserve the total Sz spin, and the ferromagnetic all-up state (a) in your picture is an exact eigenstate. Hence, when you start from this state, DMRG just doens't update it - that's why your...
- 17 Jul 2023, 10:14
- Forum: HowTos and FAQ for TeNPy
- Topic: Calculating Time Evolution Only Once
- Replies: 4
- Views: 22070
Re: Calculating Time Evolution Only Once
I'm not sure if I understand your question correctly - do you suggest to write U(t) as an MPO? Unfortunately, it doesn't work that way. Writing down the full time evolution operator (say as an MPO) for large t is much more expensive than just applying it to a given state: it requires exponentiating ...
- 17 Jul 2023, 08:41
- Forum: Implementations
- Topic: Defining a New Operator when Inheriting CouplingMPOModel
- Replies: 1
- Views: 41921
Re: Defining a New Operator when Inheriting CouplingMPOModel
The issue here is that you directly pass the full Ladder instance in the model_params, which already has the site defined - hence the model doesn't call init_sites anymore. Try to use model_params = dict( lattice='Ladder', L=20, U=1., bc_MPS='finite' ) and overwrite init_lattice if you need to adjus...
- 20 Jun 2023, 18:26
- Forum: HowTos and FAQ for TeNPy
- Topic: Save evolution with hdf5
- Replies: 1
- Views: 7908
Re: Save evolution with hdf5
First of all, I would in general advise you to think about the extra amount of storage you need for this, and whether this is sensible, of whether it's easier to re-run the time evolution when you decide that you really need extra measurements. At least think about whether you want to save it at *ev...
- 20 Jun 2023, 10:09
- Forum: HowTos and FAQ for TeNPy
- Topic: state overlap(probability)
- Replies: 11
- Views: 37794
Re: state overlap(probability)
Just 'up'. I forgot to copy over corresponding line in the example, see the edit above 
You can also put the index directly, if you know it - but be aware of the sorting of charges....

You can also put the index directly, if you know it - but be aware of the sorting of charges....
- 20 Jun 2023, 10:07
- Forum: HowTos and FAQ for TeNPy
- Topic: Infinite DMRG with conserved charges
- Replies: 2
- Views: 12307
Re: Infinite DMRG with conserved charges
Just to make sure I understand: when you say [b_i,b^\dagger_j]=i\delta_{ij} , was the i supposed to be there??? I guess not, correct? In the Hamiltonians you wrote, each b is acting on the same site j - I think you mean j, j+1 and j+2 (for 3 sites), correct? That said, in your models, you don't coup...
- 20 Jun 2023, 09:09
- Forum: HowTos and FAQ for TeNPy
- Topic: Question about poorly conditioned H matrix in KrylovBased
- Replies: 6
- Views: 16127
Re: Question about poorly conditioned H matrix in KrylovBased
1) What model are you actually using? The site you define has Sz conservation, which you can't use in the Toric code. 2) What intitial state are you using? Is H psi = 0 on that initial state? 3) What's the log output during the DMRG run? 4) Again, are your individual entanglement entropies larger th...
- 20 Jun 2023, 08:48
- Forum: HowTos and FAQ for TeNPy
- Topic: state overlap(probability)
- Replies: 11
- Views: 37794
Re: state overlap(probability)
at a single site only? Then I would suggest to just use apply_local_op with a local operator |x><x|, where x is the state you want to project on. def project_local(psi, i, state): site = psi.sites[i] P = np.zeros(site.dim) P[site.state_index(state)] = 1. proj = npc.diag(P, site.leg, labels=['p', 'p*...
- 16 Jun 2023, 09:04
- Forum: HowTos and FAQ for TeNPy
- Topic: How to add the resume from checkpoint in yaml file
- Replies: 2
- Views: 10013
Re: How to add the resume from checkpoint in yaml file
At the moment, you need to directly call the tenpy.resume_from_checkpoint function with the filename from where you want to resume the simulation. You can do this from the command line e.g. with python -c 'import tenpy; tenpy.resume_from_run("path_to_file.h5")' . See 269 for ToDo / progres...
- 16 Jun 2023, 08:37
- Forum: HowTos and FAQ for TeNPy
- Topic: How to obtain a more accurate charge-pumping in tenpy
- Replies: 1
- Views: 8344
Re: How to obtain a more accurate charge-pumping in tenpy
The chi_list forces DMRG to project to small bond dimension initially and the increase chi as specified with increasing number of sweeps. The idea is to gradually get close to the true ground state. When doing the charge pump, you want to adiabatically follow the ground state with as little change a...
- 16 Jun 2023, 08:16
- Forum: HowTos and FAQ for TeNPy
- Topic: Question about poorly conditioned H matrix in KrylovBased
- Replies: 6
- Views: 16127
Re: Question about poorly conditioned H matrix in KrylovBased
For you model: double-check that your hamiltonian is indeed hermitian assert model.H_MPO.is_equal(model.H_MPO.dagger()) - if you mess up adding the couplings, it might not be. To fully avoid the warning, you might need to start from a different initial state. In particular, I'd assume you start from...
- 01 Jun 2023, 15:20
- Forum: HowTos and FAQ for TeNPy
- Topic: How to adjust the 'N_sweeps_check' and 'update_env' parameters in Tenpy's idmrg calculation
- Replies: 2
- Views: 10254
Re: How to adjust the 'N_sweeps_check' and 'update_env' parameters in Tenpy's idmrg calculation
the N_sweeps_check defines how often you check for convergence and print the status output to the log. Many iDMRG runs need >100 sweeps to converge, but every sweep is much faster than comparable finite-size DMRG runs (since L_x_infinite ~1-2 << L_x_fininte ~ 50=200 for typical runs). Assuming that ...
- 31 May 2023, 09:20
- Forum: HowTos and FAQ for TeNPy
- Topic: Question about poorly conditioned H matrix in KrylovBased
- Replies: 6
- Views: 16127
Re: Question about poorly conditioned H matrix in KrylovBased
The "poorly conditioned H" is not an error message, it's a warning - telling you that there might be something wrong in your setup. The poorly conditioned H is often a hint for 1) your Hamiltonian not being hermitian or 2) the initial state/ some intermediate state being such that H |psi> ...
- 24 May 2023, 15:17
- Forum: HowTos and FAQ for TeNPy
- Topic: Non-canonical MPS as an initial guess for DMRG
- Replies: 2
- Views: 9003
Re: Non-canonical MPS as an initial guess for DMRG
For finite DMRG, it doesn't really matter, as it effectively brings the MPS to canonical form in the first sweep. For infinite DMRG, I'm not completely sure right now, if it's okay. The subtle thing there is that you absorb the tensors into the environments, which you grow each sweep. The MPO assume...
- 23 May 2023, 14:32
- Forum: HowTos and FAQ for TeNPy
- Topic: Translationally invariant simulation of XXZ
- Replies: 1
- Views: 7330
Re: Translationally invariant simulation of XXZ
When you have a perfect ground state degeneracy, DMRG is by definition allowed to give you any superposition (of the ground states) it wants, and it tends to break the translation invariance if it can. The state you wrote down is what we call a "cat" state, because it is a global superposi...
- 23 May 2023, 13:57
- Forum: HowTos and FAQ for TeNPy
- Topic: how to write HofstadterModel with mixed_xk in infinite dmrg
- Replies: 7
- Views: 24059
Re: how to write HofstadterModel with mixed_xk in infinite dmrg
In real space, you can't conserve ky directly, so you don't get that quantum number (although it's still there in principle, yes). What initial state did you try? You need to put in the correct number of particles, but the total ky is a free parameter which you might need to vary as well (if you don...
- 23 May 2023, 13:41
- Forum: HowTos and FAQ for TeNPy
- Topic: exponential of the sum of operators on different sites
- Replies: 3
- Views: 15070
Re: exponential of the sum of operators on different sites
Okay, it wasn't clear to me that r < Lx, such that this is a non-trivial operator (given charge conservation). In the paper, they use r = L/2, what did you try? if you always start at x=0, it's actually just measuring the parity of particles to the left at a given bond (say in the center at L/2, but...
- 22 May 2023, 17:05
- Forum: HowTos and FAQ for TeNPy
- Topic: exponential of the sum of operators on different sites
- Replies: 3
- Views: 15070
Re: exponential of the sum of operators on different sites
I'm confused what the problem is. Clearly, there's a mathematical identity \exp(i \pi \sum_y( n_{x,y} - 1)) = \prod_y \exp(i \pi (n_{x,y} - 1)) , so \prod_x \exp(i \pi \sum_y( n_{x,y} - 1)) = \prod_{x,y} \exp(i \pi (n_{x,y} - 1)) , which is a product of exponentials of onsite-operators. How do you k...
- 22 May 2023, 16:58
- Forum: HowTos and FAQ for TeNPy
- Topic: How to create a new operator as a combination of operators acting on different sites
- Replies: 2
- Views: 9949
Re: How to create a new operator as a combination of operators acting on different sites
Welcome! Unfortunately, we don't support multi-site operator combinations in TeNPy very well at the moment. However, there's a very simple, general work-around: just write everything explicitly in terms of the single-site operators and sum it up afterwards. In your case, just plugging in \kappa^z_j ...
- 22 May 2023, 16:01
- Forum: HowTos and FAQ for TeNPy
- Topic: how to write HofstadterModel with mixed_xk in infinite dmrg
- Replies: 7
- Views: 24059
Re: how to write HofstadterModel with mixed_xk in infinite dmrg
Hi Kevin, just like the other 2D models in TeNPy, the `MixedXK` model reads out the Lx parameter to define the number of "rings" in the iMPS unit cell, similar as Ly defines the number of sites / lattice unit cells around the cylinder. The add_onsite and add_coupling methods accept the str...