Search found 407 matches

by Johannes
10 Feb 2023, 12:05
Forum: HowTos and FAQ for TeNPy
Topic: Making an MPO given its tensors
Replies: 2
Views: 1764

Re: Making an MPO given its tensors

That's right, the grid of the MPO should be np_conserved Arrays. You can also take a look at the mpo_exponential_decay.py example.
by Johannes
27 Jan 2023, 17:54
Forum: Algorithms
Topic: How do environments grow in infinite DMRG?
Replies: 2
Views: 5736

Re: How do environments grow in infinite DMRG?

The figure 11 is a little bit misleading by stating that this happens between the sweeps, and it seems like we update both left and right environments at once. I chose to simplify in this figure to make it easier to grasp what is going on on the conceptual level - the figure makes clear that you nee...
by Johannes
27 Jan 2023, 15:53
Forum: Algorithms
Topic: How do environments grow in infinite DMRG?
Replies: 2
Views: 5736

How do environments grow in infinite DMRG?

I got the following, very reasonable question via email: In 1805.00055 there is a picture showing the update of the environment in the iDMRG (figure 11). I understood that between sweeps we are making two copies of the "central" system, and contracting it with the left and right environmen...
by Johannes
27 Jan 2023, 15:22
Forum: Algorithms
Topic: How are periodic boundary conditions implemented?
Replies: 3
Views: 11877

Re: How are periodic boundary conditions implemented?

Indeed, the MPS is always an open line where a cut of a single virtual leg always divides it into left and right parts - otherwise, the canonical form isometry conditions wouldn't go through e.g. for local expectation values or optimal truncation. When you use infinite MPS, the Model formally has &q...
by Johannes
26 Jan 2023, 18:25
Forum: HowTos and FAQ for TeNPy
Topic: norm attribute when doing compress_svd()
Replies: 2
Views: 1485

Re: norm attribute when doing compress_svd()

Sorry for the slow response. I've answered the 165 rather extensively, I hope that clarifies things. If the operator you apply is not exactly unitary, it is to be expected that it changes the norm, isn't it? But you can indeed manually reset psi.norm = 1 by hand if needed. The norm is only relevant ...
by Johannes
26 Jan 2023, 17:36
Forum: HowTos and FAQ for TeNPy
Topic: Expected speedups for Sz or parity conservation in qc simulations
Replies: 2
Views: 10170

Re: Expected speedups for Sz or parity conservation in qc simulations

In general yes, using Sz or parity conservation can speed up calculations. The actual speedup depends on the number and sizes of symmetry sectors in the tensors - it comes from the fact that the tensors have a block-diagonal form. Parity conservation divides a tensor into 2 subsectors, leading to a ...
by Johannes
08 Nov 2022, 09:35
Forum: HowTos and FAQ for TeNPy
Topic: Asking about how to calculate expectation values after TDVP evolution
Replies: 6
Views: 2359

Re: Asking about how to calculate expectation values after TDVP evolution

A Haar random state has (almost) maximal entanglement and can thus *not* be compressed into an MPS (for large system sizes without significant truncation). If you have a given Haar random state, you could try to convert it to a np_conserved Array and then into an MPS (without charge conservation, so...
by Johannes
07 Nov 2022, 16:30
Forum: HowTos and FAQ for TeNPy
Topic: Applying an iMPO to an iMPS
Replies: 2
Views: 1525

Re: Applying an iMPO to an iMPS

The issue lies in different scalings with system size and hence definitions for overlaps that are not what you expect naively. For infinite MPS, the overlap is formally 0, 1, or infinite, and as such not very usefull. Instead, MPS.overlap returns the "overlap per unit cell", to be precise ...
by Johannes
07 Nov 2022, 10:35
Forum: HowTos and FAQ for TeNPy
Topic: ExpMPOEvolution.run() vs. update()
Replies: 2
Views: 1900

Re: ExpMPOEvolution.run() vs. update()

The latter is the recommended way to do a time evolution. You can find the corresponding loop in the source code of the RealTimeEvolution Simulation class in the run_algorithm method.
by Johannes
07 Nov 2022, 10:26
Forum: HowTos and FAQ for TeNPy
Topic: Asking about how to calculate expectation values after TDVP evolution
Replies: 6
Views: 2359

Re: Asking about how to calculate expectation values after TDVP evolution

This is really standard arguments from quantum mechanics: You can use Sz conseration, if [H,S^z] = 0 , where S^z = \sum_i S^z_i . In that case, you *choose* to work in fixed magnetization sectors and write an initial state with S^z |\psi_0\rangle = m \hbar | \psi_0 \rangle , where m\in \mathbb{R} is...
by Johannes
04 Nov 2022, 17:21
Forum: HowTos and FAQ for TeNPy
Topic: MPO-MPS contraction using apply
Replies: 1
Views: 1449

Re: MPO-MPS contraction using apply

Sorry that I couldn't answer earlier, I'd been swamped with other things to finish. You're on the right track, but had some convention issue along the way: First, in TeNPy, the convention is that Jordan Wigner strings extend to the left, not to the right. The MPO you wrote down generates \sum_i \alp...
by Johannes
04 Nov 2022, 17:03
Forum: HowTos and FAQ for TeNPy
Topic: Apply MPO to another MPO
Replies: 1
Views: 1355

Re: Apply MPO to another MPO

This is not supported at this point. It's also not quite trivial especially in the case of infinite MPS, since MPOs are often extensive (scaling with L), and multiplying them can give you something quadratic in L.
by Johannes
04 Nov 2022, 15:54
Forum: HowTos and FAQ for TeNPy
Topic: Bose-Hubbard Model Single Particle Excitation Gap
Replies: 2
Views: 1742

Re: Bose-Hubbard Model Single Particle Excitation Gap

Thanks for the suggestion, this is indeed the way to go here. See e.g. arXiv:cond-mat/9906019 for details.
by Johannes
04 Nov 2022, 15:45
Forum: HowTos and FAQ for TeNPy
Topic: Trouble installing tenpy
Replies: 2
Views: 1433

Re: Trouble installing tenpy

On personal laptops, I'd recommend to download anaconda and install the corresponding conda package, then you don't need any build tool yourself.
Note that the latest version 0.9 is by now over a year old, I'll release a new version either today or on Monday....
by Johannes
04 Nov 2022, 15:42
Forum: HowTos and FAQ for TeNPy
Topic: Asking about how to calculate expectation values after TDVP evolution
Replies: 6
Views: 2359

Re: Asking about how to calculate expectation values after TDVP evolution

The XXZ chain by default turns on Sz conservation. Hence, there is no operator 'Sx' or 'Sy', because they don't conserve the Sz charge. Due to Sz conservation, you immediately know that expectation values of Sx and Sy are zero. See also this FAQ question However, note that the correlations <Sx_i Sx_...
by Johannes
04 Nov 2022, 15:03
Forum: HowTos and FAQ for TeNPy
Topic: Comparing Wave Functions with Different Charge Infos
Replies: 1
Views: 1288

Re: Comparing Wave Functions with Different Charge Infos

The Array class has the methods drop_charge and change_charge . What's missing is functions to do this for each tensor in an MPS (or similarly, an MPO). You could do something along the following snippet: def MPS_drop_charge(psi, charge=None, chinfo=None, permute_p_leg=True): psi_c = psi.copy() psi_...
by Johannes
04 Nov 2022, 14:22
Forum: HowTos and FAQ for TeNPy
Topic: unable to change the model parameters from the command line
Replies: 2
Views: 1916

Re: unable to change the model parameters from the command line

This should be fixed in the latest github version. I'll release a new version 0.10 (that can be installed with pip/conda) shortly. (Sorry, I didn't update the official releases for over a year, so there have a few fixes accumulated....)
by Johannes
04 Nov 2022, 14:18
Forum: HowTos and FAQ for TeNPy
Topic: TDVP time evolution with interaction / onsite state probability
Replies: 4
Views: 15772

