Search found 407 matches

by Johannes
06 Jul 2019, 17:21
Forum: Implementations
Topic: How to contribute
Replies: 0
Views: 15303

How to contribute

Hi all, so far, I've kept a ToDo-list for myself. Considering, that the list got longer instead of shorter (although I spent much time working on it), I decided to try a different approach: I open up to the community and give out small tasks to be done as issues on github. If you feel like you got a...
by Johannes
04 Jul 2019, 16:14
Forum: HowTos and FAQ for TeNPy
Topic: Finite Chain with different unit cell at the beginning
Replies: 4
Views: 5277

Re: Finite Chain with different unit cell at the beginning

Currently, there's nothing like that. I started thinking about it (and even writing the code for the , but then became busy implementing other stuff. First of all, the algorithms like DMRG don't care about the lattice, but only about the generated MPO and lat.mps_sites() defining the Hilbert space. ...
by Johannes
02 Jul 2019, 13:42
Forum: HowTos and FAQ for TeNPy
Topic: Some questions about the svd_theta
Replies: 7
Views: 6521

Re: Some questions about the svd_theta

You can only split legs that were combined previously. In TeNPy, you can see that those legs store the charge data as tenpy.linalg.charges.LegPipe instead of tenpy.linalg.charges.LegCharge . Those pipes have the additional data needed to split the legs. The matrices generated by SVD, say A_ij = U_ik...
by Johannes
01 Jul 2019, 08:29
Forum: HowTos and FAQ for TeNPy
Topic: Some questions about the svd_theta
Replies: 7
Views: 6521

Re: Some questions about the svd_theta

The conversion to_ndarray discards information (namely: which index corresponds to which charges? what are the charge blocks we have?). Thus it cannot be reverted (at least not after subsequent tensordot/svd/...) and should be avoided at all. Instead you should use the functions provided by tenpy.li...
by Johannes
28 Jun 2019, 09:45
Forum: HowTos and FAQ for TeNPy
Topic: Possible issue with single-site TDVP
Replies: 2
Views: 3549

Re: Possible issue with single-site TDVP

Thanks to [mention]mpsforphysics[/mention] for fixing this!
by Johannes
28 Jun 2019, 09:41
Forum: HowTos and FAQ for TeNPy
Topic: norm_tol parameter for DMRG
Replies: 2
Views: 8025

Re: norm_tol parameter for DMRG

1) No, it doesn't. The problem is that bringing the state into canonical form during the DMRG run will screw up the environments. Thus, the `norm_tol` is only checking if the final state returned by DMRG is in canonical form. It tries to ensure the canonical form by performing a few more environment...
by Johannes
28 Jun 2019, 09:25
Forum: HowTos and FAQ for TeNPy
Topic: DMRG sweep problems
Replies: 5
Views: 5703

Re: DMRG sweep problems

This jumping sure looks very wrong and strange. Any chance you could provide a simple example code where this happens? Do you expect a (nearly) degenerate ground state in this case? Than it might just be jumping around between different solutions. It might help to use 'chi_list' to gradually increas...
by Johannes
28 Jun 2019, 08:48
Forum: HowTos and FAQ for TeNPy
Topic: Some questions about the svd_theta
Replies: 7
Views: 6521

Re: Some questions about the svd_theta

Hi Qicheng, how exactly do you want to extract the correlation length from the B? For a finite system, this is a somewhat ill-defined question, because you have no (guaranteed) periodicity. You might want to look at the correlation functions directly and fit an exponential to that. For an infinite s...
by Johannes
28 May 2019, 20:07
Forum: HowTos and FAQ for TeNPy
Topic: periodic conditions
Replies: 7
Views: 5937

Re: periodic conditions

Exactly as in the example you posted: just specify an array/list as "strength" in add_coupling. In fact, you don't even need to define your own model, if you're happy with the XXZ Chain /SpinChain with alternating strength: from tenpy.models.xxz_chain import XXZChain model_params = { 'bc_M...
by Johannes
28 May 2019, 08:34
Forum: HowTos and FAQ for TeNPy
Topic: periodic conditions
Replies: 7
Views: 5937

Re: periodic conditions

Welcome! The first argument of add_coupling is the strenght of the coupling. It can be a single value (if the strength is uniform all over the chain/lattice), but also a numpy array or something convertible a numpy array (which is the case here). The different values just indicate that the strength ...
by Johannes
15 May 2019, 13:47
Forum: Releases
Topic: Release v0.4.0
Replies: 0
Views: 13516

Release v0.4.0

Version 0.4.0 has been released. Before updating , please read the release notes . It is now supported to install TeNPy with pip via pip install --upgrade physics-tenpy # for 'stable' versions I'd recommend an installation with pip if you do not intend to modify the source files of TeNPy at any poin...
by Johannes
07 May 2019, 13:28
Forum: HowTos and FAQ for TeNPy
Topic: add_coupling in SpinModel
Replies: 4
Views: 4339

Re: add_coupling in SpinModel

These operators do not commute here because they are acting on the same site. \sigma_i and \tau_i certianly do commute, which is obvious if you don't think in the grouped-site picture. In other terms, your hamiltonian is \begin{align} H &= J \sum_{<i,j>} (\sigma^x_i \sigma^x_j + \sigma^y_i \sig...
by Johannes
06 May 2019, 13:52
Forum: HowTos and FAQ for TeNPy
Topic: add_coupling in SpinModel
Replies: 4
Views: 4339

Re: add_coupling in SpinModel

Writing this with Hermitian conjugates, 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^+_j S^-_i)^\dagger) + \left( \frac{J_x - J_y}{4} \right)(S^+_i S^+_j + (S^+_j S^+_i)^\dagger) Sorry, but I disagree. Using h.c. it reads: J_x S^x_i S^x_j + J_y S^y_...
by Johannes
03 May 2019, 14:54
Forum: HowTos and FAQ for TeNPy
Topic: How to get the data of NPC arrays
Replies: 1
Views: 2594

