Search found 465 matches

by Johannes
11 Aug 2021, 17:24
Forum: Algorithms
Topic: Question about iTDVP
Replies: 1
Views: 35451

Re: Question about iTDVP

Yes, I think you need to recreate the environments from scratch.
Not completely sure, but I think you could try using the old ones as an initial guess for the new environments.
by Johannes
11 Aug 2021, 17:17
Forum: Algorithms
Topic: Disentangler for long-range model or for local 2-d lattice model
Replies: 1
Views: 33598

Re: Disentangler for long-range model or for local 2-d lattice model

The disentanglers implemented in TeNPy act on two or more consecutive sites in the MPS language, but of course you can try to apply a bunch of them one after the other. It also has code that tries to bring a few sites next to each other and then disentangle them, but in my experience that didn't wor...
by Johannes
11 Aug 2021, 17:14
Forum: HowTos and FAQ for TeNPy
Topic: How to use self-defined model in Simulation's yml file?
Replies: 2
Views: 6995

Re: How to use self-defined model in Simulation's yml file?

You just need to import the file in python, which contains the model definition; then you can just use the "name" of the model in the simulation parameters. To import that file with the definition, you have two options: Either you use the command line option -1 of tenpy-run or python -m te...
by Johannes
11 Aug 2021, 16:53
Forum: HowTos and FAQ for TeNPy
Topic: Question about convergence statistics in (i)DMRG
Replies: 2
Views: 6024

Re: Question about convergence statistics in (i)DMRG

To be clear, the actual convergence of DMRG is much faster than just 1/(#sweeps performed), as you see on the right - there's a log-scale on the yaxis :)
by Johannes
11 Aug 2021, 16:52
Forum: HowTos and FAQ for TeNPy
Topic: Question about convergence statistics in (i)DMRG
Replies: 2
Views: 6024

Re: Question about convergence statistics in (i)DMRG

is not the energy you want to study for convergence' it is the total energy of the system that contains age sites, including all energy terms in the environments with whatever state you had at that point. Pictorially, the "total" system that infinite DMRG grew after a couple of sweeps look...
by Johannes
08 Jun 2021, 03:14
Forum: HowTos and FAQ for TeNPy
Topic: Custom (sum of) Operators
Replies: 3
Views: 8586

Re: Custom (sum of) Operators

A bit late, but better late than never ;-) apply_local_op accepts an operator that acts on n neighboring sites, for example for two sites with legs 'p0', 'p1', 'p0*', 'p1*' . You can use the brand-new function tenpy.networks.site.kron to create the corresponding bond operator from the single-site op...
by Johannes
08 Jun 2021, 02:49
Forum: HowTos and FAQ for TeNPy
Topic: If/How to avoid: "final DMRG state not in canonical form..."
Replies: 4
Views: 11876

Re: If/How to avoid: "final DMRG state not in canonical form..."

You shouldn't trust expectation values/correlation functions that were calculated from an MPS that is not in canonical form, because these functions implicitly assume that psi is in canonical form. When your DMRG is really converged and doesn't change the state during the sweep any more, you would e...
by Johannes
08 Jun 2021, 02:31
Forum: Implementations
Topic: Keeping number of particles fixed at edges
Replies: 1
Views: 36385

Re: Keeping number of particles fixed at edges

The answer comes probably a bit too late, but anyways: How do you want to "fix" the states outside? If you imagine to project them to the local basis states with exactly 0/2 sites, you would have a product state with the rest. The hopping term wouldn't contribute, and you can just calculat...
by Johannes
08 Jun 2021, 02:13
Forum: Implementations
Topic: wave function from MPS
Replies: 1
Views: 35376

Re: wave function from MPS

They will only depend on the charge conservation you're using.

I guess you're aware of this, but just to be clear: when you do this, you write down all 2^L states, so you could just as well use exact diagonalization....
by Johannes
08 Jun 2021, 02:05
Forum: HowTos and FAQ for TeNPy
Topic: Finite state machine MPO
Replies: 2
Views: 6569

Re: Finite state machine MPO

Hi Pablo, there is a way to do it more effiently, although I only did that numerically: I created the AKLT model by just defining bond terms, and then initializing the MPO from these bond terms - there's a function in TeNPy to automatically do the SVD of the bond term to get the MPO. Take a look at ...
by Johannes
08 Jun 2021, 01:48
Forum: HowTos and FAQ for TeNPy
Topic: dmrg.run() claims quartic Hamiltonian is zero
Replies: 3
Views: 11912

Re: dmrg.run() claims quartic Hamiltonian is zero

It's a problem of the inital state and charge conservation, not the jordan wigner strings. TwoSiteDMRG updates two sites in the subspace created by projecting H to the current psi (i.e. your initial state) on other sites; this projection will render H zero because each term in H has at least two C/C...
by Johannes
08 Jun 2021, 01:40
Forum: Algorithms
Topic: Mapping of Spinful Fermion to Spinless fermion
Replies: 3
Views: 47833

Re: Mapping of Spinful Fermion to Spinless fermion

Yes, that's right.
I tried to explain this in the section "spinful fermions" of the Jordan-Wigner user guide you referenced.
If you have a suggestion how to formulate this a bit clearer, feel free to submit a corresponding pull request on github!
by Johannes
08 Jun 2021, 01:36
Forum: HowTos and FAQ for TeNPy
Topic: [RESOLVED] Issue in purification method (normalization of temperature and/or timescales?)
Replies: 3
Views: 7559

Re: [RESOLVED] Issue in purification method (normalization of temperature and/or timescales?)