Re: TDVP time evolution with interaction / onsite state probability

It seems that you use Sz conservation, such that there is no operator 'Sx' or 'Sy', because they don't conserve the Sz charge. Since you model (and hence state) conserve Sz, you immediately know that expectation values of Sx and Sy are zero.
See also this FAQ question
by Johannes
27 Oct 2022, 16:03
Forum: Implementations
Topic: Different time two point correlator at finite temperature.
Replies: 2
Views: 6800

Re: Different time two point correlator at finite temperature.

Yes, this looks correct. The line M_tebd = models.model.NearestNeighborModel.from_MPOModel(M) is not really necessary, the Model which you have already is a NearestNeighborModel defining H_bond, so there's no need to create a new model here. In fact, you don't need to define the XXZchainnew here at ...
by Johannes
22 Sep 2022, 09:09
Forum: HowTos and FAQ for TeNPy
Topic: 01_dmrg.ipynb but with periodic boundary conditions
Replies: 2
Views: 1835

Re: 01_dmrg.ipynb but with periodic boundary conditions

Indeed, the issue is that the periodic boundary conditions induce a long-range coupling in the model. (The MPS is still open, but I think you already got this.) You don't even need to define a custom model, since there is also the tenpy.models.tf_ising.TFIModel , which is the same as the TFIChain ex...
by Johannes
31 Aug 2022, 09:40
Forum: HowTos and FAQ for TeNPy
Topic: Linking MKL issue in window 11
Replies: 1
Views: 1415

Re: Linking MKL issue in window 11

Looks like it's installed correctly, even if HAVE_MKL was not set on compile time. It's able to load the compiled parts, so no need to worry, all good! If TeNPy is compiled without HAVE_MKL, it falls back to the BLAS functioncs of numpy and scipy, and as fas as I know, numpy+scipy on Windows actuall...
by Johannes
31 Aug 2022, 09:32
Forum: HowTos and FAQ for TeNPy
Topic: Varying Lattice Spacing
Replies: 2
Views: 1759

Re: Varying Lattice Spacing

If the "long range" coupling has a finite range, i.e. you put a cutoff of say 5 sites or so, and don't include any coupling afterwards, you can indeed just call add_exponentially_decaying_coupling a bunch of times with corresponding distances. If you want a "true" long range coup...
by Johannes
31 Aug 2022, 08:38
Forum: HowTos and FAQ for TeNPy
Topic: Why does my SSH model not working
Replies: 1
Views: 1622

Re: Why does my SSH model not working

You're using a FermionChain. As the name suggests, the FermionChain has as local sites the tenpy.networks.site.FermionSite . This site doesn't define "up" or "down" states, but only "full" and "empty" states. Try to adjust the initial product state to be e.g. ...
by Johannes
17 Aug 2022, 16:49
Forum: Implementations
Topic: Implementing TEBD of open quantum chain in TenPy.
Replies: 2
Views: 6407

Re: Implementing TEBD of open quantum chain in TenPy.

Hi Sourav, cool, great to hear that you want to implement this in TeNPy! There's different ways to implement Lindblad evolution, so before we discuss TeNPy, we should maybe discuss a bit which way you want to implement it, and it's probably much easier to do this over zoom. I'll contact you by email...