Search found 465 matches

by Johannes
10 Jun 2022, 16:16
Forum: HowTos and FAQ for TeNPy
Topic: add_multi_coupling vs. GroupedSite
Replies: 4
Views: 12739

Re: add_multi_coupling vs. GroupedSite

Of course, both approaches can work and should give similar results eventually; but I'd usually recommend not grouping sites if you can manage to write the model without grouping. Let me elaborate: When using the tenpy.networks.site.GroupedSite , you will double your local Hilbert space dimension d ...
by Johannes
10 Jun 2022, 15:24
Forum: HowTos and FAQ for TeNPy
Topic: How to apply a quantum channel?
Replies: 2
Views: 6023

Re: How to apply a quantum channel?

I'm confused - what state do you start with? Some ground state, or other pure state, represented as an MPS? What do you want to calculate afterwards? You can use TeNPy to get the single-site reduced density matrix, and then apply the dephasing channel, but you can not apply it on the whole MPS: it's...
by Johannes
01 Jun 2022, 13:50
Forum: HowTos and FAQ for TeNPy
Topic: About the entropy growth in random unitary circuit
Replies: 2
Views: 6515

Re: About the entropy growth in random unitary circuit

With the random unitary evolution, you get an ensemble of Haar-distributed states, i.e. each normalized state has the same probability. Since there *are* states with less than maximal, but no states with more-than-maximal entropy, it is clear that the average entropy in the Haar distribution is less...
by Johannes
30 May 2022, 10:40
Forum: HowTos and FAQ for TeNPy
Topic: 1d lattice with arbitrary distribution of sites
Replies: 1
Views: 7472

Re: 1d lattice with arbitrary distribution of sites

Hi Umberto, there is a tenpy.models.lattice.TrivialLattice , which is exactly the approach 1) you described - it just takes a list of sites, and defines them as a single, big unit cell. Internally in TeNPy, this is used if you group sites together, since you then no longer have the original lattice ...
by Johannes
30 May 2022, 10:23
Forum: HowTos and FAQ for TeNPy
Topic: Alternating Heisenberg coupling at infinite chain
Replies: 4
Views: 8671

Re: Alternating Heisenberg coupling at infinite chain

I don't see the issue here, I checked that it works for an even number of couplings , where the couplings are not incommensurable. For nearest neighbor couplings A_i B_{i+1}, this means it works for (finite, odd # sites) or (infinite, even # sites), as you can easily check with the example below. No...
by Johannes
03 May 2022, 15:10
Forum: HowTos and FAQ for TeNPy
Topic: Alternating Heisenberg coupling at infinite chain
Replies: 4
Views: 8671

Re: Alternating Heisenberg coupling at infinite chain

Hi,
yes, that is correct. It works if the number of couplings is even (ie. odd number of sites for finite systems, even number of sites for infinite MPS) , otherwise it complains about incommensurate arrays for the expansion.
by Johannes
26 Apr 2022, 17:07
Forum: HowTos and FAQ for TeNPy
Topic: calculate four-point correlation function
Replies: 1
Views: 5216

Re: calculate four-point correlation function

Yes, you can do better. The explicit loops you have make this scale as O(L^3 \chi^3) , since each call to psi.expectation_value_term is O(|j+1 - i| \chi^3) . You can get this down to O(L^2 \chi^3) by using the term_correlation_function_right or ..._left, with term_L = [('Cd', 0), ('Cd', 1)], term_R=...
by Johannes
21 Apr 2022, 02:01
Forum: HowTos and FAQ for TeNPy
Topic: Charge Info for Z3 symmetry in 3-state Potts Model
Replies: 3
Views: 8950

Re: Charge Info for Z3 symmetry in 3-state Potts Model

