Hey all,

I ran into a problem with finding S from a SVD and I would appreciate if someone can help me with my problem.

I am trying to develop in time an MPS in the following way:

I am starting with a product state MPS

|00.....\rangle

and operating with an H: H_{syk}= \sum\limits_{\substack{i,j=1\\\alpha,\beta\in(x,y,z)}}^{N-1}J^{\alpha\beta}_{ij} S^\alpha_i S^\beta_j

e^{-iH_{syk}t}

until I reach maximum entanglement. After that step I am coupling this bath to a spin \psi=\frac{1} {\sqrt{2}}( |00.....0\rangle +|00.....1\rangle)

and operation with the following hamiltonian:

\sum\limits_{\substack{i,j=1\\\alpha,\beta\in(x,y,z)}}^{N-1}J^{\alpha\beta}_{ij} S^\alpha_i S^\beta_j +\sum\limits_{i=1}^{N-1}g_iS_i^zS_N^z

but, the problem is that when I am operating this on my state (for 5 spin half)

e^{-I(H_{syk}+H_{int})t}|000..0\rangle \otimes \psi

and tries to calculate the difference between ‘S[1,1]-S[2,2]’ I get an error because is a 1X1 vector.

can someone help me understand why ?

This is the code I wrote: on the left is the script itself, and on the right the functions

Thanks for all the helpers!