Re: How to get the data of NPC arrays

The _data attribute of an tenpy.linalg.np_conserved.Array is a list with individual blocks of the tensor. Even without charges, there can be subblocks defined. this is the case for an MPO to exploit the sparseness of an MPO - if you write the Matrix, there are usually lot's of zeros, e.g. in your ca...
by Johannes
29 Apr 2019, 16:14
Forum: HowTos and FAQ for TeNPy
Topic: Cython compilation error
Replies: 5
Views: 6131

Re: Cython compilation error

Qottmann wrote: 29 Apr 2019, 15:03 ... but at least it is running now.
Glad to hear that :D
by Johannes
29 Apr 2019, 13:54
Forum: HowTos and FAQ for TeNPy
Topic: Cython compilation error
Replies: 5
Views: 6131

Re: Cython compilation error

Did you do the sudo apt-get install build-essential?
Or in other words, do you have a working C++ compiler?
by Johannes
29 Apr 2019, 09:27
Forum: HowTos and FAQ for TeNPy
Topic: Cython compilation error
Replies: 5
Views: 6131

Re: Cython compilation error

This looks like a linking error. What OS are you using? Can you compile the first minimal example from http://docs.cython.org/en/latest/src/quickstart/build.html? Another minimal example with numpy: save this code as "a.pyx". cimport numpy as cnp import numpy as np cnp.import_array() def m...
by Johannes
23 Apr 2019, 08:47
Forum: Implementations
Topic: Triangular Lattice
Replies: 4
Views: 11985

Re: Triangular Lattice

Implemented ;)
by Johannes
19 Apr 2019, 09:34
Forum: HowTos and FAQ for TeNPy
Topic: Memory saving options in dmrg
Replies: 2
Views: 3337

Re: Memory saving options in dmrg

unfortunately, this is currently not implemented in TeNPy :( What you need to do is to write a custom tenpy.networks.mpo.MPOEnvironment which stores the tensors to disk instead of keeping them in the _LP and _RP lists. It should suffice to overwrite the get_LP, get_RP, set_LP, set_RP , del_LP, del_R...
by Johannes
18 Apr 2019, 15:55
Forum: HowTos and FAQ for TeNPy
Topic: Interpenetrating Lattices
Replies: 2
Views: 2946

Re: Interpenetrating Lattices

Currently, there is nothing to directly support this in TeNPy. What you need to do is implement your own lattice (as a subclass of tenpy.models.lattice.Lattice ). Example: import numpy as np from tenpy.models import lattice from tenpy.networks import site class MyLattice(lattice.Lattice): def __init...
by Johannes
18 Apr 2019, 13:02
Forum: Implementations
Topic: Triangular Lattice
Replies: 4
Views: 11985

Re: Triangular Lattice

Agreed. The Triangular lattice is basically just a simple square lattice with one of the basis vectors rotated by 30 degrees towards the other. I'd suggest to use basis = np.array([[0.5 *np.sqrt(3), 0.5], # first basis vector [0., 1.]]) # second basis vector: y-direction If you quickly write down th...
by Johannes
17 Apr 2019, 14:21
Forum: HowTos and FAQ for TeNPy
Topic: Performing TEBD for NNN interactions
Replies: 1
Views: 2744

Re: Performing TEBD for NNN interactions

Currently, the swapping for TEBD is not supported, although it should not be too difficult to implement, following the way you have outlined. There are a few things to be careful about, though: You need to adjust the existing model code to get the exponentials of the NNN terms. avoid onsite terms ap...
by Johannes
17 Apr 2019, 13:43
Forum: HowTos and FAQ for TeNPy
Topic: Suggestions for computing entanglement eigenvectors
Replies: 2
Views: 2944

Re: Suggestions for computing entanglement eigenvectors

What exactly do you mean by computing the entanglement eigenvectors? The eigenvectors of which matrix? For a finite system, I could imagine to look at individual Schmidt vectors (=singular vectors) on the left or right of a given cut in the form of an MPS. You can obtain them by just the part of the...
by Johannes
17 Apr 2019, 13:35
Forum: HowTos and FAQ for TeNPy
Topic: correlation length and charge sector
Replies: 1
Views: 2504

Re: correlation length and charge sector

Good question, thanks for pointing that out. The dominant eigenvector with eigenvalue 1 should always be in 0 charge sector: in canonical form the dominant eigenvector is just the identity, which has no charge. But I agree that it is not clear a priori (at least not to me) in which sector the next t...
by Johannes
28 Mar 2019, 11:07
Forum: HowTos and FAQ for TeNPy
Topic: TF Ising Magnetization issues
Replies: 2
Views: 3801

Re: TF Ising Magnetization issues

Short answer : Try measuring correlation functions, or expectation values of |M| or M^2 instead of M=\sum_i X_i ;) Reason : You try to observe spontaneous symmetry breaking. By definition, spontaneous symmetry meaking means that you have a degenerate ground state (in the thermodynamic limit): the s...