TeNPy tries to preserve local, diagonal symmetries, in your case the Z3 symmetry (\sum_i Q_i \mod 3) where Q_i = diag(0, 1, 2) are the charge values you define. However, the Hamiltonian does not preserve these symmetries, since the \Gamma^{(1,2)}_i don't commute with this symmetry. Instead, you need...
by Johannes
18 Apr 2022, 17:18
Forum: HowTos and FAQ for TeNPy
Topic: iDMRG sweep schedule
Replies: 3
Views: 9514

Re: iDMRG sweep schedule

1) These additional sweeps are meant to (i) bring the MPS into canonical form and (ii) converge the environments. Effectively, it's mostly SVDs and environment updates, and usually cheap compared to the Lanczos optimization, so it should be "cheap" to converge things a bit better, even if ...
by Johannes
18 Apr 2022, 17:02
Forum: HowTos and FAQ for TeNPy
Topic: parallel computing
Replies: 4
Views: 11704

Re: parallel computing

The export OMP_NUM_THREADS=1 is a bash command. You should have a slurm/sge/bash script which you submit to the cluster, include this line there. For example, if you use the setup of the TeNPy project repository , you can explicitly add the corresponding line in the file cluster_templates/slurm.sh (...
by Johannes
04 Apr 2022, 17:43
Forum: HowTos and FAQ for TeNPy
Topic: TDVP time evolution with interaction / onsite state probability
Replies: 4
Views: 26678

Re: TDVP time evolution with interaction / onsite state probability

Indeed, the get_probability is not working; it even gives you wrong dimensions of the array when you go beyond 2 sites. Using the onsite reduced density matrix is as pointed out in the post you linked to is indeed one way. Another and maybe even clearer solution would be to define projection operato...
by Johannes
01 Apr 2022, 01:39
Forum: HowTos and FAQ for TeNPy
Topic: MPS winding for 'new' lattice
Replies: 2
Views: 6680

Re: MPS winding for 'new' lattice

I think you're on the right track. I presume your PhtantasticLattice is derived from the base lattice class. What you should do is override the ordering method, similar as is done in the the tenpy.models.lattice.Honeycomb lattice - take a look at the source there. You want the structure def ordering...
by Johannes
22 Mar 2022, 01:55
Forum: HowTos and FAQ for TeNPy
Topic: How Does Block Absorption Work in MPS DMRG
Replies: 1
Views: 5487

Re: How Does Block Absorption Work in MPS DMRG

Yes, the main idea is that you *never* have the Schmidt states as whole, but only as (partial) MPS, recursivley adding tensors to get the Schmidt states on the next bond; see also Figure 4 c) of our paper 1805.00055 . Indeed, the formula you wrote gives the Schmidt states |a_l> in the basis of |a_{l...
by Johannes
22 Mar 2022, 01:22
Forum: HowTos and FAQ for TeNPy
Topic: iDMRG sweep schedule
Replies: 3
Views: 9514

Re: iDMRG sweep schedule

You're referring to the update_LP_RP defined in get_sweep_schedule for n=2 , i.e. a two-site update. As you can see from the i0s, move_right variables, we do 2L updates in total, each updating 2 sites, in the order (0, 1), ..., (L-2, L-1), (L-1, L), (L, L+1), (L-1, L), ..., (1, 2) . Note that this i...
by Johannes
22 Mar 2022, 00:52
Forum: HowTos and FAQ for TeNPy
Topic: Disentangler
Replies: 1
Views: 6142

Re: Disentangler

The disentangling of purified states indeed currently only works for 1D chains where you can do TEBD. In practice, we found in 1711.01288 that only the "backwards" disentangler leads to a speed-up - while we were able to reduce the entanglement further with the other disentanglers, they di...
by Johannes
22 Mar 2022, 00:06
Forum: HowTos and FAQ for TeNPy
Topic: parallel computing
Replies: 4
Views: 11704

Re: parallel computing

Hi Ling, sorry for the late reply!
Indeed, with your question I realized that we probably don't document this sufficiently.
I've just added a corresponding section in the simulation introduction.
Does that answer your questions?
by Johannes
21 Mar 2022, 22:26
Forum: HowTos and FAQ for TeNPy
Topic: How Do I Define New Operators in TenPy
Replies: 4
Views: 11006

Re: How Do I Define New Operators in TenPy

Thanks for the reply Jirawat! Your answer nicely explains how to add an onsite operator (given as a matrix) to a local site. Expanding on this, let me just mention that for a CouplingMPOModel it should often be enough to overwrite the init_sites method. A non-trivial example adding an operator P0 pr...
by Johannes
09 Feb 2022, 08:39
Forum: Algorithms
Topic: Problems with add_local_term and H.c
Replies: 1
Views: 37727

Re: Problems with add_local_term and H.c

This case wasn't tested properly, so a bug could sneak in... I've just fixed it in 72f79cce1f7dd04607027322763db2a6b80466e3 and added proper tests. The index error indicates that you didn't actually set the option explicit_plus_hc=True , otherwise it would not have occured... You need to do that as ...
by Johannes
09 Feb 2022, 07:19
Forum: Algorithms
Topic: Question about the Hamiltonian MPO
Replies: 1
Views: 33498

Re: Question about the Hamiltonian MPO

MPOs are extensive sums of local terms; thus they take a Jordan block form W = \begin{pmatrix} 1 & C & D \\ 0 & A & B \\ 0 & 0 & 1 \end{pmatrix} = \text{e.g. for transverse field ising} \begin{pmatrix} 1 & X & - Z \\ 0 & 0 & X \\ 0 & 0 & 1 \end{pmatrix...
by Johannes
09 Feb 2022, 06:48
Forum: HowTos and FAQ for TeNPy
Topic: How to convert iMPS to finite MPS?
Replies: 2
Views: 19210

Re: How to convert iMPS to finite MPS?

Why? What do you want to do with the state afterwards? Yes, of course, you can just insert a projector onto the index with maximal singualar value at the boundary, i.e. bond dimension 1, and formally declare it a finite MPS. But this truncation is likely not the "optimal" state of maximal ...
by Johannes
27 Jan 2022, 19:58
Forum: HowTos and FAQ for TeNPy
Topic: Problems with segment boundaries for TDVP
Replies: 1
Views: 6021

Re: Problems with segment boundaries for TDVP

I'm sorry that this wasn't clear, but TeNPy's TDVP isn't intended to be used with segment boundary conditions; as of now, TeNPy only supports segment MPS for DMRG. There, the idea is to just keep the state outside of the segment (or "window" in the literature) fixed during the optimization...
by Johannes
11 Jan 2022, 10:45
Forum: HowTos and FAQ for TeNPy
Topic: How to use random MPS to acess all ground states
Replies: 2
Views: 6843

Re: How to use random MPS to acess all ground states

Since you apply 6 steps of randomizing, it might still have some "memory" of the initial state. This function takes an initlal MPS, I guess you take an initial product state. Did you try using another one? It's not completely clear to me what initial states the authors of 1208.2623 took, j...
by Johannes
11 Jan 2022, 10:26
Forum: HowTos and FAQ for TeNPy
Topic: Periodic versus Open Boundary Conditions
Replies: 5
Views: 13498

Re: Periodic versus Open Boundary Conditions

For two dimensional systems, there can be separate boundary conditions in x and y, hence the bc_x and bc_y, which really are just the two values for the bc=[bc_x, bc_y] of the lattice.
So yes, for a 1D lattice, just putting bc='periodic' is the correct thing to get periodic boundary conditions.
by Johannes
11 Jan 2022, 09:55
Forum: HowTos and FAQ for TeNPy
Topic: DMRG of Two Component Bose-Hubbard Model
Replies: 1
Views: 7239

Re: DMRG of Two Component Bose-Hubbard Model

Welcome to TenPy, happy new year, and sorry for the long delay in the answer, I had a few things I needed to finish before Christmas..... I think the issue here is that the mixer is disabled, just try setting 'mixer': True . The reason why you need the mixer is that you always just optimize two site...