Search found 421 matches

by Johannes
04 Nov 2022, 17:21
Forum: HowTos and FAQ for TeNPy
Topic: MPO-MPS contraction using apply
Replies: 1
Views: 1479

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

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

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

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

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

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

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

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

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

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

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

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

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

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...
by Johannes
17 Aug 2022, 15:39
Forum: HowTos and FAQ for TeNPy
Topic: Converting MPS to State Vector
Replies: 2
Views: 2168

Re: Converting MPS to State Vector

Formally yes , you can do it by just contracting all the tensors of the MPS, leaving the physical legs open. Depending on your preferred form, you might want to combine the L physical legs of dimension d into a single, big leg of dimension dim(\mathcal{H})= d^L , but this is essentially just a resh...
by Johannes
10 Aug 2022, 16:30
Forum: HowTos and FAQ for TeNPy
Topic: Regarding Two point correlation function in TenPy
Replies: 2
Views: 1948

Re: Regarding Two point correlation function in TenPy

In general, you should probably do this for one j in the center of your chain only and write this as C(t) = \langle \psi_0 | e^{i H t} S^z_i e^{-iHt} S^z_j | \psi_0 \rangle = \langle \psi(t) | S^z_i | \phi(t) \rangle, \quad \text{where} \quad |\psi(t) \rangle = e^{-iHt} |\psi_0 \rangle \text{~and~} ...
by Johannes
10 Aug 2022, 16:08
Forum: HowTos and FAQ for TeNPy
Topic: UserWarnings differ for identical initializations when run several times
Replies: 1
Views: 1653

Re: UserWarnings differ for identical initializations when run several times

That's expected behaviour given the implmentation of these warnings. The engine does use the options, but only once you actually time evolve the state with eng.run() . This stems from the convention that options only need to be read out by the time when they are actually used: depending on previousl...
by Johannes
29 Jul 2022, 10:21
Forum: HowTos and FAQ for TeNPy
Topic: My correlation functions from MPS.correlation_function and MPSEnvironment.expectation value disagree
Replies: 2
Views: 1780

Re: My correlation functions from MPS.correlation_function and MPSEnvironment.expectation value disagree

The issue is confusion about the (first two) arguments of correlation_function . Giving a list of operators as arguments does not mean that you evaluate correlations between multi-site terms, but that you evaluate different correlation functions on even vs odd sites: psi.correlation_function(['A','B...
by Johannes
29 Jul 2022, 07:09
Forum: HowTos and FAQ for TeNPy
Topic: Crash during calculation of <Sy>
Replies: 4
Views: 2181

Re: Crash during calculation of <Sy>

Glad to hear that :)
by Johannes
27 Jul 2022, 16:25
Forum: HowTos and FAQ for TeNPy
Topic: Crash during calculation of <Sy>
Replies: 4
Views: 2181

Re: Crash during calculation of <Sy>

I checked, and the code runs without issues on my machine. I'd guess it's some incompatibility/issue with the BLAS code being called in the end. First of all, try whether it works with export TENPY_OPTIMIZE=0 , which forces TeNPy to not load the compiled Cython parts. How did you install TeNPy? Did ...
by Johannes
26 Jul 2022, 16:26
Forum: HowTos and FAQ for TeNPy
Topic: Spin-Boson MPO
Replies: 1
Views: 2171

Re: Spin-Boson MPO

Hi, and sorry for the slow response; I hope it's still useful, given that I added extensive examples and further functions! Let me first explain why your examples do or don't work: When you write the MPO grid as W_0 = (S^z, S^x); W_1 = (N, N^2)^T or as in the last example, The [tenpyclass=tenpy.netw...
by Johannes
22 Jul 2022, 08:40
Forum: HowTos and FAQ for TeNPy
Topic: term_correlation_function_left for MPSEnvironment
Replies: 3
Views: 2343

Re: term_correlation_function_left for MPSEnvironment

You can also do SpIdSm = tenpy.networks.site.kron(s.Sp, s.Id, S.Sm, group=False) The tenpy.networks.site.kron function with n input onsite operators generates an operator acting on n consecutive sites at once, with n input and n output legs, e.g for n=3, p0*, p1*, p2*, p0, p1, p2 . The expectation_v...
by Johannes
19 Jul 2022, 10:22
Forum: HowTos and FAQ for TeNPy
Topic: reset environment
Replies: 1
Views: 19486

Re: reset environment

Since you fully re-initialize the TwoSiteDMRGEngine in the example you sent without passing the environment, you actually don't reuse the environment here. You define a new (random) product_state , but don't use it to initialize psi itself, I assume you also do that within the loop? And what exactly...
by Johannes
19 Jul 2022, 09:55
Forum: HowTos and FAQ for TeNPy
Topic: term_correlation_function_left for MPSEnvironment
Replies: 3
Views: 2343

Re: term_correlation_function_left for MPSEnvironment

Really, the proper functions is to adjust the *correlation_function methods of the MPS to the MPSEnvironment, see the new 173 . If you really just need the nearest-neighbor correlations, the expectation_value actually supports this: import tenpy s = tenpy.networks.site.SpinHalfSite() psi = tenpy.net...
by Johannes
18 Jul 2022, 16:09
Forum: HowTos and FAQ for TeNPy
Topic: Hermitian conjugate for coupled system
Replies: 1
Views: 1423

Re: Hermitian conjugate for coupled system

The first example adds terms b^\dagger_{x,0} b_{x,1} n_{x+1,1} + b^\dagger_{x,1} b_{x,0} n_{x+1,0} , which is not hermitian due to the switch in the n index. DMRG (or more precisely the Lanczos called by DMRG) always assumes a hermitian Hamiltonian! The "poorly conditioned Lanczos" is like...