Search found 468 matches

by Johannes
10 Apr 2024, 16:50
Forum: HowTos and FAQ for TeNPy
Topic: Asimmetry in trivial 2D expansion using TDVP
Replies: 2
Views: 58330

Re: Asimmetry in trivial 2D expansion using TDVP

This reminds me of one of my first work on tensor networks, 1509.00696 - using back then new W_II method that we now have in the ExpMPOEvolution in TeNPy :-) While the Hamiltonian is symmetric under exchange of x/y, the MPS snaking through the square lattice explicitly breaks it - hopping in y-direc...
by Johannes
10 Apr 2024, 16:16
Forum: HowTos and FAQ for TeNPy
Topic: Strange timing data for DMRG applied to Fermi-Hubbard model
Replies: 1
Views: 22370

Re: Strange timing data for DMRG applied to Fermi-Hubbard model

To reliably benchmark DMRG, I recommend to pin the number of sweeps by setting min_sweeps=max_sweeps to some fixed number - the total run time is just proportional to the number of sweeps, and how many sweeps it does can sometimes depend on subtle differences in convergence thresholds. Indeed, your ...
by Johannes
10 Apr 2024, 15:42
Forum: HowTos and FAQ for TeNPy
Topic: How to improve calculation accuracy in real time evolution ?
Replies: 1
Views: 23521

Re: How to improve calculation accuracy in real time evolution ?

Tenpy also tries to solve the schrlödinger equation... I guess you compared to exact evolution for a non-interacting system, or exact diagonalization? TDVP does the time evolution with the effective Hamiltonian, i.e. H projected onto the local single-site/two-site MPO. If you have only bond dimensio...
by Johannes
10 Apr 2024, 15:17
Forum: HowTos and FAQ for TeNPy
Topic: Compressing an MPO
Replies: 1
Views: 23968

Re: Compressing an MPO

At the moment, we don't have this implemented in TeNPy. For finite MPS and small enough systems, you can indeed do this with a simple SVD compression. But for larger and in particular infinite MPS/MPOs, there's some subtleties in doing this, because the MPO is in a Jordan-block form. See 1909.06341 ...
by Johannes
10 Apr 2024, 15:11
Forum: HowTos and FAQ for TeNPy
Topic: Correlators using iDMRG
Replies: 1
Views: 31010

Re: Correlators using iDMRG

Yes, even if the MPS unit cell is 2, you can have correlations in the MPS way beyond those 2 sites. You can for example call correlation_function with sites2=range(50) to calculate correlations up to site 50, or term_correlation_function_right . And yes, you can also extract the central charge by a ...
by Johannes
10 Apr 2024, 15:00
Forum: HowTos and FAQ for TeNPy
Topic: Tensor network implementations for transformers and LLMs
Replies: 1
Views: 21665

Re: Tensor network implementations for transformers and LLMs

No. TeNPy is focusing on the simulation of condensed matter physics.
by Johannes
10 Apr 2024, 14:58
Forum: HowTos and FAQ for TeNPy
Topic: How to add couplings correctly for iDMRG?
Replies: 1
Views: 23340

Re: How to add couplings correctly for iDMRG?

First of all, let me clarify, also for those finding this question later: The system purely 1D / we ignore the y direction, right? I.e. when we talk about periodic boundary conditions, we don't talk about wrapping things on a cylinder or torus or plane, but about a chain (open boundary conditions, O...
by Johannes
10 Apr 2024, 14:07
Forum: HowTos and FAQ for TeNPy
Topic: Finding ground states of finite systems with fast vanishing gap
Replies: 1
Views: 21326

Re: Finding ground states of finite systems with fast vanishing gap

When you need chi=256 for L=8, you apparently have local hilbert space dimension of 4 - is it a spin-full fermion site? Do you have any charge conservation/symmetries in general? DMRG should usually be able to converge L=32/64 pretty easily. One issue you can have though are close to exact degenerac...
by Johannes
10 Apr 2024, 13:14
Forum: HowTos and FAQ for TeNPy
Topic: Implementing XXZ model with finite DMRG
Replies: 1
Views: 64557