rubenv Good catch, the fix is of course correct. Let me explain: The variation compression needs a copy of the old psi to compress against, and that copy is made during the class intialization, more precisely in [tenpyclass=tenpy.algorithms.mps_common.VariationalApplyMPO]init_env[/inline]. So it mo...
by Johannes
13 Apr 2021, 23:58
Forum: HowTos and FAQ for TeNPy
Topic: finite open, finite periodic and infinite periodic chains
Replies: 10
Views: 29030

Re: finite open, finite periodic and infinite periodic chains

Whoa, I wasn't aware that you want to run it for non-hermitian H. Lancos implicitly assumes that H is hermitian! For that reason at least TeNPy's implementation of TDVP (which uses Lancos to do the local time evolution) does not work for that case! Dropping the hermiticity of H is in general very da...
by Johannes
13 Apr 2021, 23:24
Forum: HowTos and FAQ for TeNPy
Topic: Energy gap for infinite system using segment DMRG?
Replies: 2
Views: 7648

Re: Energy gap for infinite system using segment DMRG?

Hi Ruben, you're right, the DMRG code supports segment boundary conditions already. Right now, you need to extract the left and right environment from a previous DMRG run, and then specify it in resume_data['init_env_data'] to the subsequent DMRG run by hand. There's still some subtleties, e.g. how ...
by Johannes
01 Apr 2021, 19:12
Forum: HowTos and FAQ for TeNPy
Topic: RuntimeWarning and how to fix it
Replies: 3
Views: 6766

Re: RuntimeWarning and how to fix it

Update:
when trying to install TeNPy on a cluster with the Intel Python distribution, we encountered the same runtime warnings.
Looking into this now...
by Johannes
01 Apr 2021, 18:33
Forum: HowTos and FAQ for TeNPy
Topic: Dynamical spin Structure Factor/ Excitation Spectrum of Spin Ladder
Replies: 15
Views: 35745

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

Sorry, I didn't realize you were looking at infinite MPS. For an infinite MPS, the leg between unit cells is non-trivial, and in general changes when you do a time evolution. This is where the error is coming from: when you initialize the MPSEnvironment, it needs to know how to connect the left-/rig...
by Johannes
30 Mar 2021, 21:50
Forum: HowTos and FAQ for TeNPy
Topic: Get excited states in different symmetry sectors
Replies: 3
Views: 6567

Re: Get excited states in different symmetry sectors

For single-site DMRG to work you need to enable the "mixer" by setting dmrg_params['mixer']=True , otherwise it cannot grow the bond dimension. Be warned that the default mixer_params might still disable the mixer too early for larger/more correlated systems. I've just released a bugfix ve...
by Johannes
29 Mar 2021, 21:20
Forum: HowTos and FAQ for TeNPy
Topic: Get excited states in different symmetry sectors
Replies: 3
Views: 6567

Re: Get excited states in different symmetry sectors

Yes: just run DMRG with an initial state in the symmetry sector you're interested in.
DMRG doesn't switch charge sectors, so the charge sector of the final state is determined by your initial state.
by Johannes
29 Mar 2021, 17:10
Forum: HowTos and FAQ for TeNPy
Topic: Calculate Energy Expectation on Ladder
Replies: 3
Views: 5940

Re: Calculate Energy Expectation on Ladder

There are more ways to get the expectation value \(E = \langle \psi | H | \psi\rangle \) of a given state than just through H_bonds: when you have a model, you can evaluate the MPO expectation value with M.H_MPO.expectation_value(psi).
Does this answer your question?
by Johannes
25 Mar 2021, 21:11
Forum: HowTos and FAQ for TeNPy
Topic: Dynamical spin Structure Factor/ Excitation Spectrum of Spin Ladder
Replies: 15
Views: 35745

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

Would you mind to provide a traceback? An "incompatible LegCharge" means it's trying to contract two legs with different charges somewhere, not necessarily in the MPS bonds.
by Johannes
23 Mar 2021, 18:32
Forum: HowTos and FAQ for TeNPy
Topic: Dynamical spin Structure Factor/ Excitation Spectrum of Spin Ladder
Replies: 15
Views: 35745

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

To be clear: you need to evolve this for much longer than just a few steps, and continuously take measurements for C_ij(t) . In the end, you can then fourier-transform C_ij(t) , both in space and time, to get C_k(\omega) , which is what you're really interested in, right? The maximal time you reach ...
by Johannes
23 Mar 2021, 18:21
Forum: HowTos and FAQ for TeNPy
Topic: Particle Number Conservation
Replies: 7
Views: 10207

Re: Particle Number Conservation

It seems there's something gone wrong beforehand; if you try psi.test_sanity() before the psi0.apply_local_op(...) , it will likely give you an error, right? If this code is inside a loop, make sure you have actual copies psi0 = psi.copy() , not just new references. That being said: in what way can ...
by Johannes
22 Mar 2021, 23:58
Forum: HowTos and FAQ for TeNPy
Topic: Excited states using tenpy
Replies: 13
Views: 34160

Re: Excited states using tenpy

Sounds like you're after the bc_shift . With bc_shift=['open', -1] for finite MPS or bc_shift=['periodic', -1] for infinite MPS, couplings in "y-direction" of the lattice wind like a helix around the cylinder. More details in this userguide section . It might also be useful to look at the ...
by Johannes
22 Mar 2021, 23:43
Forum: HowTos and FAQ for TeNPy
Topic: TDVP run time issue
Replies: 3
Views: 8149

Re: TDVP run time issue

1) Glad that this helped. Watch out for the new version of TeNPy that will be released in the next few days! 2) You're more than welcome to contribute! There's plenty of things to be done. Hmm, I'm not completely sure, but it might just be that chi=500 is too small to reach that time. I did some sim...