File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 822822function ITensors. contract (
823823 :: Algorithm"zipup" ,
824824 A:: MPO ,
825- B:: MPO ;
825+ B:: AbstractMPS ;
826826 cutoff= 1e-14 ,
827827 maxdim= maxlinkdim (A) * maxlinkdim (B),
828828 mindim= 1 ,
@@ -836,14 +836,15 @@ function ITensors.contract(
836836 N = length (A)
837837 N != length (B) &&
838838 throw (DimensionMismatch (" lengths of MPOs A ($N ) and B ($(length (B)) ) do not match" ))
839+ ResultType = typeof (B)
839840 # Special case for a single site
840- N == 1 && return MPO ([A[1 ] * B[1 ]])
841+ N == 1 && return ResultType ([A[1 ] * B[1 ]])
841842 A = orthogonalize (A, 1 )
842843 B = orthogonalize (B, 1 )
843844 A = sim (linkinds, A)
844845 sA = siteinds (uniqueinds, A, B)
845846 sB = siteinds (uniqueinds, B, A)
846- C = MPO (N)
847+ C = ResultType (N)
847848 lCᵢ = Index[]
848849 R = ITensor (true )
849850 for i in 1 : (N - 2 )
@@ -874,7 +875,6 @@ function ITensors.contract(
874875 mindim,
875876 kwargs... ,
876877 )
877- truncate! (C; kwargs... )
878878 return C
879879end
880880
You can’t perform that action at this time.
0 commit comments