Search found 457 matches
- 22 Jan 2025, 15:47
- Forum: HowTos and FAQ for TeNPy
- Topic: Ordering of exact diagonalization basis
- Replies: 2
- Views: 257
Re: Ordering of exact diagonalization basis
Hi Bart, it's essentially defined by the following line in ExactDiag.__init__() self._pipe = npc.LegPipe(legs, qconj=1, sort=(not sparse), bunch=(not sparse)) Unless you use the `sort=False` keyword, the pipe internally sorts by charge values, more precises such that it's `qmap` is lexiographically ...
- 22 Jan 2025, 14:18
- Forum: HowTos and FAQ for TeNPy
- Topic: Hamiltonian MPO of different kinds of spins
- Replies: 3
- Views: 819
Re: Hamiltonian MPO of different kinds of spins
The fact that you get bond dimension 2 on the boundaries is for technical reasons that we add the "IdL" (ready) and "IdR" (final) states of the MPO finite state machine on each bonds. If you don't want that, overwrite calc_H_MPO in the model by copy-pasting the current implementa...
- 07 Jan 2025, 13:53
- Forum: HowTos and FAQ for TeNPy
- Topic: computing correlation function and expectation value
- Replies: 1
- Views: 7161
Re: computing correlation function and expectation value
This should really give the same. It's been a while since you wrote this - has this been resolved by now? I quickly tried to reproduce this for a random MPS, but it seemed to work as expected. If you still find differences, it would be great if you can open an issue on github and provide a (minimal ...
- 07 Jan 2025, 12:49
- Forum: HowTos and FAQ for TeNPy
- Topic: iDMRG Convergence Issues in 2D Triangular Lattice XXZ Model
- Replies: 2
- Views: 10323
Re: iDMRG Convergence Issues in 2D Triangular Lattice XXZ Model
Try increasing/varying Lx until you see convergence! In general, if you expect symmetry breaking, the ground state with broken symmetry should be commensurate, i.e. the symmetry broken pattern needs to fit into your iDRMG unit cell! Otherwise, the MPS needs to become a "cat" state with mul...
- 07 Jan 2025, 12:40
- Forum: HowTos and FAQ for TeNPy
- Topic: Hamiltonian MPO of different kinds of spins
- Replies: 3
- Views: 819
Re: Hamiltonian MPO of different kinds of spins
I would recommend to use the tenpy.models.model.CouplingMPOModel , and override the methods as detailed in the model user guide . Since you have all-to-all interactions, you don't really have a chain, so you can use a TrivialLattice to write this down - but that implies that you have to manually sum...
- 07 Jan 2025, 11:04
- Forum: HowTos and FAQ for TeNPy
- Topic: Can SpinChainNNN2 in the limits of the TFIM generate same results as TFIModel?
- Replies: 1
- Views: 614
Re: Can SpinChainNNN2 in the limits of the TFIM generate same results as TFIModel?
To detect spontaneous symmetry breaking, you shouldn't check the magnetization: it is only nonzero in the symmetry broken states, but you can write an (anti)-symmetric superposition of the symmetry-broken states which has magnetization 0. Instead, you should check the decay of correlations at long d...
- 14 Oct 2024, 13:46
- Forum: HowTos and FAQ for TeNPy
- Topic: controlling particle number of independent species
- Replies: 4
- Views: 10787
Re: controlling particle number of independent species
You have to be a bit more specific - your question is very generic, so I can only guess what your problem might be... What's your lattice, how did you get the 0, 1 and 20, 21 indices in your question? I would assume that you would rather want something like Corr=psi.term_rorrelation_function_right([...
- 30 Sep 2024, 07:17
- Forum: HowTos and FAQ for TeNPy
- Topic: problem about installing tenpy
- Replies: 2
- Views: 7167
Re: problem about installing tenpy
The python ecosystem is a bit confusing with the different ways you can have "virtual environments" in which you can install packages - see this famous xkcd comic , and the situation has not really become better since the comic came out - now you additionally have conda envrionments, and s...
- 25 Sep 2024, 16:23
- Forum: HowTos and FAQ for TeNPy
- Topic: controlling particle number of independent species
- Replies: 4
- Views: 10787
Re: controlling particle number of independent species
I'm not sure what your Hamiltonian is, here - do you have boson hopping between the upper and lower part where you set \mu_{up} and \mu_{down} , respectively, or is there only a density-density interaction? You can only use charge conservation to preserve the respective fillings if H commutes with N...
- 25 Sep 2024, 16:07
- Forum: HowTos and FAQ for TeNPy
- Topic: controlling particle number of independent species
- Replies: 4
- Views: 10787
controlling particle number of independent species
I got the following question by email: I encountered some difficulties when setting conserved quantities. I filled two types of bosons in a two-dimensional bosonsite, and I want to control the filling numbers for each boson. Usually, I control the filling number by controlling their chemical potenti...
- 25 Sep 2024, 16:03
- Forum: HowTos and FAQ for TeNPy
- Topic: How to plot spin structure?
- Replies: 1
- Views: 7586
Re: How to plot spin structure?
AFM, FM, 120°AFM mean that the system spontaneously breaks the symmetry, i.e. you have degenerate ground states. It's important to distinguish between continous and discrete symmetries, which you break here. If you enforce charge conservation, this might indeed force DMRG to write a superposition of...
- 25 Sep 2024, 15:39
- Forum: HowTos and FAQ for TeNPy
- Topic: Units of exchange coupling and DMI/anisotropic J
- Replies: 1
- Views: 7843
Re: Units of exchange coupling and DMI/anisotropic J
1.) Hmm, good question. I never tried, but I'm afraid it wouldn't go well, and strongly advise against it. In theory, I agree that you can choose arbitary units and scale all terms in the hamiltonian accordingly. In practice, we have several points where we discard everything on the order of machine...
- 25 Sep 2024, 15:19
- Forum: HowTos and FAQ for TeNPy
- Topic: Strategies to run large-memory calculations?
- Replies: 1
- Views: 7363
Re: Strategies to run large-memory calculations?
I guess I'm late for you to solve the problem, but maybe as a hint for people trying to solve it in the future: The #SBATCH --nodes=2 asks SLURM for 2 nodes with MPI paralellization. TeNPy can not utilize that (unless you're working in the mpi_parallel branch, which is for very specific use cases on...
- 25 Sep 2024, 14:44
- Forum: HowTos and FAQ for TeNPy
- Topic: Why is finite DMRG running so slowly?
- Replies: 1
- Views: 6257
Re: Why is finite DMRG running so slowly?
TeNPy has comparable speed with other libraries like ITensor , if you fix parameters for a fair comparison. One big difference is the default dmrg_params['lanczos_params']['N_max'] , the maximum number of lanczos iterations for finding the "ground state" before moving on to the next site. ...
- 25 Sep 2024, 14:30
- Forum: HowTos and FAQ for TeNPy
- Topic: Variance of purified MPS state
- Replies: 2
- Views: 7216
Re: Variance of purified MPS state
It's not hard to generalize and adjust the source of that variance function to work with purificationMPS - all you need to do is to initially check whether you have the additional q leg (at the top of the function), and if so, in addition contract the additional ['q'] with ['q*'] leg in the tensordo...
- 25 Sep 2024, 14:17
- Forum: HowTos and FAQ for TeNPy
- Topic: Momentum Distribution from MPS
- Replies: 1
- Views: 6176
Re: Momentum Distribution from MPS
I'm not quite sure what you mean with "momentum distribution". What you can do is measure the correlation function corrs=psi.correlation_function('bd', b') to get \bra{\psi} b^\dagger_i b_{j} \ket{\psi} in real space, and then perform a fourier trafo on both axes, which gives you something...
- 25 Sep 2024, 14:06
- Forum: HowTos and FAQ for TeNPy
- Topic: DMRG Calculation for Large Systems
- Replies: 2
- Views: 7316
Re: DMRG Calculation for Large Systems
to put this a bit into perspective, 30 minutes of runtime is often still considered very moderate, state-of-the-art DMRG calculations for publications in journals often run several days to weeks on high-performance-computing cluster nodes with >30 cores (more powerfull than a laptop...) Also, it's i...
- 25 Sep 2024, 13:39
- Forum: HowTos and FAQ for TeNPy
- Topic: Gap in open spin chain :
- Replies: 1
- Views: 6240
Re: Gap in open spin chain :
The Warning is very relevant here: since version 0.9.0 , the `orthogonal_to` should not be an entry in the `dmrg_params`, but should be a direct keyword argument to the dmrg.run() function, i.e. somthing like dmrg.run(psi, M, dmrg_params, orthogonal_to=states) . As an alternative, you might want to ...
- 25 Sep 2024, 13:18
- Forum: HowTos and FAQ for TeNPy
- Topic: How to model anisotropic exchange J, single-ion anisotropy and DMI for DMRG?
- Replies: 5
- Views: 34905
Re: How to model anisotropic exchange J, single-ion anisotropy and DMI for DMRG?
1) If you look at the imange of the tenpy.models.lattice.Triangular lattice, you'll see that it's 30 degrees rotatet compared to your image - that's the pi/6 offsett here. 2) If you explicitly have Jxy, Jyx etc, then these will contribute to the very same "terms" Sx_i Sy_j etc that the DMI...
- 25 Sep 2024, 13:04
- Forum: HowTos and FAQ for TeNPy
- Topic: Custom Hamiltonian with multiple fermions and conserved charges
- Replies: 1
- Views: 6267
Re: Custom Hamiltonian with multiple fermions and conserved charges
Not sure if this is still relevant or solved by now, but anyways: the issue here is that the tenpy.models.lattice.Chain expects that it has a single-site unit cell only. Try using a more general lattice that allows for multiple sites in the MPS unit cell. The "correct" or recommend way in ...
- 25 Sep 2024, 12:35
- Forum: HowTos and FAQ for TeNPy
- Topic: Different coupling terms on different sites
- Replies: 7
- Views: 24647
Re: Different coupling terms on different sites
As documented, the
strength
argumente of add_coupling can be a numpy array - for a square lattice with Lx by Ly sites, for nearest-neighbor hopping/interaction in y -direction, it could be of shape (Lx, Ly-1), or for the one in x-direction (Lx-1, Ly), respectively.- 27 May 2024, 16:08
- Forum: HowTos and FAQ for TeNPy
- Topic: How to evolve an infinite temperature state in a long range Hamiltonian system?
- Replies: 1
- Views: 6874
Re: How to evolve an infinite temperature state in a long range Hamiltonian system?
At the moment, you should use tenpy.algorithms.purification.PurificationApplyMPO for models with long range. (Or alternatively group sites and use the PurificationTEBD as you suggested.) TDVP doesn't work with purification at the moment. Really, we should refactor the purification code a bit such th...
- 27 May 2024, 15:51
- Forum: HowTos and FAQ for TeNPy
- Topic: Calculating Purity of PurificationMPS
- Replies: 1
- Views: 6823
Re: Calculating Purity of PurificationMPS
The best idea I can come up with on the spot would be to contract Tr(rho^2) as a tensor network from left to right. There's no function for that in TeNPy ritght now, but it shouldn't be hard to implement that. Doing this is O(chi^5), though, so it's quite expensive compared to the usual O(chi^3) sca...
- 27 May 2024, 10:34
- Forum: HowTos and FAQ for TeNPy
- Topic: Purification for Finite Temperature Simulations
- Replies: 2
- Views: 8495
Re: Purification for Finite Temperature Simulations
1) these `d` are the time steps for the time evolution that give you a second-order instead of first-order precision by canceling the error terms of O(dt^2). 2) The the new post in that topic. As I said there, it's fixed if you call psi.canonical_form() once more (at least for finite systems). Fix i...
- 27 May 2024, 10:33
- Forum: HowTos and FAQ for TeNPy
- Topic: How to define a infiniteT MPS under canonical ensemble
- Replies: 5
- Views: 16986
Re: How to define a infiniteT MPS under canonical ensemble
The fix is here: PR #414