Skip to content

Deep copying MPS with copy#387

Open
20akshay00 wants to merge 5 commits intoQuantumKitHub:mainfrom
20akshay00:mps-copy
Open

Deep copying MPS with copy#387
20akshay00 wants to merge 5 commits intoQuantumKitHub:mainfrom
20akshay00:mps-copy

Conversation

@20akshay00
Copy link
Contributor

Fixes #386. Probably should add more tests also for copy operations on all other objects like MPOs.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2026

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic main) to apply these changes.

Click here to view the suggested changes.
diff --git a/test/states/infinitemps.jl b/test/states/infinitemps.jl
index 9389fe2..1c34162 100644
--- a/test/states/infinitemps.jl
+++ b/test/states/infinitemps.jl
@@ -12,7 +12,7 @@ using TensorKit
 using TensorKit: ℙ
 
 @testset "InfiniteMPS ($(sectortype(D)), $elt)" for (D, d, elt) in
-                                                    [(ℙ^10, ℙ^2, ComplexF64), (Rep[U₁](1 => 3), Rep[U₁](0 => 1), ComplexF64)]
+    [(ℙ^10, ℙ^2, ComplexF64), (Rep[U₁](1 => 3), Rep[U₁](0 => 1), ComplexF64)]
     tol = Float64(eps(real(elt)) * 100)
 
     ψ = InfiniteMPS([rand(elt, D * d, D), rand(elt, D * d, D)]; tol)
@@ -31,7 +31,7 @@ using TensorKit: ℙ
 
     for i in 1:length(ψ)
         @plansor difference[-1 -2; -3] := ψ.AL[i][-1 -2; 1] * ψ.C[i][1; -3] -
-                                          ψ.C[i-1][-1; 1] * ψ.AR[i][1 -2; -3]
+            ψ.C[i - 1][-1; 1] * ψ.AR[i][1 -2; -3]
         @test norm(difference, Inf) < tol * 10
 
         @test l_LL(ψ, i) * TransferMatrix(ψ.AL[i], ψ.AL[i]) ≈ l_LL(ψ, i + 1)

@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/states/finitemps.jl 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/states/infinitemps.jl 46.32% <100.00%> (-31.62%) ⬇️
src/states/finitemps.jl 33.85% <0.00%> (-60.70%) ⬇️

... and 72 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for the formatting issues, this looks great, thanks!
As a small FYI, I slightly screwed up the last PR so still have to fix some of the tests, so failures might actually be unrelate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copying an MPS currently only makes a shallow copy

2 participants

Comments