Re: Implementing XXZ model with finite DMRG

1. Yes - as noted in the comment at the top of the xxz_chain.py implementation. 2. You can always go back in the git history and find it there with git log --all -- examples/xxz_groundstate.py which brings up d1dccf29ee50899451ea95931c5f4216efae8e56 .' 3. For finite, critical 1D systems, the famouse...
by Johannes
10 Apr 2024, 12:40
Forum: Implementations
Topic: Error bar in the calculated entanglement spectrum
Replies: 2
Views: 84469

Re: Error bar in the calculated entanglement spectrum

Whit error bar you mean "what values do I consider degenerate"? Don't choose that value too small based on what the norm error is: the error in the entanglement spectrum depends drastically on how high the value is. If you plot the full spectrum up to the chi_max, the highest values in the...
by Johannes
10 Apr 2024, 12:10
Forum: Implementations
Topic: fully connected model
Replies: 1
Views: 54970

Re: fully connected model

Disclaimer: You already said that MPS are not a good idea for this kind of model... That said, I can point you to you misunderstanding: the add_coupling method is for adding a bunch of terms at once, all of the form \sum_i J_{i, i+dx} A_i B_{i+dx} . You want to add a single term A_i B_j , which is w...
by Johannes
12 Jan 2024, 11:10
Forum: Algorithms
Topic: Choosing dt for time evolve
Replies: 1
Views: 86772

Re: Choosing dt for time evolve

There's no simple, generic rule how large/small dt has to be to ensure convergence, I'm somewhat alarmed by the "periodic boundary conditions". By default, in TeNPy this would just give you one (or ~Ly, if you have a 2D torus) very long-range couplings between the ends of the MPS. Both TDV...
by Johannes
12 Jan 2024, 10:34
Forum: HowTos and FAQ for TeNPy
Topic: How do I calculate an MPO using an iMPS
Replies: 1
Views: 34837

Re: How do I calculate an MPO using an iMPS

