ITensor Support Q&A - Recent questions and answers
http://itensor.org/support/qa
Powered by Question2AnswerSet the element in a sparse matrix
http://itensor.org/support/1384/set-the-element-in-a-sparse-matrix
<p>Hi Matt and Miles,</p>
<p>I have a simple question about the diagTensor and delta.</p>
<p>If I create a tensor using the diagTensor or delta method, then use the .set() method to modify a diagonal entry, will that change the sparse storage of the original tensor?</p>
<p>Best,</p>
http://itensor.org/support/1384/set-the-element-in-a-sparse-matrixTue, 26 Mar 2019 19:19:50 +0000U1 symmetry with different particle type
http://itensor.org/support/1382/u1-symmetry-with-different-particle-type
<p>Hello,</p>
<p>I am trying to make use of a U1 symmetry in my model and IQTensors to speed up the calculations. I have some conserved quantity that involves different particle types. For example, consider a spin 1/2 coupled to bosonic modes, where the full Hamiltonian conserves the total number of excitations (both spin and bosons) <br>
$$<br>
S = \sigma_z + \sum_x a_x^\dagger a_x.<br>
$$ <br>
where @@a@@ is a bosonic lowering operator.</p>
<p>Here is the relevant part of how I define a bosonic site:</p>
<pre><code>BosonSite(int n, Args const& args = Args::global())
{
auto d = args.getInt("d",5); //max number of bosons
auto v = stdx::reserve_vector<IndexQN>(d+1);
for (int i = 0; i <= d; ++i) {
std::string temp = nameint("n",i);
temp += "_";
temp += std::to_string(n);
v.emplace_back(Index(temp,1,Site),QN({i,1}));
}
//s = IQIndex(nameint("bose site=",n),std::move(v));
s = IQIndex(nameint("b_site=",n),std::move(v));
}
</code></pre>
<p>I have checked that if I create a boson-only SiteSet, then I can do time-evolution with a Hamiltonian that conserves the total number of bosons.<br>
However, when I create a SiteSet that contains a single spin on one site (using SpinHalfSite ) and the rest of the sites are bosonic (using BosonSite) then I get an error </p>
<pre><code>IQIndex does not contain given QN block.
Aborted (core dumped)
</code></pre>
<p>Now, I have read the iTensor book and documentation on IQTensors, but I admit that I still do not fully understand it, so I would appreciate any help with this particular example.<br>
Also, the model I am looking at is slightly more complicated with two different kinds of boson species, but I am hoping that by understanding this simple case I could solve the more general problem.</p>
<p>Thanks</p>
http://itensor.org/support/1382/u1-symmetry-with-different-particle-typeMon, 25 Mar 2019 23:20:31 +0000Answered: Use vector of doubles in Args
http://itensor.org/support/1380/use-vector-of-doubles-in-args?show=1381#a1381
<p>Hi jsf,<br>
While that's a clever way to store and retrieve values, the Args system is really intended to pass named arguments to functions, not as a database to hold arbitrary types. If we made it possible to do so, it would cause an unacceptably high performance penalty to most of the functions using Args and go beyond the intended purpose of that system.</p>
<p>Instead, you can already read and write most types used in ITensor, including standard library types such as std::vector, to files using the read and write functions provided with ITensor. Here is some example code showing how.</p>
<p>Writing objects to a file "myfile.dat":</p>
<pre><code>auto v = vector<int>(4);
v[0] = 1;
v[1] = 3;
v[2] = 5;
v[3] = 9;
auto i = Index("i",2);
auto T = randomTensor(i);
std::ofstream f("myfile.dat",std::ios::binary);
write(f,v);
write(f,i);
write(f,T);
f.close();
</code></pre>
<p>Reading the data back in from the file:</p>
<pre><code>std::ifstream f("myfile.dat",std::ios::binary);
vector<int> v;
read(f,v);
Index i;
read(f,i);
ITensor T;
read(f,T);
f.close();
Print(v.size());
Print(v[0]);
Print(v[1]);
Print(v[2]);
Print(v[3]);
Print(T);
</code></pre>
http://itensor.org/support/1380/use-vector-of-doubles-in-args?show=1381#a1381Mon, 25 Mar 2019 17:38:52 +0000Answered: Iterating over non-zero elements of a sparse ITensor
http://itensor.org/support/1361/iterating-over-non-zero-elements-of-a-sparse-itensor?show=1369#a1369
<p>Good suggestion, thanks. I think this is a feature we should definitely have, so I just added it! (You'll have to pull the latest version of ITensor to get it.)</p>
<p>What I added is a function called <code>iterInds</code> which you in a range-based for loop, which gives the behavior you asked about. </p>
<p>Here is a sample code using it:</p>
<pre><code>auto i = Index("i",2);
auto j = Index("j",3);
auto k = Index("k",4);
auto is = IndexSet(i,j,k);
auto T = randomTensor(i,j,k);
for(auto it : iterInds(T))
{
Print(it[0]);
Print(it[1]);
Print(it[2]);
Print(T.real(it));
println();
}
PrintData(T);
</code></pre>
http://itensor.org/support/1361/iterating-over-non-zero-elements-of-a-sparse-itensor?show=1369#a1369Tue, 12 Mar 2019 05:25:30 +0000Answered: How to create a particular initial state as a MPS?
http://itensor.org/support/1359/how-to-create-a-particular-initial-state-as-a-mps?show=1368#a1368
<p>Diego's answer is a good one.</p>
<p>Another way to do what you want, setting the tensor elements directly, is to use similar code to what olabaz provides in his question here:<br>
<a rel="nofollow" href="http://itensor.org/support/1357/setting-random-initial-product-state">http://itensor.org/support/1357/setting-random-initial-product-state</a></p>
http://itensor.org/support/1359/how-to-create-a-particular-initial-state-as-a-mps?show=1368#a1368Tue, 12 Mar 2019 04:40:42 +0000Answered: Setting Random Initial Product State
http://itensor.org/support/1357/setting-random-initial-product-state?show=1366#a1366
<p>That looks like a fine way to do it. Note that you could also use an InitState and then apply a random on-site rotation, similar to the answer given here: <a rel="nofollow" href="http://www.itensor.org/support/1359/how-to-create-a-particular-initial-state-as-a-mps">http://www.itensor.org/support/1359/how-to-create-a-particular-initial-state-as-a-mps</a></p>
<p>You don't need to worry about the link indices, the <code>MPS (sites)</code> constructor makes a product state with only site indices. If you use your MPS in an algorithm that increases the bond dimension (such as 2-site DMRG or TEBD), the link indices will get "generated" by the SVD.</p>
http://itensor.org/support/1357/setting-random-initial-product-state?show=1366#a1366Mon, 11 Mar 2019 21:35:27 +0000Answered: Is there a way to get\set slices of a tensor?
http://itensor.org/support/1360/is-there-a-way-to-get-set-slices-of-a-tensor?show=1365#a1365
<p>The most straightforward way I can think to do it right now is the following:</p>
<pre><code>auto i = Index("i", 2);
auto j = Index("j", 2);
auto k = Index("k", 2);
auto A = ITensor(i, j, k);
auto B = ITensor(i, j);
A.fill(0.0);
B.fill(1.0);
for(int ii = 1; ii <= i.m(); ii++)
for(int jj = 1; jj <= j.m(); jj++)
A.set(i(ii),j(jj),k(2), B.real(i(ii),j(jj)));
</code></pre>
<p>We would definitely like to support a nicer interface for this kind of slicing. However, it requires some thinking to figure out the right interface for slicing into a QN conserving/block sparse ITensor. It may be a little while before we get to it, but it is on our todo list!</p>
http://itensor.org/support/1360/is-there-a-way-to-get-set-slices-of-a-tensor?show=1365#a1365Mon, 11 Mar 2019 21:28:03 +0000Answered: Krylov Subspace Method to the Matrix Exponential for TDVP
http://itensor.org/support/1337/krylov-subspace-method-to-the-matrix-exponential-for-tdvp?show=1340#a1340
<p>Hi Titas,<br>
Regarding Krylov, this is a good idea for a low-level algorithm we should supply with ITensor. However, this is in addition to many other things we should or would like to add (tensor slicing, other algorithms, etc) so it may take some time for us to add Krylov.</p>
<p>But in the meantime, it is something that should be quite possible to implement yourself. Good examples of similar algorithms written in ITensor can be found in this file:<br>
<a rel="nofollow" href="https://github.com/ITensor/ITensor/blob/master/itensor/iterativesolvers.h">https://github.com/ITensor/ITensor/blob/master/itensor/iterativesolvers.h</a><br>
In that file there are the Arnoldi, gmres, and Davidson algorithms. </p>
<p>These all follow similar principles, which is that one multiplies a large linear operator onto an initial 'state' or vector, then orthogonalizes the resulting produced vector against all previously produced vectors from earlier in the algorithm to build a Krylov subspace. Then one solves the desired problem, whether an eigenvalue or Ax=b problem etc., within the Krylov space.</p>
<p>The key operations of ITensor taking place in each of these algorithms are just contracting ITensors together (used when multiplying the vectors by the large linear operator and dot-producting the vectors with each other) and addition of ITensors. Most of the code is just dealing with scalars and small matrices to enact the logic of the algorithm, and to check for convergence and things.</p>
<p>Finally, regarding extracting the data of a dense ITensor, you can refer to this code formula page:<br>
<a rel="nofollow" href="http://itensor.org/docs.cgi?vers=cppv2&page=formulas/extractdense">http://itensor.org/docs.cgi?vers=cppv2&page=formulas/extractdense</a><br>
Please ask if you have a question about that page.</p>
<p>Unfortunately, things aren't as simple for extracting storage of block-sparse tensors i.e. IQTensors. I could give you a similar code to the above that would extract the low level storage of an IQTensor, but you'd still need to know how this storage is organized to read out the different blocks properly. Let me know if you definitely decide you need to do that. But it could be easier to just convert the IQTensor to a dense ITensor and then read that out instead.</p>
<p>Best regards,<br>
Miles</p>
http://itensor.org/support/1337/krylov-subspace-method-to-the-matrix-exponential-for-tdvp?show=1340#a1340Fri, 01 Mar 2019 18:47:47 +0000Answered: evolution with complicated Hamiltonian using Trotter gates
http://itensor.org/support/1330/evolution-with-complicated-hamiltonian-using-trotter-gates?show=1333#a1333
<p>You can just add a if sentence in your for loop.<br>
Something like:<br>
hterm +=sites.op("Sx",b);<br>
if(b == N-1) hterm +=sites.op("Sx",b+1);</p>
http://itensor.org/support/1330/evolution-with-complicated-hamiltonian-using-trotter-gates?show=1333#a1333Fri, 01 Mar 2019 00:28:24 +0000Answered: spinless bosons
http://itensor.org/support/1310/spinless-bosons?show=1329#a1329
<p>Hi AbraDabra,<br>
This is a site set type we should offer. We're working on it! </p>
<p>But in the meantime, yes, you can create your own kind of site set for this case by copying one of the existing ones (such as "Spinless") and creating a new file and a new site set (perhaps boson.h and "class BosonSite" and "class Boson").</p>
<p>Though Mingru is correct that sometimes just having a maximum site occupancy of 1 is enough, in general that's not the case, very much depending on the particular Hamiltonian.</p>
<p>But for many cases, you can truncate the maximum occupancy to, say, 3 or 4 without incurring much error. You should raise and lower this maximum occupancy and check that your results are converged with respect to it.</p>
<p>For the operators you'll need to define, here is an example for maximum occupancy of 3:</p>
<pre><code>ITensor
op(std::string const& opname,
Args const& args) const
{
auto sP = prime(s); //here "s" is the site index stored in this BosonSite object
IQIndexVal Emp(s(1)),
EmpP(sP(1)),
One(s(2)),
OneP(sP(2)),
Two(s(3)),
TwoP(sP(3)),
Three(s(4)),
ThreeP(sP(4));
if(opname == "N" || opname == "n")
{
Op(One,OneP) = 1;
Op(Two,TwoP) = 2;
Op(Three,ThreeP) = 3;
}
else
if(opname == "A")
{
Op(One,EmpP) = 1;
Op(Two,OneP) = std::sqrt(2);
Op(Three,TwoP) = std::sqrt(3);
}
else
if(opname == "Adag")
{
Op(Emp,OneP) = 1;
Op(One,TwoP) = std::sqrt(2);
Op(Two,ThreeP) = std::sqrt(3);
}
</code></pre>
<p>If you'd like to post your code when you're done with a first draft or have some more specific questions please just post a comment or a new question -</p>
<p>Best regards,<br>
Miles</p>
http://itensor.org/support/1310/spinless-bosons?show=1329#a1329Thu, 28 Feb 2019 16:21:31 +0000Answered: declaration of the variable
http://itensor.org/support/1311/declaration-of-the-variable?show=1313#a1313
<p>Hello,</p>
<p>In your first code, you just have to initialize <code>hterm</code> before the if statement:</p>
<pre><code>for(int i = L-1; i >= 1; --i)
{
IQTensor hterm;
if (i % 2 == 0)
{
hterm = sites.op("Adag",i)*sites.op("A",i+1);
hterm += sites.op("A",i)*sites.op("Adag",i+1);
}
else
{
hterm = 2.0*sites.op("Adag",i)*sites.op("A",i+1);
hterm += 2.0*sites.op("A",i)*sites.op("Adag",i+1);
}
auto g = Gate(sites,i,i+1,Gate::tReal,tstep/2.,hterm);
gates.push_back(g);
}
</code></pre>
<p>(assuming you are using QNs, otherwise you need to initialize with <code>ITensor hterm</code>).</p>
<p>In your second code, it looks like there is just a small mistake in the code. Instead of:</p>
<pre><code> auto hterm = sites.op("Adag",i)*sites.op("A",i+1);
hterm += sites.op("A",1)*sites.op("Adag",i+1);
</code></pre>
<p>it should be:</p>
<pre><code> auto hterm = sites.op("Adag",i)*sites.op("A",i+1);
hterm += sites.op("A",i)*sites.op("Adag",i+1);
</code></pre>
<p>Cheers,<br>
Matt</p>
http://itensor.org/support/1311/declaration-of-the-variable?show=1313#a1313Wed, 27 Feb 2019 14:34:52 +0000Answered: Swap gate in a system with alternating QN
http://itensor.org/support/1309/swap-gate-in-a-system-with-alternating-qn?show=1312#a1312
<p>Hi Mingru,</p>
<p>Can you just create a set of swap gates using delta functions? i.e. for sites 5 and 6 with indices <code>s5</code> and <code>s6</code>, make the swap gate:</p>
<pre><code>auto swap56 = delta(s5,prime(s6))*delta(s6,prime(s5));
</code></pre>
<p>Cheers,<br>
Matt</p>
http://itensor.org/support/1309/swap-gate-in-a-system-with-alternating-qn?show=1312#a1312Wed, 27 Feb 2019 14:28:53 +0000Answered: time-dependent Hamiltonian
http://itensor.org/support/1283/time-dependent-hamiltonian?show=1308#a1308
<p>Thank you very much, Miles. I would like to specify the 2nd point of your answer. I understand what you mean, but I can't imagine how it can be done. Could you please write an example. </p>
<p>For instance, how one can replace 'delt' by the function 'delt(t)'</p>
<pre><code> float delt(float t)
{
return 0.5* sin(t);
}
</code></pre>
<p>snippet for Trotter gates</p>
<pre><code>for(int b = 1; b <= N-1; ++b)
{
auto hterm = delt*sites.op("Sz",b)*sites.op("Sz",b+1);
hterm += delt*sites.op("S+",b)*sites.op("S-",b+1);
hterm += delt* sites.op("S-",b)*sites.op("S+",b+1);
auto g = Gate(sites,b,b+1,Gate::tReal,tstep/2.,hterm);
gates.push_back(g);
}
</code></pre>
<p>(and the same for the reverse oder)<br>
time evolve </p>
<pre><code> gateTEvol(gates,ttotal,tstep,psi,{"Cutoff=",cutoff,"Verbose=",true});
</code></pre>
<p>Is there any detailed documentation of 'gateTEvol' function?</p>
<p>Although, I know one of the solutions, which is to divide the total time by N small steps and perform Trotter evolution N times. But i think it is the worst solution. <br>
Thank you in advance!</p>
http://itensor.org/support/1283/time-dependent-hamiltonian?show=1308#a1308Tue, 26 Feb 2019 20:26:14 +0000Answered: must be converted to an ITensor prior to usage
http://itensor.org/support/1305/must-be-converted-to-an-itensor-prior-to-usage?show=1306#a1306
<p>Yes this is an unfortunate issue with version 2 of ITensor. The soon to be released version 3 will fix this issue. </p>
<p>By convert to ITensor, what is meant is this:</p>
<pre><code>ITensor Sxb = sites.op(“Sx”,b);
</code></pre>
<p>And similar for the other operator. Then you can multiply these ITensors together. </p>
http://itensor.org/support/1305/must-be-converted-to-an-itensor-prior-to-usage?show=1306#a1306Tue, 26 Feb 2019 08:24:57 +0000Answered: Measure multi-site (more than 2) correlation
http://itensor.org/support/1228/measure-multi-site-more-than-2-correlation?show=1303#a1303
<p>Thanks very much for posting a solution, and glad you figured it out! </p>
<p>For those looking for the answer, please see the above comments by the original poster ^</p>
http://itensor.org/support/1228/measure-multi-site-more-than-2-correlation?show=1303#a1303Mon, 25 Feb 2019 08:16:16 +0000Answered: Phase convention of SVD in iTensor
http://itensor.org/support/1287/phase-convention-of-svd-in-itensor?show=1289#a1289
<p>Hi Steve,</p>
<p>As far as I know, there is no particular reason for the phase choice in ITensor, and it is something that could be chosen after the decomposition is performed. Right now, ITensor uses it's own implementation of the SVD (based on recursive eigendecompositions), but we would like to add options for users to choose to use LAPACK versions of the SVD. I believe that Numpy calls LAPACK routines (either *gesvd or *gesdd), so that may be the reason for the difference in the phase.</p>
<p>Note that for degenerate singular values, the gauge degree of freedom is actually an entire unitary rotation of the degenerate subspace, not just a simple phase degree of freedom, so in general there is no fixed convention and you will likely see different results in different numerical libraries.</p>
<p>If you are interested in a decomposition with a fixed phase (for some reason), note that a good option could be the polar decomposition, @@A = QP@@ where @@Q@@ is an isometry and @@P@@ is a positive Hermitian matrix (<a rel="nofollow" href="https://en.wikipedia.org/wiki/Polar_decomposition">https://en.wikipedia.org/wiki/Polar_decomposition</a> ). This can be very simply obtained from an SVD, @@A = U S V^{\dagger} = (U V^{\dagger}) (V S V^{\dagger})@@, so @@Q = U V^{\dagger}@@ and @@P = V S V^{\dagger}@@. Note that @@Q@@ is only an isometry if no truncation in the SVD is performed (and @@m > n@@ for @@m \times n@@ matrix @@A@@).</p>
<p>Cheers,<br>
Matt</p>
http://itensor.org/support/1287/phase-convention-of-svd-in-itensor?show=1289#a1289Thu, 21 Feb 2019 14:29:10 +0000Product of operators
http://itensor.org/support/1288/product-of-operators
<p>Hello,</p>
<p>I want to construct some operators like these $$\sigma^{\alpha_1}_1 \otimes... \otimes\sigma^{\alpha_N}_N$$ One way would be to use the autoMPO constructor but how can I construct the necessary loop? A much easier way would be to create the tensor product of consecutive sites but I don't seem to find such function, does it exist?</p>
<p>Thank you</p>
http://itensor.org/support/1288/product-of-operatorsThu, 21 Feb 2019 08:33:39 +0000Answered: number_of_particles
http://itensor.org/support/1280/number_of_particles?show=1282#a1282
<p>Good question, since it's kind of a subtle thing in ITensor. For codes using quantum-number conserving tensors, such as when doing DMRG calculations, the quantum numbers present in any wavefunction are not allowed to change. So the number is set by how you make your initial state.</p>
<p>So if you set your initial state to have 3 up and 1 down particles, and use QN conserving tensors, then the number will not change. </p>
<p>Please let me know if you still have a question of course!</p>
<p>Miles</p>
http://itensor.org/support/1280/number_of_particles?show=1282#a1282Mon, 18 Feb 2019 07:18:33 +0000Answered: Segmentation Fault with Combiner
http://itensor.org/support/1271/segmentation-fault-with-combiner?show=1272#a1272
<p>Hi, thanks for the bug report. We'd like to strive to make all of the sample code on the website compile, so this is helpful. But sometimes the codes on the site skip over a few steps, such as setting elements of tensors when initializing them, which can lead to errors.</p>
<p>I just updated the code on that page and it runs now. What I added was a line </p>
<pre><code>randomize(T);
</code></pre>
<p>that sets the elements of the tensor T to be random elements. That allows the rest of the code to run correctly. The reason you were getting that error is that no elements of T had been set, so T had no storage. In the future we'll fix combiners to work even for this case.</p>
<p>One other note is that, if you get an error like a segmentation fault, please try compiling and running your code in "debug mode". <br>
<a rel="nofollow" href="http://itensor.org/docs.cgi?page=formulas/debug_mode">http://itensor.org/docs.cgi?page=formulas/debug_mode</a></p>
<p>Running your code this way will help to give more informative error messages. </p>
<p>Glad you are trying out ITensor!</p>
<p>Best regards,<br>
Miles</p>
http://itensor.org/support/1271/segmentation-fault-with-combiner?show=1272#a1272Thu, 14 Feb 2019 20:06:13 +0000Answered: Installation
http://itensor.org/support/1260/installation?show=1269#a1269
<p>For cygwin, I don't know if I recall all of the libraries and correct settings, but I believe the key ones are:</p>
<ol>
<li><p>install the lapack and lapack-devel (or similarly named) libraries with Cygwin</p></li>
<li><p>in your "options.mk" file, comment out ("#") the lines PLATFORM=macos and BLAS<em>LAPACK</em>LIBFLAGS=-framework Accelerate, because as you can see from the comments above those lines, those are the settings for Mac / Apple systems</p></li>
<li><p>uncomment the PLATFORM and BLAS<em>LAPACK</em>LIBFLAGS just below, suitable for general GNU/LINUX systems</p></li>
</ol>
<p>I think with those changes it should compile and work. But if you get other error messages please let me know.</p>
<p>Best regards,<br>
Miles</p>
http://itensor.org/support/1260/installation?show=1269#a1269Thu, 14 Feb 2019 06:10:18 +0000Answered: Applying Trotter gate to MPS or MPO
http://itensor.org/support/1252/applying-trotter-gate-to-mps-or-mpo?show=1266#a1266
<p>Hi Steve,</p>
<p>1) That is correct, putting the gauge position where the gate is being applied is meant to help minimize the truncation error. Basically, using that gauge center allows one to treat the local tensors (the contraction of the MPS tensors with the gate you are applying) as the square root of the density matrix on those sites, and therefore the best low-rank approximation is truncating according to the singular values. An early reference on this is: </p>
<p><a rel="nofollow" href="https://arxiv.org/abs/cond-mat/0605597">https://arxiv.org/abs/cond-mat/0605597</a></p>
<p>Note that this is essentially the same issue that comes up in 2-site DMRG, that it is best to perform DMRG when the gauge center of the wavefunction is located on the sites you are optimizing, which makes the eigenvector equation simpler and the truncation of the bond dimension using the singular value decomposition optimal.</p>
<p>2) Time evolution of 2D systems is definitely a a tricky subject. There are a few methods available for doing it. As you mention, one approach is to make use of swap gates to move the trotter gates so they become local for the MPS. Another approach is to turn the non-local gates into an MPO. There are also other approaches available for performing time evolution with non-local Hamiltonians, like the time dependent variation principle (TDVP). Here are some references with discussions about these approaches (these are just some that come to mind, but it is a large literature at this point):</p>
<p><a rel="nofollow" href="https://arxiv.org/abs/1002.1305">https://arxiv.org/abs/1002.1305</a><br>
<a rel="nofollow" href="https://arxiv.org/abs/1407.1832v1">https://arxiv.org/abs/1407.1832v1</a><br>
<a rel="nofollow" href="https://arxiv.org/abs/1705.05578">https://arxiv.org/abs/1705.05578</a><br>
<a rel="nofollow" href="https://arxiv.org/abs/1901.05824">https://arxiv.org/abs/1901.05824</a></p>
<p>Note that time evolving MPOs can be even more subtle. There is a problem that naively truncating the MPO with an SVD, as one would do with an MPS, can cause the MPO to possibly become non-positive. Positivity is a property one wants to preserve if the MPO represents a density matrix, and introducing negative eigenvalues can lead to numerical instability in the evolution. Here is a paper discussing that issue, which is addressed with a new technique called density matrix truncation (DMT):</p>
<p><a rel="nofollow" href="https://arxiv.org/abs/1707.01506">https://arxiv.org/abs/1707.01506</a></p>
<p>If you have questions about implementing these methods in ITensor, please don't hesitate to ask. It is difficult to give more guidance without more specifics about the calculations you want to perform.</p>
<p>Cheers,<br>
Matt</p>
http://itensor.org/support/1252/applying-trotter-gate-to-mps-or-mpo?show=1266#a1266Wed, 13 Feb 2019 17:22:43 +0000Answered: Entanglement entropy of multiple partitions
http://itensor.org/support/1263/entanglement-entropy-of-multiple-partitions?show=1264#a1264
<p>Hello,</p>
<p>Someone please correct me if I am wrong, but I believe the only way is to calculate the reduced density matrix for subsystem A and then calculate the entanglement entropy from the reduced density matrix (for example by diagonalizing the reduced density matrix and using the eigenvalues in whichever entanglement entropy you are interested in). This page has a code formula for calculating the reduced density matrix of disjoint subsystems:</p>
<p><a rel="nofollow" href="http://www.itensor.org/docs.cgi?vers=cppv3&page=formulas/mps_two_rdm">http://www.itensor.org/docs.cgi?vers=cppv3&page=formulas/mps_two_rdm</a></p>
<p>The entanglement entropy can then be calculated from the eiganvalues of the reduced density matrix in the same way as at the bottom of this formula:</p>
<p><a rel="nofollow" href="http://www.itensor.org/docs.cgi?vers=cppv3&page=formulas/entanglement_mps">http://www.itensor.org/docs.cgi?vers=cppv3&page=formulas/entanglement_mps</a></p>
<p>This would become inefficient when dealing with larger subsystems (since the density matrix grows exponentially with the number of sites in A), so perhaps there is a more clever way that I am not aware of.</p>
<p>Cheers,<br>
Matt</p>
http://itensor.org/support/1263/entanglement-entropy-of-multiple-partitions?show=1264#a1264Wed, 13 Feb 2019 14:09:51 +0000Creating SU(2)xSU(2) site set.
http://itensor.org/support/1262/creating-su-2-xsu-2-site-set
<p>Hello world, </p>
<p>I'm interested in constructing a custom site set for SU(2)xSU(2) fermions, i.e. fermions with spin-1/2 and pseudospin-1/2. I keep reading in the docs that the SiteSets can be mixed with other SiteSets, so I assume I could mix two instances of Hubbard SiteSet to produce what I'm looking for; however, I can't seem to find any good information or tutorials on how to create custom SiteSets.</p>
<p>Where could one find such information?<br>
Any direction, resources, or suggestions would be great!</p>
http://itensor.org/support/1262/creating-su-2-xsu-2-site-setTue, 12 Feb 2019 21:35:00 +0000Answered: std::bad_alloc in spin-polarized system
http://itensor.org/support/1254/std-bad_alloc-in-spin-polarized-system?show=1258#a1258
<p>Hello, I solved this problem.<br>
This problem is due to my little knowledge of the efficient MPS contraction.</p>
<p>The Tensor</p>
<pre><code> psi.A(2) * prime(dag(psi.A(2))
</code></pre>
<p>has a very big index dimension, but what I'd like to do is calculate a correlation function.<br>
So I should do:</p>
<pre><code>lcorr *= psi.A(2);
lcorr *= prime(dag(psi.A(2)), Link);
</code></pre>
<p>where "lcorr" follows basic notation in the ITensor code formula.</p>
<p>Thank you every one.</p>
http://itensor.org/support/1254/std-bad_alloc-in-spin-polarized-system?show=1258#a1258Sat, 09 Feb 2019 00:55:02 +0000Answered: MPS & MPOs as a function of a for loop variable
http://itensor.org/support/1255/mps-%26-mpos-as-a-function-of-a-for-loop-variable?show=1256#a1256
<p>Hi Ipsita,<br>
The direct answer to your question is that, whichever procedure you are using to make your MPO necessarily includes "h" as a parameter. (Say using AutoMPO, where "h" appears as a coefficient.) So then to change h, you just re-create the MPO again from the beginning, using a different value for h.</p>
<p>However, the other answer I would give to your question is to say, I don't recommend doing a lot of different calculations (I assume DMRG?) in a loop. Instead, I think it's a much better practice to do each calculation separately, and carefully study each one. How well did it go? Were all indications that it converged? Is the system approaching a phase boundary where perhaps the initial state and number of sweeps needed for convergence might need to be changed?</p>
<p>Best regards,<br>
Miles</p>
http://itensor.org/support/1255/mps-%26-mpos-as-a-function-of-a-for-loop-variable?show=1256#a1256Fri, 08 Feb 2019 21:52:25 +0000Answered: Getting RDM of a RDM Eigenvector
http://itensor.org/support/1233/getting-rdm-of-a-rdm-eigenvector?show=1247#a1247
<p>Good question. Yes, the sample code you wrote is very much on track with what you should do. The main issue you might run into with that code, though, is that rdmEvec will not be an MPS, but just a single tensor, so you can't call .position on it (though I know what you were meaning by writing that in your code). </p>
<p>Instead, what you should do is prepare a new MPS object of size La, and set the tensors of it to be those of your original MPS together with the modified tensor at the edge where you "cut" and project onto the RDM eigenvector. </p>
<p>Then you can call .position on this new, shorter, MPS and do the rest of the calculation the way you wrote it.</p>
<p>I'd definitely suggest testing on a system where you already know the correct answer to ensure everything is working! Or to test in some other way before just assuming the code is correct, even if it runs ok.</p>
http://itensor.org/support/1233/getting-rdm-of-a-rdm-eigenvector?show=1247#a1247Wed, 30 Jan 2019 06:56:06 +0000Answered: How to evaluate two-point correlator matrix element
http://itensor.org/support/1240/how-to-evaluate-two-point-correlator-matrix-element?show=1244#a1244
<p>Hi, so you are on the right track; however, because these are two different MPS, they will have in general totally different bond/virtual/link indices. So the trick used in the code formula you based your code on will not work, specifically the part where the code skips over the MPS "A" tensors to the left of site i. </p>
<p>Instead, you will have to contract the two MPS together without using any aspect of their respective self-orthogonality properties. </p>
<p>Here is link to a new code formula I just posted for doing this, in response to your question: <br>
<a rel="nofollow" href="http://itensor.org/docs.cgi?page=formulas/two_mps">http://itensor.org/docs.cgi?page=formulas/two_mps</a></p>
http://itensor.org/support/1240/how-to-evaluate-two-point-correlator-matrix-element?show=1244#a1244Tue, 29 Jan 2019 19:02:35 +0000The tensors calculated by idmrg do not obey the right orthogonality condition.
http://itensor.org/support/1242/tensors-calculated-idmrg-obey-right-orthogonality-condition
<p>Hi Miles,</p>
<p>I'm trying to calculate observables from idmrg. The scheme used in the sample "idmrg.cc" is base on the right-orthogonal gauge. But when I use the following code to check the orthogonality, it turns that this condition is not satisfied in the middle of the unicell</p>
<pre><code>int Nuc = 4;
int N = 2*Nuc;
// Other codes
for(auto ni=1;ni<=N;++ni)
{
auto pa=psi.A(ni);
auto indc = commonIndex(pa,psi.A(ni-1));
PrintDat(pa*prime(dag(pa),indc));
}
</code></pre>
<p>where right-orthogonality is satisfied except for the center tensor, i.e., ni=5. The result for that site is not an identity matrix.</p>
<p>Best,<br>
Su Wei</p>
http://itensor.org/support/1242/tensors-calculated-idmrg-obey-right-orthogonality-conditionTue, 29 Jan 2019 05:41:17 +0000Answered: MPO of single-site Sz operator
http://itensor.org/support/1234/mpo-of-single-site-sz-operator?show=1236#a1236
<p>Hi Steve,</p>
<p>That is a good question. In fact, the MPO created by AutoMPO in that case can be truncated to a bond dimension of 1, as you can see if you run the following code:</p>
<pre><code>for(int b = 1; b<N; b++)
{
Ham.position(b);
auto wf = Ham.A(b)*Ham.A(b+1);
auto U = Ham.A(b);
ITensor S,V;
auto spectrum = svd(wf,U,S,V);
PrintData(spectrum);
}
</code></pre>
<p>You should see that the spectrum in every case only has one non-zero eigenvalue, meaning the MPO could be safely truncated to a bond dimension of one.</p>
<p>Likely what is going on (I am only speculating, since I haven't worked much with the AutoMPO code) is that the code being used to generate the MPO is accounting for the possibility of having a superposition of local, on-site terms on every site of the lattice, and doesn't write specialized code to make the most efficient MPO for only a single on-site operator (which is not a common use case for an MPO). The interesting thing about an MPO is that with a bond dimension of only 2, it can account for having a superposition of on-site terms on every site of the lattice.</p>
<p>Cheers,<br>
Matt</p>
http://itensor.org/support/1234/mpo-of-single-site-sz-operator?show=1236#a1236Mon, 28 Jan 2019 15:29:44 +0000Answered: TEBD for semi infinite chain
http://itensor.org/support/1222/tebd-for-semi-infinite-chain?show=1226#a1226
<p>Hi,</p>
<p>Please correct me if I am wrong, but I am assuming that you mean that the calculation you want to perform is to start with a state (like the ground state), apply a local operator to that state to perturb it, and then evolve that state in time using the TEBD algorithm.</p>
<p>An immediate suggestion I would make is to first try to run TEBD on a finite size (but possibly large) system. If the system is perturbed only at one end, it should take time for the wavefront of the perturbation to propagate through the system, so for that time the dynamics should generally be independent of the other boundary. The time it takes for the wave to propagate will depend on details of the system you are studying such as the correlation length, and you may be able to reach sufficiently long times to see the results that you want.</p>
<p>If you find that using a finite system does not allow you to reach long enough time scales for your particular application, you could consider more sophisticated methods like the one discussed in the reference (<a rel="nofollow" href="https://arxiv.org/abs/1207.0652">https://arxiv.org/abs/1207.0652</a> ). In that approach, an infinite calculation is first performed to get an effectively infinite boundary condition, and then a finite TEBD calculation is performed using that infinite boundary condition. This can allow for longer time scales to be reached with a smaller finite size effect.</p>
<p>Please let us know if you have any questions about how to implement these suggestions in ITensor.</p>
<p>Cheers,<br>
Matt</p>
http://itensor.org/support/1222/tebd-for-semi-infinite-chain?show=1226#a1226Thu, 24 Jan 2019 17:28:32 +0000Answered: How to make MPO out of an MPS (outer product/projector)?
http://itensor.org/support/1223/how-to-make-mpo-out-of-an-mps-outer-product-projector?show=1224#a1224
<p>Hi,</p>
<p>What would you like to use it for? I ask because in most use cases, you would not need to explicitly form the MPO (which would have a bond dimension of <code>m^2</code> if formed from an MPS with bond dimension <code>m</code>). Instead, you can work directly with the tensors of the MPS. If you let us know your use case we can help you determine how to do that.</p>
<p>Cheers,<br>
Matt</p>
http://itensor.org/support/1223/how-to-make-mpo-out-of-an-mps-outer-product-projector?show=1224#a1224Thu, 24 Jan 2019 14:47:09 +0000Answered: Warnings on macOS Mojave
http://itensor.org/support/1214/warnings-on-macos-mojave?show=1219#a1219
<p>(Just marking this as answered, via Matt Fishman's comments above.)</p>
<p>Jin, I second Matt's comment that we appreciate you reporting this, as these are very likely mis-used or unnecessary std::move commands that we will remove to get rid of these warnings as well. Thanks!</p>
http://itensor.org/support/1214/warnings-on-macos-mojave?show=1219#a1219Wed, 16 Jan 2019 21:59:56 +0000AutoMPO Syntax: Concatenate local terms
http://itensor.org/support/1212/autompo-syntax-concatenate-local-terms
<p>Hi everyone and happy new year, </p>
<p>It's just a syntax question but the answer would be very useful for me, in order to simplify my code.</p>
<p>I simulate a model with plaquette-like interactions on a Ladder with terms of<br>
of the type sigma<em>{i,x} \prod</em>{j neighbors of i } Proj_{j,up}. <br>
This means that I have to construct autoMPO terms with variable number of involved operators (due to boundaries)</p>
<p>Is there a way to construct each term of the Hamiltonian via concatenation?</p>
<h3> Pseudo-code:</h3>
<pre><code>for (site 1)
term = coeff; //Real number
term = concatenate(term,op1,site1);
if (condition site 2 met)
term = concatenate(term,op2,site2);
if (condition site 3 met)
term = concatenate(term,op3,site3);
ampo += term;
</code></pre>
<hr>
<p>Benoit</p>
http://itensor.org/support/1212/autompo-syntax-concatenate-local-termsThu, 10 Jan 2019 16:51:04 +0000Answered: Accessing elements of tensor with variable rank
http://itensor.org/support/1209/accessing-elements-of-tensor-with-variable-rank?show=1210#a1210
<p>Hey Andreas,</p>
<p>That functionality had not been available, but that is a good suggestion (<code>.set()</code> can currently accept <code>vector<IndexVal></code>, so it is inconsistent that <code>.real()</code> and <code>.cplx()</code> can't).</p>
<p>I made a pull request for adding <code>.real(vector<IndexVal>)</code> and <code>.cplx(vector<IndexVal>)</code>, is that sufficient for your use case?</p>
<p>Cheers,<br>
Matt</p>
http://itensor.org/support/1209/accessing-elements-of-tensor-with-variable-rank?show=1210#a1210Wed, 02 Jan 2019 23:29:36 +0000Answered: non-Hermitian MPO
http://itensor.org/support/1205/non-hermitian-mpo?show=1207#a1207
<p>Thanks for the question. Yes, this function works for arbitrary MPO's, including non-Hermitian ones. </p>
<p>By the way, I'd recommend upgrading to the latest version of ITensor since we made a few fixes to this function a few months ago, and also because now we recommend a new interface through a function just called "applyMPO". Please see the last section of this page for more information:<br>
<a rel="nofollow" href="http://itensor.org/docs.cgi?page=classes/mps_mpo_algs">http://itensor.org/docs.cgi?page=classes/mps_mpo_algs</a></p>
<p>I'd recommend using the checkMPOProd method within your code when you are first building and testing it to make sure that applyMPO is working and calculating the product that you expect. The function checkMPOProd is kind of slow, so you'll want to leave it out of your production code, but it makes no approximations whatsover when computing the quantity (distance) explained in the documentation so it's useful for testing.</p>
<p>Best regards,<br>
Miles</p>
http://itensor.org/support/1205/non-hermitian-mpo?show=1207#a1207Mon, 31 Dec 2018 17:20:41 +0000Answered: Alternative method for PBC?
http://itensor.org/support/1203/alternative-method-for-pbc?show=1206#a1206
<p>Yes, I believe this has the same (not very good) scaling as the long-bond approach. In fact, I think this approach will be even more highly entangled than the long-bond for the purpose of simulating a 1D system, since the bulk of the system will have two "copies" of the 1D chain running through it! </p>
<p>As you may know, the reason PBC is tough with the usual DMRG approach is because the standard DMRG algorithm is based on a matrix product state form of the wavefunction that is suitable for open boundary conditions. That is, it optimizes an open-boundary MPS. So if you input a periodic Hamiltonian, it can work but it will be sort of a mismatch between the type of Hamiltonian and the type of wavefunction.</p>
<p>One could also optimize a periodic MPS, which could in principle give a better scaling algorithm, but fewer techniques are known for periodic MPS and it's not known how to optimally truncate them just using local operations or how to achieve similar algorithmic properties like "gauging" an open MPS to make the eigensolver step have nice properties.</p>
<p>Miles</p>
http://itensor.org/support/1203/alternative-method-for-pbc?show=1206#a1206Mon, 31 Dec 2018 17:16:19 +0000Answered: Re: Adding a non-Hermitian Eigensolver
http://itensor.org/support/1189/re-adding-a-non-hermitian-eigensolver?show=1194#a1194
<p>Hi, yes we do need to and plan to add an Arnoldi code similar to Davidson. We actually had one in an older version of ITensor, and just need to put it back in. </p>
<p>So it is on our to-do list, and Matt Fishman has this as a high priority (he was the one who recently also added the gmres algorithm for iteratively solving linear equations). </p>
<p>I don't think we will use ARPACK, since it would become a dependency for ITensor and I've heard there are some issues with ARPACK and that it is not maintained much anymore.</p>
<p>Best regards,<br>
Miles</p>
http://itensor.org/support/1189/re-adding-a-non-hermitian-eigensolver?show=1194#a1194Fri, 14 Dec 2018 16:46:14 +0000Answered: How to solve eigen-problem in itensor?
http://itensor.org/support/1157/how-to-solve-eigen-problem-in-itensor?show=1193#a1193
<p>Hi, so if you tensor is equivalent to a Hermitian matrix, you can use the diagHermitian function described on this page of the documentation:</p>
<p><a rel="nofollow" href="http://itensor.org/docs.cgi?page=classes/decomp">http://itensor.org/docs.cgi?page=classes/decomp</a></p>
<p>Please let me know if that does not give you what you need -</p>
<p>Best regards,<br>
Miles</p>
http://itensor.org/support/1157/how-to-solve-eigen-problem-in-itensor?show=1193#a1193Fri, 14 Dec 2018 16:42:22 +0000Answered: Time evolution by Trotter gate for fermions
http://itensor.org/support/1177/time-evolution-by-trotter-gate-for-fermions?show=1190#a1190
<p>Just for anybody interested, I fixed the problem after thinking about the anti-commutations of fermions. What I should do is to replace the C-operators to combinations of A- and F-operators as:</p>
<pre><code>auto hterm = -1.*sites.op("Adagup*F",b)*sites.op("Aup",b+1);
hterm += -1.*sites.op("Adagdn",b)*sites.op("F*Adn",b+1);
hterm += +1.*sites.op("Aup*F",b)*sites.op("Adagup",b+1);
hterm += +1.*sites.op("Adn",b)*sites.op("F*Adagdn",b+1);
</code></pre>
<p>With this I see that the energy is conserved for time-independent Hamiltonian! </p>
http://itensor.org/support/1177/time-evolution-by-trotter-gate-for-fermions?show=1190#a1190Thu, 13 Dec 2018 13:20:38 +0000Answered: Installing MPI Dmrg
http://itensor.org/support/1179/installing-mpi-dmrg?show=1187#a1187
<p>To mark this question as answered, the solution that worked the best was to add the line:</p>
<p>CCCOM=mpicxx</p>
<p>in the Makefile to redefine the CCCOM (cc compiler) variable.</p>
<p>Or replace mpicxx with the appropriate C++ compiler frontend provided by your MPI distribution.</p>
http://itensor.org/support/1179/installing-mpi-dmrg?show=1187#a1187Thu, 13 Dec 2018 03:46:56 +0000Answered: Problems when Building ITensor Library
http://itensor.org/support/1159/problems-when-building-itensor-library?show=1175#a1175
<p>In my practice, itensor (git version cloned today) works under macOS 10.14.1.<br>
In options.mk, I just comment<br>
<code>CCCOM=g++ -m64 -std=c++11 -fPIC</code><br>
and uncomment<br>
<code>#CCCOM=clang++ -std=c++11 -fPIC</code></p>
<p>The only problem is <strong>Accelerate are out of sync</strong>, the same problem <a rel="nofollow" href="http://itensor.org/support/1134/problem-with-framework-accelerate">here</a>, anyway the program works.</p>
http://itensor.org/support/1159/problems-when-building-itensor-library?show=1175#a1175Wed, 05 Dec 2018 06:15:23 +0000Answered: Issue for the ground state psi in pdmrg
http://itensor.org/support/1169/issue-for-the-ground-state-psi-in-pdmrg?show=1170#a1170
<p>Hi Victor,<br>
Yes, that's the expected behavior, actually. In addition to the MPS (IQMPS) tensors, there are also "V" tensors (inverse Lambda, or inverse singular value diagonal) tensors which "link" or "glue" together the different patches of the MPS.</p>
<p>For simplicity of the code, each node works with an MPS which is the length of the whole system. But then it only actually updates the tensors within the block that it "owns". The other tensors don't get updated.</p>
<p>Hope that helps -</p>
<p>Miles</p>
http://itensor.org/support/1169/issue-for-the-ground-state-psi-in-pdmrg?show=1170#a1170Tue, 04 Dec 2018 16:17:28 +0000Answered: Problems with an entanglement entropy calculation
http://itensor.org/support/1165/problems-with-an-entanglement-entropy-calculation?show=1166#a1166
<p>Hi, so the answer is that it's incorrect that dmrg (with open boundary conditions and without conserving Sz-parity symmetry) will give an entropy of ln2, except perhaps on very small system sizes.</p>
<p>You are right, of course, that there is a two-fold ground state degeneracy but this means that dmrg has succeeded if it gives any linear combination of these two ground states, since it's goal is just to minimize the energy. Typical DMRG calculations result in ground-state combinations which have the minimal entanglement entropy. For the ferromagnetic Ising chain this is either all spins up or all spins down, not a linear combination of the two.</p>
<p>The reason I mention small system sizes, is that, for small transverse field there is a tiny reduction in energy due to have a linear combination ("cat state") of both all up and all down ground states, but this energy 'gain' goes away exponentially quickly as a function of system size, so it's typically quite negligible and the truncations that happen inside DMRG will remove this solution.</p>
<p>Miles</p>
http://itensor.org/support/1165/problems-with-an-entanglement-entropy-calculation?show=1166#a1166Mon, 03 Dec 2018 17:21:00 +0000Answered: How to Turn an Operator into an MPO to apply to MPS
http://itensor.org/support/1154/how-to-turn-an-operator-into-an-mpo-to-apply-to-mps?show=1161#a1161
<p>Hi, so thanks for the question. We didn't have anything in the documentation that covers precisely this, which is an important operation for MPS.</p>
<p>So I just added a new 'Code Formula' that shows you how to apply a gate to an MPS efficiently:<br>
<a rel="nofollow" href="http://itensor.org/docs.cgi?page=formulas/gate">http://itensor.org/docs.cgi?page=formulas/gate</a></p>
<p>To apply each of your gates, just iterate the above formula for each gate you want to apply and for each bond you want to apply it to. </p>
<p>Please let me know if anything is unclear about the code in the formula or if you have more questions -</p>
<p>Best regards,<br>
Miles</p>
http://itensor.org/support/1154/how-to-turn-an-operator-into-an-mpo-to-apply-to-mps?show=1161#a1161Sat, 01 Dec 2018 18:35:37 +0000Answered: Constraints with Bosons
http://itensor.org/support/1138/constraints-with-bosons?show=1145#a1145
<p>I think one way you can do this, although probably at an increased computational cost relative to the energy-penalty strategy you mentioned (which is what I would try first) is to do the following:</p>
<ol>
<li>define a Hamiltonian MPO (assuming this is a 1D problem) in the usual Hilbert space which includes all configurations including ones which violate your constraints</li>
<li>define "isometry" tensors which map three neighboring site indices into one "mega site" index, sending to zero any states which violate your constraints</li>
<li>since these isometries will overlap, try to resolve them into a MERA-like tensor network by introducing unitary two-site maps (gates) that allow you to then use two-site isometries on the indices resulting after the unitary maps</li>
<li>finally, apply these MERA-like tensors to your MPO and use an algorithm like DMRG to find the ground state in your modified MPO</li>
</ol>
<p>This is just an idea off the top of my head which I haven't worked out in any detail, so I'm not sure if step #3 is possible in the way I'm guessing it might be. It's just an idea to get started with. Hope it helps though- </p>
<p>Another off-the-top-of-my-head idea is to work out the most general form of MPS that obeys your constraints #1 and #2. It might have a block-sparse structure, similar to quantum number conserving MPS. Then you could formulate an MPS with such a constrained structure, write down the energy expectation value expression in terms of the MPS blocks (naming them like "A", "B", "C") and then use gradient descent or some other optimization technique to minimize the energy. Once you found the optimal blocks, you could "load" them back into your MPS to compute other properties numerically.</p>
<p>Best regards,<br>
Miles</p>
http://itensor.org/support/1138/constraints-with-bosons?show=1145#a1145Mon, 26 Nov 2018 01:51:52 +0000Answered: Can you calculate the ground-state fidelity using DMRG?
http://itensor.org/support/1140/can-you-calculate-the-ground-state-fidelity-using-dmrg?show=1141#a1141
<p>Hi, so yes you can calculate the fidelity and the way you are doing it (using overlap between two MPS) is correct.</p>
<p>I'm not sure why you are getting incorrect results. It could be due to many various reasons including an error in constructing your Hamiltonian; insufficient convergence of DMRG; poor selection of initial states; finite size effects; etc. </p>
<p>I'd recommend studying a particular set of Hamiltonian parameters in detail, trying out different numbers of sweeps and looking at the convergence of the MPS by looking closely at the reported truncation error, for example. Then if you are still getting an incorrect fidelity for that particular Hamiltonian you will be in a better position to assess why it's happening.</p>
<p>Please let me know if I can be of more help, like if you suspect there is an issue with one of the ITensor routines. </p>
<p>Best regards,<br>
Miles</p>
http://itensor.org/support/1140/can-you-calculate-the-ground-state-fidelity-using-dmrg?show=1141#a1141Sun, 18 Nov 2018 17:05:56 +0000MPI and disorder average
http://itensor.org/support/1139/mpi-and-disorder-average
<p>Hi,</p>
<p>I like to make my code parallel in order to do some disorder averaging . I used openmp but getting segmentation fault error whenever using more than one thread. <br>
I looked into the discussion section of itensor and found :<br>
<a rel="nofollow" href="http://itensor.org/support/837/possible-several-processes-parallel-without-segmentation">http://itensor.org/support/837/possible-several-processes-parallel-without-segmentation</a></p>
<p>It seems that, there is an issue using openMP in itensor. Is there any other way to make my code parallel? </p>
<p>Thanks in advance!</p>
<p>Ranjan</p>
http://itensor.org/support/1139/mpi-and-disorder-averageWed, 14 Nov 2018 14:56:13 +0000Answered: time evolution of singlet state using iTEBD ?
http://itensor.org/support/1133/time-evolution-of-singlet-state-using-itebd?show=1137#a1137
<p>Hi, so this isn't provided inside of the ITensor library, but there is a user-contributed iTEBD code based on ITensor.</p>
<p>For a link to it, please see this page:</p>
<p><a rel="nofollow" href="http://itensor.org/codes.html">http://itensor.org/codes.html</a></p>
http://itensor.org/support/1133/time-evolution-of-singlet-state-using-itebd?show=1137#a1137Mon, 12 Nov 2018 18:47:33 +0000Answered: Problem with framework Accelerate
http://itensor.org/support/1134/problem-with-framework-accelerate?show=1135#a1135
<p>Dear Giuseppe,<br>
I can't say whether this issue will affect the working of ITensor, but fortunately there is a fix for it, so I'd recommend doing the fix then recompiling ITensor (and hopefully then you won't see the warnings). Here is a link explaining the fix:</p>
<p><a rel="nofollow" href="http://sd.jtimothyking.com/2018/07/26/stub-file-and-library-file-out-of-sync/">http://sd.jtimothyking.com/2018/07/26/stub-file-and-library-file-out-of-sync/</a></p>
<p>Finally, if you can get Intel MKL I'd strongly recommend that over Apple Accelerate / VecLib. MKL now has a free license. The reason I recommend it is that I've found some cases over the years where Accelerate gives less accurate results than MKL on certain tough cases (matrix decompositions involving small numbers etc.) and as a bonus, MKL is also much faster.</p>
<p>Best regards,<br>
Miles</p>
http://itensor.org/support/1134/problem-with-framework-accelerate?show=1135#a1135Mon, 12 Nov 2018 15:35:14 +0000Answered: Error message regarding the operator Sx2 (SpinTwo siteset)
http://itensor.org/support/1127/error-message-regarding-the-operator-sx2-spintwo-siteset?show=1130#a1130
<p>Hi, thanks for the question. So the issue is a rather technical one and has to do with a tricky design issue we have with using a single site set type for both ITensor and IQTensor tensor types. We have a plan to fix this more deeply in the library, but for now you have to do the following steps:</p>
<ol>
<li><p>when defining an operator such as Sx^2 inside your site set, add the line<br>
Op = mixedIQTensor(dag(s),sP);<br>
before setting the elements of your operator. See the file itensor/mps/sites/spinhalf.h and where the "Sx" operator is defined for an example.</p></li>
<li><p>when retrieving your operator from the sites.op("Sx2",j) method, make sure to convert it to an ITensor</p></li>
</ol>
<p>You will need to use ITensors, and not IQTensors, to work with operators such as Sx^2 in your own code since such an operator does not conserve the total Sz quantum number.</p>
<p>Best regards,<br>
Miles</p>
http://itensor.org/support/1127/error-message-regarding-the-operator-sx2-spintwo-siteset?show=1130#a1130Tue, 06 Nov 2018 16:02:32 +0000