Search found 30 matches
- 13 Feb 2025, 15:19
- Forum: HowTos and FAQ for TeNPy
- Topic: Ordering of exact diagonalization basis
- Replies: 5
- Views: 29649
Re: Ordering of exact diagonalization basis
Hi Johannes and Jakob, Thank you again for your answers and suggestions to this question. I have had a chance to think about this now and I think that these suggestions do not solve the problem. I will try to explain more clearly with a fully self-contained minimal example. Here is my example script...
- 06 Feb 2025, 11:09
- Forum: HowTos and FAQ for TeNPy
- Topic: Ordering of exact diagonalization basis
- Replies: 5
- Views: 29649
Re: Ordering of exact diagonalization basis
I see, that's great to hear. In that case, I will not dig too deep into this. Thank you!
- 24 Jan 2025, 08:51
- Forum: HowTos and FAQ for TeNPy
- Topic: Ordering of exact diagonalization basis
- Replies: 5
- Views: 29649
Re: Ordering of exact diagonalization basis
Ah I see, it is lexiographically sorted by `qmap`. Thank you, I will try out these suggestions to restore the conventional ordering of the statevectors. As long as one of these methods is faster than explicitly checking/converting each product state MPS, then it should be an improvement.
- 20 Jan 2025, 15:39
- Forum: HowTos and FAQ for TeNPy
- Topic: Ordering of exact diagonalization basis
- Replies: 5
- Views: 29649
Ordering of exact diagonalization basis
I am trying to match the results of TeNPy with a few other codes and am trying to figure out the TeNPy convention for the ordering of the basis in ExactDiag. For example, if we have SpinHalfFermionSites with 3 sites and (2, 2) electrons, then in total the Hilbert space has dimension 9 (N and Sz are ...
- 15 Dec 2020, 14:40
- Forum: HowTos and FAQ for TeNPy
- Topic: Bosonic Haldane Model
- Replies: 2
- Views: 4647
Re: Bosonic Haldane Model
Thanks for spotting this and apologies for the slow reply. The will have consequences for any case where the chemical potential is non-zero. This does not effect the example default parameters but it's good that it's fixed now.
- 14 Jun 2019, 15:50
- Forum: HowTos and FAQ for TeNPy
- Topic: DMRG sweep problems
- Replies: 5
- Views: 9480
Re: DMRG sweep problems
I am also having convergence problems getting the FCI phase from arxiv:1407.6985 . I have tried it for bosons, every permutation of the initial product state, different system sizes, with/without mixer, etc. Without interaction everything works fine for me, and I get the same figures as in the paper...
- 07 May 2019, 14:07
- Forum: HowTos and FAQ for TeNPy
- Topic: add_coupling in SpinModel
- Replies: 4
- Views: 6852
Re: add_coupling in SpinModel
Thank you for the clarification, and tips for further speedup! It's helpful to know that I am roughly on the right lines with this now. Thanks again 

- 07 May 2019, 11:02
- Forum: HowTos and FAQ for TeNPy
- Topic: add_coupling in SpinModel
- Replies: 4
- Views: 6852
Re: add_coupling in SpinModel
Thank you for quick reply and explanation - this makes sense and is surely correct. I was trying to implement a more complicated Hamiltonian, which then made me generally confused... :oops: I am looking at a Hamiltonian of the form: H = J \sum_{<i,j>}\sum_{a,b=1}^3 T^{ab}_i T^{ab}_j where \sigma^a a...
- 06 May 2019, 13:02
- Forum: HowTos and FAQ for TeNPy
- Topic: add_coupling in SpinModel
- Replies: 4
- Views: 6852
add_coupling in SpinModel
I am not sure how the add_couplings in ``models/spins.py`` are constructed (for the Jx and Jy terms). When I use the substitutions S^\pm=S^x \pm \mathrm{i} S^y , I get: J_x S^x_i S^x_j + J_y S^y_i S^y_j = \left( \frac{J_x + J_y}{4} \right)(S^+_i S^-_j + S^-_i S^+_j) + \left( \frac{J_x - J_y}{4} \rig...
- 24 Apr 2019, 07:26
- Forum: HowTos and FAQ for TeNPy
- Topic: norm_tol parameter for DMRG
- Replies: 2
- Views: 10286
norm_tol parameter for DMRG
I am searching for a way to reliably get rid of the warning: /TeNPy/tenpy/algorithms/dmrg.py:523: UserWarning: final DMRG state not in canonical form within `norm_tol` = 1.00e-06 warnings.warn(msg.format(nt=norm_tol)) I have tried running a simulation with the following DMRG parameters: dmrg_params ...
- 24 Apr 2019, 06:56
- Forum: HowTos and FAQ for TeNPy
- Topic: Interpenetrating Lattices
- Replies: 2
- Views: 4658
Re: Interpenetrating Lattices
Thank you for the quick reply, and the example with plot is much appreciated! 

- 24 Apr 2019, 06:42
- Forum: Implementations
- Topic: Triangular Lattice
- Replies: 4
- Views: 32947
Re: Triangular Lattice
Thank you very much! 

- 18 Apr 2019, 14:53
- Forum: Implementations
- Topic: Triangular Lattice
- Replies: 4
- Views: 32947
Re: Triangular Lattice
Using this basis, for a point at the origin: There are 6 NN at a distance 1. There are 6 nNN at a distance sqrt(3). There are 6 nnNN at a distance 2. NN = {1/2 {Sqrt[3], 1}, {0, 1}, -(1/2) {Sqrt[3], 1}, -{0, 1}, 1/2 {Sqrt[3], -1}, 1/2 {-Sqrt[3], 1}}; nNN = {{Sqrt[3], 0}, {-Sqrt[3], 0}, 1/2 {Sqrt[3],...
- 18 Apr 2019, 14:12
- Forum: HowTos and FAQ for TeNPy
- Topic: Interpenetrating Lattices
- Replies: 2
- Views: 4658
Interpenetrating Lattices
What is the best way to implement interpenetrating lattices in TeNPy? Simple example: a square lattice with alternating one-orbital GroupedSite and three-orbital GroupedSite (like a checkerboard). Or, alternatively, a honeycomb lattice with a triangular lattice on top (where the triangular lattice i...
- 18 Apr 2019, 12:44
- Forum: Implementations
- Topic: Triangular Lattice
- Replies: 4
- Views: 32947
Triangular Lattice
It would be useful to have an implementation for a triangular lattice integrated into the main code (tenpy.models.lattice), since it comes up so frequently. Many thanks 

- 19 Feb 2019, 08:08
- Forum: HowTos and FAQ for TeNPy
- Topic: Interpretation of qnumber>1 for Entanglement Spectra
- Replies: 3
- Views: 7016
Re: Interpretation of qnumber>1 for Entanglement Spectra
Thank you for the clarification and for making me aware of the chinfo attribute, so that I can double-check the qnumbers myself. This has answered my question - thanks again! 

- 18 Feb 2019, 08:49
- Forum: HowTos and FAQ for TeNPy
- Topic: Interpretation of qnumber>1 for Entanglement Spectra
- Replies: 3
- Views: 7016
Re: Interpretation of qnumber>1 for Entanglement Spectra
UPDATE: I have noticed that when I use a model with spinless fermions, there is only one qnumber instead of two (as for fermions with spin). Does this mean that the second qnumber had something to do with spin? Do these qnumbers originate from the conserved quantities that I specify in model_params?...
- 14 Feb 2019, 16:04
- Forum: HowTos and FAQ for TeNPy
- Topic: Twisted Boundary Conditions for a CouplingMPOModel
- Replies: 3
- Views: 8130
Twisted Boundary Conditions for a CouplingMPOModel
I would like to plot spectral flow plots similar to Fig.2.b)/d) of this paper https://arxiv.org/abs/1407.6985 Fig2.png Quote about implementation of Fig.2.b)/d) from the paper: The flux \Phi_y threading through the cylinder is implemented in the MPO Hamiltonian by twisting the boundary conditions su...
- 14 Feb 2019, 15:42
- Forum: HowTos and FAQ for TeNPy
- Topic: Interpretation of qnumber>1 for Entanglement Spectra
- Replies: 3
- Views: 7016
Interpretation of qnumber>1 for Entanglement Spectra
I would like to plot an entanglement spectrum similar to Fig.3.b) of this paper https://arxiv.org/abs/1407.6985 Fig3.png Quote about the coloring of Fig.3.b): The entanglement spectrum can be resolved further into distinct U(1) charge sectors Q_{\alpha}^L\in \mathbb{Z} where Q_{\alpha}^L label the U...
- 14 Feb 2019, 10:20
- Forum: HowTos and FAQ for TeNPy
- Topic: Scaling of entanglement entropy for iDMRG
- Replies: 7
- Views: 12746
Re: Scaling of entanglement entropy for iDMRG
Hi Umberto, thank you for the reply and for the useful link! I hadn't seen that paper before, but it does suggest that the original formula was correct after all. In which case, I wonder why I cannot reproduce it... I am trying in the most naive way using the example_DMRG_infinite(g=1.) function fro...
- 14 Feb 2019, 09:28
- Forum: HowTos and FAQ for TeNPy
- Topic: Investigations of the Hubbard model
- Replies: 2
- Views: 6832
Re: Investigations of the Hubbard model
Thank you for confirming the general set-up and for making me suspicious of my \chi -value :lol: I will check my results for convergence with a larger \chi when I have more compute time available. The middle two questions were in a way connected because the vast majority of results in the literature...
- 14 Feb 2019, 08:06
- Forum: HowTos and FAQ for TeNPy
- Topic: perm parameter in compute_K function
- Replies: 2
- Views: 13965
Re: perm parameter in compute_K function
Thank you for the clarification!
In that case, I will use the following:
Thank you for explaining how this works, and for the "verbose=2" tip to check that everything is being permuted as it should.

Python: Select all
psi.compute_K(perm=M.lat) # where M is your model
- 05 Feb 2019, 11:17
- Forum: HowTos and FAQ for TeNPy
- Topic: perm parameter in compute_K function
- Replies: 2
- Views: 13965
perm parameter in compute_K function
What is the correct way to define perm in the compute_K function? I know that the wave function should be invariant under the rotation/permutation and so I need to check that the ov returned by compute_K is close to one. However, I am not sure how to define the correct permutation. e.g. for an initi...
- 31 Jan 2019, 16:10
- Forum: HowTos and FAQ for TeNPy
- Topic: Investigations of the Hubbard model
- Replies: 2
- Views: 6832
Investigations of the Hubbard model
I am in the process of testing the spin-1/2 Fermi-Hubbard model on a square lattice (infinite cylinder) with Hamiltonian: H = \sum_{\langle i, j \rangle, i < j, \sigma} t (c^{\dagger}_{\sigma, i} c_{\sigma j} + \text{H.c.}) + \sum_i U n_{\uparrow, i} n_{\downarrow, i} , where \langle i, j \rangle, i...
- 30 Jan 2019, 13:32
- Forum: HowTos and FAQ for TeNPy
- Topic: How to generate a random MPS in tenpy
- Replies: 5
- Views: 12429
Re: How to generate a random MPS in tenpy
I'm not sure exactly which type of random MPS you're looking for, however for a spin-1/2 example, I would do something like this to generate a random initial product state: product_state = [] for i in range(M.lat.N_sites): product_state.append(random.choice(["up", "down"])) psi =...