This is ill-defined for infinite systems: The overlap \braket{s | t} for any two iMPS which do not represent exactly the same state goes to 0 in the the thermodynamic limit (or to infinity, if you don't have normalized MPS.). Also, you generally don't want to write down "cat state" superpo...
by Johannes
23 Nov 2023, 08:31
Forum: HowTos and FAQ for TeNPy
Topic: How to realize SU(2) symmetric DMRG?
Replies: 2
Views: 42634

Re: How to realize SU(2) symmetric DMRG?

You should be able to get to significantly larger system sizes even on desktops. Typical run times range from several hours up to a couple of days (up to one or two weeks) on typical desktops / single-node cluster machines, depending on what's available to you. The usual geometry of choice are long,...
by Johannes
22 Nov 2023, 11:22
Forum: HowTos and FAQ for TeNPy
Topic: Installation TenPy on Windows with pip
Replies: 1
Views: 29811

Re: Installation TenPy on Windows with pip

I'm afraid we can't help much there. How did you install Python? For windows, in my experience the anaconda suite works best, for which you should be able to directly install the corresponding physics-tenpy conda package rather than install it from source. Can you import numpy directly from within y...
by Johannes
22 Nov 2023, 11:04
Forum: HowTos and FAQ for TeNPy
Topic: How to compute inner product of finite MPS with another finite MPS translated by n sites.
Replies: 2
Views: 42579

Re: How to compute inner product of finite MPS with another finite MPS translated by n sites.

The picture you drew above is also not an inner product with the remaining open legs - do you think about closing those as well? That would mean that T is the translation operator with *periodic* boundary conditions. It's not too hard to contract all of this on the tensor level, though. I started wr...
by Johannes
22 Nov 2023, 09:55
Forum: HowTos and FAQ for TeNPy
Topic: How to build a pure entangled initial state
Replies: 2
Views: 35760

Re: How to build a pure entangled initial state

Indeed, Markus is right that singlets are only one example of entangled states. But they're only entangled on pairs of sites, so for more than 2 sites they're "product states" again. Really, you need to clarify which entangled state you want - there are plenty. For example, you could also ...
by Johannes
31 Oct 2023, 14:02
Forum: Implementations
Topic: Entanglement Entropy for len(segment)>20
Replies: 1
Views: 80164

Re: Entanglement Entropy for len(segment)>20

There is a good reason for this, since it's exponentially expensive with the number of sites L in the segment, both in memory \mathcal{O}(d^{2L}) and CPU time \mathcal{O}(d^{3L}) ! Each additional site quadruples your computational cost. If you're reaching that limit, it might be better to use the e...
by Johannes
31 Oct 2023, 13:49
Forum: HowTos and FAQ for TeNPy
Topic: How to model anisotropic exchange J, single-ion anisotropy and DMI for DMRG?
Replies: 5
Views: 94422

Re: How to model anisotropic exchange J, single-ion anisotropy and DMI for DMRG?

Yes, for the DM interaction, you need to write out the cross product explicitly and add the Dx/Dy/Dz terms separately. Note that you got the signs in the cross product wrong, c.f. the code below. Again, I'm not sure if I understood correctly - it seems you want the D to depend on which pairs of NN y...
by Johannes
26 Oct 2023, 15:31
Forum: HowTos and FAQ for TeNPy
Topic: W-state as MPS
Replies: 3
Views: 42957

Re: W-state as MPS

The XX model has charge conservation of total Sz. In the zero-particle sector, you can map it exactly to a single-particle fermion hopping, and the ground state is the W state. However, this is not true in the sector of higher filling when you have peridoic boundary conditions: for the coupling goin...
by Johannes
25 Oct 2023, 15:15
Forum: HowTos and FAQ for TeNPy
Topic: W-state as MPS
Replies: 3
Views: 42957

Re: W-state as MPS

You can write this analytically as a bond-dimension 2 MPS. You can see that you need bond dimension 2, since you always have either exactly one or no 1 on the left/right of any of the two cuts (between the first two sites, or the second two sites). The Schmidt decomposition between the last two site...
by Johannes
25 Oct 2023, 10:31
Forum: HowTos and FAQ for TeNPy
Topic: purification method for Fermi Hubbard model
Replies: 1
Views: 33619

Re: purification method for Fermi Hubbard model

I'm not sure why you say this. The from_infiniteT method should already work with other sites, including FermionSite or SpinHalfFermionSite. It's straightforward to adjust the purification.py example to use another model like e.g. the tenpy.models.fermions.FermionChain and measure N instead of Sz. T...
by Johannes
25 Oct 2023, 10:05
Forum: HowTos and FAQ for TeNPy
Topic: Fermion Sites From Two Samples
Replies: 1
Views: 26732

Re: Fermion Sites From Two Samples

You can still use the tenpy.networks.site.set_common_charges (the multi_sites_combine_charges is deprecated) to do that. If you specify new_charges='independent' , it does exactly what you're asking for: it conserves the total charge on the f1 sites separate from the one of the f2 site. I'm not sure...
by Johannes
25 Oct 2023, 09:24
Forum: HowTos and FAQ for TeNPy
Topic: How to model anisotropic exchange J, single-ion anisotropy and DMI for DMRG?
Replies: 5
Views: 94422

Re: How to model anisotropic exchange J, single-ion anisotropy and DMI for DMRG?

Not sure what your question is - you already have a loop over the coupling_axis , that you didn't include in your sample code. Just read out different model_params and explicitly use those instead of the plain J1/J2 for the various terms, e.g. def init_terms(self, model_params): Jxx = model_params.g...
by Johannes
25 Oct 2023, 09:08
Forum: HowTos and FAQ for TeNPy
Topic: Problemm calculating H bonds
Replies: 4
Views: 35626

Re: Problemm calculating H bonds

Indeed, by adding the extra spin site on the center, you get a next-nearest neighbor hopping, so you can't use a NearestNeighborModel anymore. There's two ways to proceed: 1) Drop the inheritance from the NearestNeighborModel to not generate the H_bond. This means you can't use TEBD anymore, but the...