Skip to content

Define Base.show for SUWeight#168

Merged
lkdvos merged 2 commits intoQuantumKitHub:masterfrom
Yue-Zhengyuan:show-suweight
Apr 7, 2025
Merged

Define Base.show for SUWeight#168
lkdvos merged 2 commits intoQuantumKitHub:masterfrom
Yue-Zhengyuan:show-suweight

Conversation

@Yue-Zhengyuan
Copy link
Member

This PR defines Base.show for SUWeight, so we can use display(peps.weights) to see the diagonal elements in the weight matrices in an InfiniteWeightPEPS. It's a simple IO function so I don't have tests for it. A possible future improvement is to define a more compact output for println and print.

Example output for peps with U1Irrep symmetry:

SUWeight{TensorMap{Float64, GradedSpace{U1Irrep, TensorKit.SortedVectorDict{U1Irrep, Int64}}, 1, 1, Vector{Float64}}}
(1, 1, 1):
Irrep[U₁](0) = [1.0, 0.013284183529494106, 0.01025508746347934]
Irrep[U₁](-1) = [0.155297993782553]
(2, 1, 1):
Irrep[U₁](1/2) = [1.0, 0.013284183529494106]
Irrep[U₁](-1/2) = [0.155297993782553]
Irrep[U₁](3/2) = [0.01025508746347934]
(1, 2, 1):
Irrep[U₁](0) = [1.0, 0.013284183529494106]
Irrep[U₁](1) = [0.155297993782553]
Irrep[U₁](-1) = [0.01025508746347934]
(2, 2, 1):
Irrep[U₁](0) = [1.0, 0.013284183529494106, 0.01025508746347934]
Irrep[U₁](1) = [0.155297993782553]
(1, 1, 2):
Irrep[U₁](0) = [1.0, 0.013284183529494106]
Irrep[U₁](1) = [0.155297993782553]
Irrep[U₁](-1) = [0.01025508746347934]
(2, 1, 2):
Irrep[U₁](0) = [1.0, 0.013284183529494106, 0.01025508746347934]
Irrep[U₁](1) = [0.155297993782553]
(1, 2, 2):
Irrep[U₁](0) = [1.0, 0.013284183529494106, 0.01025508746347934]
Irrep[U₁](-1) = [0.155297993782553]
(2, 2, 2):
Irrep[U₁](1/2) = [1.0, 0.013284183529494106]
Irrep[U₁](-1/2) = [0.155297993782553]
Irrep[U₁](3/2) = [0.01025508746347934]

@codecov
Copy link

codecov bot commented Apr 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/states/infiniteweightpeps.jl 0.00% 9 Missing ⚠️
Files with missing lines Coverage Δ
src/states/infiniteweightpeps.jl 81.81% <0.00%> (-8.19%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pbrehmer
Copy link
Collaborator

pbrehmer commented Apr 7, 2025

Looks good to me, I'd be fine with merging this! Some tests sadly still time out but that's unrelated to this PR, see #166. We'll have to figure that out separately.

pbrehmer
pbrehmer previously approved these changes Apr 7, 2025
Co-authored-by: Lukas Devos <ldevos98@gmail.com>
@lkdvos lkdvos merged commit cfd4254 into QuantumKitHub:master Apr 7, 2025
30 of 39 checks passed
@Yue-Zhengyuan Yue-Zhengyuan deleted the show-suweight branch April 8, 2025 15:53
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.

3 participants