|
23 | 23 | function _random_mpo_mps(pspace, Dspace, L; elt = ComplexF64) |
24 | 24 | Random.seed!(1357) |
25 | 25 | Wspace = Dspace |
26 | | - Vspaces = [oneunit(Wspace); fill(Wspace, L - 1); oneunit(Wspace)] |
| 26 | + Vspaces = [unitspace(Wspace); fill(Wspace, L - 1); unitspace(Wspace)] |
27 | 27 | O = FiniteMPO( |
28 | 28 | [rand(ComplexF64, Vspaces[i] ⊗ pspace ← pspace ⊗ Vspaces[i + 1]) for i in 1:L] |
29 | 29 | ) |
|
211 | 211 | @test info.truncation_errors ≈ info_ref.truncation_errors |
212 | 212 |
|
213 | 213 | # a destination with unrelated contents is overwritten entirely |
214 | | - dst = FiniteMPS(rand, ComplexF64, length(ψ), pspace, oneunit(Dspace) ⊕ Dspace ⊕ Dspace) |
| 214 | + dst = FiniteMPS(rand, ComplexF64, length(ψ), pspace, unitspace(Dspace) ⊕ Dspace ⊕ Dspace) |
215 | 215 | got, info = approximate!(dst, (O, ψ), alg) |
216 | 216 | @test norm(ref - got) / norm(ref) < 1.0e-12 |
217 | 217 | @test info.truncation_errors ≈ info_ref.truncation_errors |
|
248 | 248 | @testset "Zip-up with non-square MPO $(spacetype(pspace))" for (pspace, Dspace, _) in zipup_spacelist |
249 | 249 | Random.seed!(1357) |
250 | 250 | L = 4 |
251 | | - pspace′ = pspace ⊕ oneunit(pspace) # output physical space, different from the input one |
252 | | - Vspaces = [oneunit(Dspace); fill(Dspace, L - 1); oneunit(Dspace)] |
| 251 | + pspace′ = pspace ⊕ unitspace(pspace) # output physical space, different from the input one |
| 252 | + Vspaces = [unitspace(Dspace); fill(Dspace, L - 1); unitspace(Dspace)] |
253 | 253 | O = FiniteMPO( |
254 | 254 | [rand(ComplexF64, Vspaces[i] ⊗ pspace′ ← pspace ⊗ Vspaces[i + 1]) for i in 1:L] |
255 | 255 | ) |
|
0 commit comments