Skip to content

Regenerate examples#340

Merged
leburgel merged 5 commits intomasterfrom
rerun-examples
Mar 6, 2026
Merged

Regenerate examples#340
leburgel merged 5 commits intomasterfrom
rerun-examples

Conversation

@pbrehmer
Copy link
Collaborator

@pbrehmer pbrehmer commented Mar 5, 2026

It has been a while since we last generated all examples and many things have changed since then. Here I regenerate almost all examples with updated dependencies. There actually were some bugs in the examples that were throwing errors, so these have now been fixed.

Only the boundary MPS example won't run at the moment due to some MPO printing problems, I think the code itself runs fine. See the error message:

Details

LoadError: MethodError: no method matching physicalspace(::Tuple{TensorKit.TensorMap{ComplexF64, TensorKit.ComplexSpace, 1, 4, Vector{ComplexF64}}, TensorKit.TensorMap{ComplexF64, TensorKit.ComplexSpace, 1, 4, Vector{ComplexF64}}})
The function `physicalspace` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  physicalspace(::MPSKit.MultilineMPS)
   @ MPSKit ~/.julia/packages/MPSKit/9ITGf/src/states/multilinemps.jl:109
  physicalspace(::MPSKit.MultilineMPS, ::CartesianIndex{2})
   @ MPSKit ~/.julia/packages/MPSKit/9ITGf/src/states/multilinemps.jl:108
  physicalspace(::MPSKit.MultilineMPS, ::Int64, ::Int64)
   @ MPSKit ~/.julia/packages/MPSKit/9ITGf/src/states/multilinemps.jl:107
  ...

Stacktrace:
  [1] physicalspace(mpo::MPSKit.InfiniteMPO{Tuple{TensorKit.TensorMap{ComplexF64, TensorKit.ComplexSpace, 1, 4, Vector{ComplexF64}}, TensorKit.TensorMap{ComplexF64, TensorKit.ComplexSpace, 1, 4, Vector{ComplexF64}}}}, site::Int64)
    @ MPSKit ~/.julia/packages/MPSKit/9ITGf/src/operators/abstractmpo.jl:31
  [2] show(io::IOBuffer, ::MIME{Symbol("text/plain")}, mpo::MPSKit.InfiniteMPO{Tuple{TensorKit.TensorMap{ComplexF64, TensorKit.ComplexSpace, 1, 4, Vector{ComplexF64}}, TensorKit.TensorMap{ComplexF64, TensorKit.ComplexSpace, 1, 4, Vector{ComplexF64}}}})
    @ MPSKit ~/.julia/packages/MPSKit/9ITGf/src/utility/show.jl:154
  [3] show(io::IOBuffer, m::String, x::MPSKit.InfiniteMPO{Tuple{TensorKit.TensorMap{ComplexF64, TensorKit.ComplexSpace, 1, 4, Vector{ComplexF64}}, TensorKit.TensorMap{ComplexF64, TensorKit.ComplexSpace, 1, 4, Vector{ComplexF64}}}})
    @ Base.Multimedia ./multimedia.jl:123
  [4] execute_markdown!(io::IOBuffer, sb::Module, block::String, outputdir::String; inputfile::String, fake_source::String, flavor::Literate.DocumenterFlavor, image_formats::Vector{Tuple{MIME, String}}, file_prefix::String, softscope::Bool, continue_on_error::Bool)
    @ Literate ~/.julia/packages/Literate/On3EJ/src/Literate.jl:717
  [5] (::Literate.var"#42#43"{Dict{String, Any}, IOBuffer, Module, Literate.CodeChunk, Int64})()
    @ Literate ~/.julia/packages/Literate/On3EJ/src/Literate.jl:651
  [6] cd(f::Literate.var"#42#43"{Dict{String, Any}, IOBuffer, Module, Literate.CodeChunk, Int64}, dir::String)
    @ Base.Filesystem ./file.jl:112
  [7] markdown(inputfile::String, outputdir::String; config::Dict{Any, Any}, kwargs::@Kwargs{execute::Bool, name::String, preprocess::var"#attach_notebook_badge##12#attach_notebook_badge##13"{String}, mdstrings::Bool, nbviewer_root_url::String, binder_root_url::String, credits::Bool, repo_root_url::String})
    @ Literate ~/.julia/packages/Literate/On3EJ/src/Literate.jl:650
  [8] markdown
    @ ~/.julia/packages/Literate/On3EJ/src/Literate.jl:614 [inlined]
  [9] build_example(name::String)
    @ Main ~/repos/PEPSKit.jl/examples/make.jl:66
 [10] #build##18
    @ ~/repos/PEPSKit.jl/examples/make.jl:98 [inlined]
 [11] iterate
    @ ./generator.jl:48 [inlined]
 [12] collect_to!
    @ ./array.jl:848 [inlined]
 [13] collect_to_with_first!
    @ ./array.jl:826 [inlined]
 [14] _collect(c::Vector{String}, itr::Base.Generator{Vector{String}, var"#build##18#build##19"}, ::Base.EltypeUnknown, isz::Base.HasShape{1})
    @ Base ./array.jl:820
 [15] cd(f::var"#build##16#build##17", dir::String)
    @ Base.Filesystem ./file.jl:107
 [16] build()
    @ Main ~/repos/PEPSKit.jl/examples/make.jl:96
 [17] top-level scope
    @ ~/repos/PEPSKit.jl/examples/make.jl:106
 [18] include(mapexpr::Function, mod::Module, _path::String)
    @ Base ./Base.jl:307
 [19] top-level scope
    @ REPL[10]:1
in expression starting at /home/paul/repos/PEPSKit.jl/examples/make.jl:106

Is this known in MPSKit already? Anyways, I left the boundary MPS example as is for now but it would be nice to update that one as well.

@pbrehmer pbrehmer added the documentation Improvements or additions to documentation label Mar 5, 2026
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/networks/local_sandwich.jl 88.00% <100.00%> (+0.50%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

After the build completes, the updated documentation will be available here

@leburgel
Copy link
Member

leburgel commented Mar 5, 2026

We never defined MPSKit.physicalspace for our custom local sandwich types that go into the MPO. Aparently the show for InfiniteMPO changed to call physicalspace, which then didn't work for MPOs representing PEPS sandwich transfer operators. I added physicalspace and regenerated the example.

The printing is pretty wild though, actually showing all of the tensor elements in the MPS and MPO. I can't remember if this was always like this, or if something changed about that as well. But I guess this is now standard MPSKit behavior? Never mind, I reran with some old versions by accident, looks totally fine on the latest versions.

@pbrehmer pbrehmer enabled auto-merge (squash) March 5, 2026 17:12
@pbrehmer
Copy link
Collaborator Author

pbrehmer commented Mar 6, 2026

I updated the Bose-Hubbard example since the optimization was struggling a bit at the beginning; now it runs through smoothly. I think this should be good to go now.

@leburgel
Copy link
Member

leburgel commented Mar 6, 2026

I'm just going to add a quick test for the physicalspace thing since I did add that here, so we should cover it at least.

@leburgel leburgel disabled auto-merge March 6, 2026 15:22
@leburgel leburgel enabled auto-merge (squash) March 6, 2026 15:23
@leburgel leburgel merged commit d86143b into master Mar 6, 2026
63 checks passed
@leburgel leburgel deleted the rerun-examples branch March 6, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants