Skip to content

Commit

Permalink
Fix a bug in dense_to_mps
Browse files Browse the repository at this point in the history
  • Loading branch information
Qottmann committed Oct 10, 2024
1 parent acd1f70 commit 74b813e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion demonstrations/tutorial_mps.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def dense_to_mps(psi, bond_dim):
Ms.append(U)
Ss.append(Ss)
bondL = Vd.shape[0]
psi = Vd
psi = np.tensordot(np.diag(S), Vd, 1)

for _ in range(n-2):
psi = np.reshape(psi, (2*bondL, -1)) # reshape psi[2 * bondL, (2x2x2...)]
Expand Down

0 comments on commit 74b813e

Please sign in to comment.