Two-site gate to MPS

,

Hello!
I’ll start by saying I’ve never worked with MPS or ITensor before, and I’m doing so for my bachelor’s thesis now, so excuse my ignorance.

I am following the official ITensor C++ documentation for applying a two-site gate to an MPS product state, which was built with 1D vectors at each site using the physical index, and not making use of bond indices. I contract the tensors at the two chosen sites, I contract it with the rank 4 tensor describing my gate (beam splitter), unprime indices, then do an SVD to reassign it back into the MPS sites.

What I do not understand is, since the SVD gives 2 matrices (U and S*V), how I am supposed to reassign it back: I would be expecting vectors, so to replace vectors with vectors in the MPS. Has this got to do with bond indices becoming relevant for a now-entangled state after a BS?

My code gives an error when using mps.set() to reassign the tensors; I could upload the error message as well, but I’m not sure if it’s needed since it is more of a theory question.

auto BS = ITensor(site_n, site_m, site_n_prime, site_m_prime); // Create the beam splitter tensor, with prime output indices

auto temp_mode = mps(index1) * mps(index2); // Contract the two modes
temp_mode *= BS; // Apply the beam splitter tensor
temp_mode.noPrime(); // Remove the prime indices

auto [U,S,V] = svd(temp_mode, {site_n}, {"MaxDim", 1}); // Perform an SVD on the resulting tensor
mps.set(index1, U); // Set the first and second mode back in the MPS
mps.set(index2, S*V);

Thank you very much in advance, sorry for the long question.

Davide

Well I understood my mistake, it was in a subsequent method I called incorrectly.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.