diff --git a/Project.toml b/Project.toml index 3d607b569..7fee4d0df 100644 --- a/Project.toml +++ b/Project.toml @@ -6,10 +6,8 @@ version = "0.12.0" [deps] Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" BlockTensorKit = "5f87ffc2-9cf1-4a46-8172-465d160bd8cd" +Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -FLoops = "cc61a311-1640-44b5-9fba-1b764f453329" -FastClosures = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a" -FoldsThreads = "9c68100b-dfe1-47cf-94c8-95104e173443" HalfIntegers = "f0d1745a-41c9-11e9-1dd9-e5d34d218721" KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -21,17 +19,14 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" TensorKit = "07d1fe3e-3e46-537d-9eac-e9e13d0d4cec" TensorKitManifolds = "11fa318c-39cb-4a83-b1ed-cdc7ba1e3684" -Transducers = "28d57a85-8fef-5791-bfe6-a80928e7c999" VectorInterface = "409d34a3-91d5-4945-b6ec-7529ddf182d8" [compat] Accessors = "0.1" Aqua = "0.8.9" BlockTensorKit = "0.1.1" +Compat = "3.47, 4.10" DocStringExtensions = "0.9.3" -FLoops = "0.1, 0.2" -FastClosures = "0.3" -FoldsThreads = "0.1" HalfIntegers = "1.6.0" KrylovKit = "0.8.3" LinearAlgebra = "1.6" @@ -48,7 +43,6 @@ TensorKitManifolds = "0.7" TensorOperations = "5" Test = "1" TestExtras = "0.3" -Transducers = "0.4" VectorInterface = "0.2, 0.3, 0.4, 0.5" julia = "1.10" diff --git a/src/MPSKit.jl b/src/MPSKit.jl index a2b7555cb..a83c9e740 100644 --- a/src/MPSKit.jl +++ b/src/MPSKit.jl @@ -1,12 +1,69 @@ module MPSKit +# Public API +# ---------- +# utility: +export PeriodicArray, PeriodicVector, PeriodicMatrix +export WindowArray +export left_virtualspace, right_virtualspace, physicalspace +export braille + +# states: +export FiniteMPS +export InfiniteMPS +export WindowMPS +export MultilineMPS +export QP, LeftGaugedQP, RightGaugedQP + +# operators: +export AbstractMPO +export MPO, FiniteMPO, InfiniteMPO +export MPOHamiltonian, FiniteMPOHamiltonian, InfiniteMPOHamiltonian +export MultilineMPO +export UntimedOperator, TimedOperator, MultipliedOperator, LazySum + +# environments: +export environments +export leftenv, rightenv + +# algorithms: +export find_groundstate, find_groundstate! +export leading_boundary +export approximate, approximate! +export VUMPS, VOMPS, DMRG, DMRG2, IDMRG1, IDMRG2, GradientGrassmann +export excitations +export FiniteExcited, QuasiparticleAnsatz, ChepigaAnsatz, ChepigaAnsatz2 +export time_evolve, timestep, timestep!, make_time_mpo +export TDVP, TDVP2, WI, WII, TaylorCluster +export changebonds, changebonds! +export VUMPSSvdCut, OptimalExpand, SvdCut, RandExpand +export propagator +export DynamicalDMRG, NaiveInvert, Jeckelmann +export exact_diagonalization, fidelity_susceptibility + +# toolbox: +export expectation_value, correlator, variance +export correlation_length, marek_gap, transfer_spectrum +export entropy, entanglement_spectrum +export open_boundary_conditions, periodic_boundary_conditions +export entanglementplot, transferplot +export r_LL, l_LL, r_RR, l_RR, r_RL, r_LR, l_RL, l_LR # TODO: rename + +# unexported +using Compat: @compat +@compat public DynamicTols +@compat public VERBOSE_NONE, VERBOSE_WARN, VERBOSE_CONV, VERBOSE_ITER, VERBOSE_ALL +@compat public IterLog, loginit!, logiter!, logfinish!, logcancel! + +# Imports +# ------- using TensorKit using TensorKit: BraidingTensor using BlockTensorKit using KrylovKit using KrylovKit: KrylovAlgorithm -using OptimKit, FastClosures -using Base.Threads, FLoops, Transducers, FoldsThreads +using OptimKit +using Base.Threads using Base.Iterators using RecipesBase using VectorInterface @@ -21,49 +78,8 @@ using Base: @kwdef using LoggingExtras using OhMyThreads -# bells and whistles for mpses -export InfiniteMPS, FiniteMPS, WindowMPS, MultilineMPS -export PeriodicArray, PeriodicVector, PeriodicMatrix, WindowArray -export MPSTensor -export QP, LeftGaugedQP, RightGaugedQP -export r_LL, l_LL, r_RR, l_RR, r_RL, r_LR, l_RL, l_LR # should be properties - -# useful utility functions? -export add_util_leg, max_Ds, recalculate! -export left_virtualspace, right_virtualspace, physicalspace -export entanglementplot, transferplot -export braille - -# hamiltonian things -export AbstractMPO -export MPO, FiniteMPO, InfiniteMPO -export MPOHamiltonian, FiniteMPOHamiltonian, InfiniteMPOHamiltonian -export SparseMPO, DenseMPO, MultilineMPO -export UntimedOperator, TimedOperator, MultipliedOperator, LazySum - -export ∂C, ∂AC, ∂AC2, environments, expectation_value, effective_excitation_hamiltonian -export leftenv, rightenv - -# algos -export find_groundstate!, find_groundstate, leading_boundary -export VUMPS, VOMPS, DMRG, DMRG2, IDMRG1, IDMRG2, GradientGrassmann -export excitations, FiniteExcited, QuasiparticleAnsatz, ChepigaAnsatz, ChepigaAnsatz2 -export marek_gap, correlation_length, correlator -export time_evolve, timestep!, timestep -export TDVP, TDVP2, make_time_mpo, WI, WII, TaylorCluster -export entanglement_spectrum, transfer_spectrum, variance -export changebonds!, changebonds, VUMPSSvdCut, OptimalExpand, SvdCut, RandExpand -export entropy -export propagator, NaiveInvert, Jeckelmann, DynamicalDMRG -export fidelity_susceptibility -export approximate!, approximate -export periodic_boundary_conditions, open_boundary_conditions -export exact_diagonalization - -# transfer matrix -export TransferMatrix -export transfer_left, transfer_right - +# Includes +# -------- include("algorithms/algorithm.jl") # submodules diff --git a/src/algorithms/excitation/quasiparticleexcitation.jl b/src/algorithms/excitation/quasiparticleexcitation.jl index 53b124e3c..4b6226702 100644 --- a/src/algorithms/excitation/quasiparticleexcitation.jl +++ b/src/algorithms/excitation/quasiparticleexcitation.jl @@ -41,7 +41,7 @@ function excitations(H, alg::QuasiparticleAnsatz, ϕ₀::InfiniteQP, lenvs, renv num=1, kwargs...) qp_envs(ϕ) = environments(ϕ, H, lenvs, renvs; kwargs...) E = effective_excitation_renormalization_energy(H, ϕ₀, lenvs, renvs) - H_eff = @closure(ϕ -> effective_excitation_hamiltonian(H, ϕ, qp_envs(ϕ), E)) + H_eff(ϕ) = effective_excitation_hamiltonian(H, ϕ, qp_envs(ϕ), E) Es, ϕs, convhist = eigsolve(H_eff, ϕ₀, num, :SR, alg.alg) convhist.converged < num && @@ -134,7 +134,7 @@ function excitations(H, alg::QuasiparticleAnsatz, ϕ₀::FiniteQP, renvs=ϕ₀.trivial ? lenvs : environments(ϕ₀.right_gs, H); num=1) qp_envs(ϕ) = environments(ϕ, H, lenvs, renvs) E = effective_excitation_renormalization_energy(H, ϕ₀, lenvs, renvs) - H_eff = @closure(ϕ -> effective_excitation_hamiltonian(H, ϕ, qp_envs(ϕ), E)) + H_eff(ϕ) = effective_excitation_hamiltonian(H, ϕ, qp_envs(ϕ), E) Es, ϕs, convhist = eigsolve(H_eff, ϕ₀, num, :SR, alg.alg) convhist.converged < num && diff --git a/src/algorithms/grassmann.jl b/src/algorithms/grassmann.jl index 8ff4a3ea6..f19064834 100644 --- a/src/algorithms/grassmann.jl +++ b/src/algorithms/grassmann.jl @@ -11,7 +11,8 @@ The module exports nothing, and all references to it should be qualified, e.g. module GrassmannMPS using ..MPSKit -using ..MPSKit: AbstractMPSEnvironments, InfiniteEnvironments, MultilineEnvironments, ∂∂AC +using ..MPSKit: AbstractMPSEnvironments, InfiniteEnvironments, MultilineEnvironments, ∂∂AC, + recalculate! using TensorKit using OhMyThreads import TensorKitManifolds.Grassmann diff --git a/src/operators/abstractmpo.jl b/src/operators/abstractmpo.jl index f0218fb8e..3caec44ee 100644 --- a/src/operators/abstractmpo.jl +++ b/src/operators/abstractmpo.jl @@ -14,7 +14,7 @@ const SparseMPO{O<:SparseBlockTensorMap} = AbstractMPO{O} Base.size(mpo::AbstractMPO, args...) = size(parent(mpo), args...) Base.length(mpo::AbstractMPO) = length(parent(mpo)) -@inline Base.getindex(mpo::AbstractMPO, args...) = getindex(parent(mpo), args...) +@inline Base.getindex(mpo::AbstractMPO, i::Int) = getindex(parent(mpo), i) @inline function Base.setindex!(mpo::AbstractMPO, value::MPOTensor, i::Int) setindex!(parent(mpo), value, i) return mpo diff --git a/src/operators/lazysum.jl b/src/operators/lazysum.jl index 5d911cbf4..8fe584ea9 100644 --- a/src/operators/lazysum.jl +++ b/src/operators/lazysum.jl @@ -19,10 +19,10 @@ end # for the AbstractArray interface Base.size(x::LazySum) = size(x.ops) -Base.getindex(x::LazySum, i) = x.ops[i] +Base.getindex(x::LazySum, i::Int) = x.ops[i] Base.length(x::LazySum) = prod(size(x)) Base.similar(x::LazySum, ::Type{S}, dims::Dims) where {S} = LazySum(similar(x.ops, S, dims)) -Base.setindex!(A::LazySum, X, i) = setindex!(A.ops, X, i) +Base.setindex!(A::LazySum, X, i::Int) = (setindex!(A.ops, X, i); A) # Holy traits TimeDependence(x::LazySum) = istimed(x) ? TimeDependent() : NotTimeDependent() diff --git a/src/operators/mpohamiltonian.jl b/src/operators/mpohamiltonian.jl index 80aebe1e9..564da5b7d 100644 --- a/src/operators/mpohamiltonian.jl +++ b/src/operators/mpohamiltonian.jl @@ -475,6 +475,7 @@ end Base.:-(H::MPOHamiltonian, λs::AbstractVector{<:Number}) = H + (-λs) Base.:-(λs::AbstractVector{<:Number}, H::MPOHamiltonian) = λs + (-H) +Base.:-(H1::MPOHamiltonian, H2::MPOHamiltonian) = H1 + (-H2) function VectorInterface.scale!(H::InfiniteMPOHamiltonian, λ::Number) foreach(parent(H)) do h diff --git a/src/states/finitemps.jl b/src/states/finitemps.jl index 2072c28be..92a41b31e 100644 --- a/src/states/finitemps.jl +++ b/src/states/finitemps.jl @@ -66,10 +66,12 @@ struct FiniteMPS{A<:GenericMPSTensor,B<:MPSBondTensor} <: AbstractFiniteMPS B<:MPSBondTensor} return new{A,B}(ALs, ARs, ACs, Cs) end - function FiniteMPS(ALs::Vector{Union{Missing,A}}, ARs::Vector{Union{Missing,A}}, - ACs::Vector{Union{Missing,A}}, - Cs::Vector{Union{Missing,B}}) where {A<:GenericMPSTensor, - B<:MPSBondTensor} + function FiniteMPS(ALs::Vector{MA}, ARs::Vector{MA}, + ACs::Vector{MA}, + Cs::Vector{MB}) where {MA<:Union{GenericMPSTensor,Missing}, + MB<:Union{MPSBondTensor,Missing}} + A = _not_missing_type(MA) + B = _not_missing_type(MB) length(ACs) == length(Cs) - 1 == length(ALs) == length(ARs) || throw(DimensionMismatch("length mismatch of tensors")) sum(ismissing.(ACs)) + sum(ismissing.(Cs)) < length(ACs) + length(Cs) || @@ -126,6 +128,16 @@ struct FiniteMPS{A<:GenericMPSTensor,B<:MPSBondTensor} <: AbstractFiniteMPS end end +_not_missing_type(::Type{Missing}) = throw(ArgumentError("Only missing type present")) +function _not_missing_type(::Type{T}) where {T} + if T isa Union + return (!(T.a === Missing) && !(T.b === Missing)) ? T : + !(T.a === Missing) ? _not_missing_type(T.b) : _not_missing_type(T.b) + else + return T + end +end + function Base.getproperty(ψ::FiniteMPS, prop::Symbol) if prop == :AL return ALView(ψ) diff --git a/src/states/ortho.jl b/src/states/ortho.jl index 260e69631..a89df5b7f 100644 --- a/src/states/ortho.jl +++ b/src/states/ortho.jl @@ -163,6 +163,8 @@ function regauge!(CL::MPSBondTensor, AC::GenericMPSTensor; alg=LQpos()) AR_tail = mul!(AC_tail, Q_C', Q_AC) return _transpose_front(AR_tail) end +# fix ambiguity + error +regauge!(::MPSBondTensor, ::MPSBondTensor; alg=QRpos()) = error("method ambiguity") # Implementation # -------------- @@ -218,7 +220,7 @@ function gauge_orth_step!(it::IterativeSolver{LeftCanonical}, state) (; AL, C, A_tail, CA_tail) = state for i in 1:length(AL) mul!(CA_tail[i], C[i - 1], A_tail[i]) - _repartition!(AL[i], CA_tail[i]) + repartition!(AL[i], CA_tail[i]) AL[i], C[i] = leftorth!(AL[i]; alg=it.alg_orth) end normalize!(C[end]) @@ -275,9 +277,9 @@ function gauge_orth_step!(it::IterativeSolver{RightCanonical}, state) (; A, AR, C, AC_tail) = state for i in length(AR):-1:1 AC = mul!(AR[i], A[i], C[i]) # use AR as temporary storage for A * C - tmp = _repartition!(AC_tail[i], AC) + tmp = repartition!(AC_tail[i], AC) C[i - 1], tmp = rightorth!(tmp; alg=it.alg_orth) - _repartition!(AR[i], tmp) # TODO: avoid doing this every iteration + repartition!(AR[i], tmp) # TODO: avoid doing this every iteration end normalize!(C[end]) return C[end] diff --git a/src/states/quasiparticle_state.jl b/src/states/quasiparticle_state.jl index 10f36cbe0..3801690a0 100644 --- a/src/states/quasiparticle_state.jl +++ b/src/states/quasiparticle_state.jl @@ -216,41 +216,41 @@ LinearAlgebra.normalize!(w::QP) = rmul!(w, 1 / norm(w)) Base.length(v::QP) = length(v.Xs) Base.eltype(::Type{<:QP{<:Any,<:Any,T}}) where {T} = T -function LinearAlgebra.mul!(w::T, a, v::T) where {T<:QP} +function LinearAlgebra.mul!(w::T, a::Number, v::T) where {T<:QP} @inbounds for (i, j) in zip(w.Xs, v.Xs) LinearAlgebra.mul!(i, a, j) end return w end -function LinearAlgebra.mul!(w::T, v::T, a) where {T<:QP} +function LinearAlgebra.mul!(w::T, v::T, a::Number) where {T<:QP} @inbounds for (i, j) in zip(w.Xs, v.Xs) LinearAlgebra.mul!(i, j, a) end return w end -function LinearAlgebra.rmul!(v::QP, a) +function LinearAlgebra.rmul!(v::QP, a::Number) for x in v.Xs LinearAlgebra.rmul!(x, a) end return v end -function LinearAlgebra.axpy!(a, v::T, w::T) where {T<:QP} +function LinearAlgebra.axpy!(a::Number, v::T, w::T) where {T<:QP} @inbounds for (i, j) in zip(w.Xs, v.Xs) LinearAlgebra.axpy!(a, j, i) end return w end -function LinearAlgebra.axpby!(a, v::T, b, w::T) where {T<:QP} +function LinearAlgebra.axpby!(a::Number, v::T, b::Number, w::T) where {T<:QP} @inbounds for (i, j) in zip(w.Xs, v.Xs) LinearAlgebra.axpby!(a, j, b, i) end return w end -Base.:*(v::QP, a) = mul!(similar(v), a, v) -Base.:*(a, v::QP) = mul!(similar(v), a, v) +Base.:*(v::QP, a::Number) = mul!(similar(v), a, v) +Base.:*(a::Number, v::QP) = mul!(similar(v), a, v) Base.zero(v::QP) = v * 0; @@ -273,7 +273,7 @@ function Base.convert(::Type{<:FiniteMPS}, v::QP{S}) where {S<:FiniteMPS} #step 0 : fuse the utility leg of B with the first leg of B orig_Bs = map(i -> v[i], 1:length(v)) - Bs = @closure map(orig_Bs) do t + Bs = map(orig_Bs) do t frontmap = isomorphism(storagetype(t), fuse(utl * _firstspace(t)), utl * _firstspace(t)) @plansor tt[-1 -2; -3] := t[1 -2; 2 -3] * frontmap[-1; 2 1] diff --git a/src/utility/utility.jl b/src/utility/utility.jl index 8ab925709..d926c3bdb 100644 --- a/src/utility/utility.jl +++ b/src/utility/utility.jl @@ -1,31 +1,11 @@ function _transpose_front(t::AbstractTensorMap) # make TensorMap{S,N₁+N₂-1,1} - I1 = TensorKit.codomainind(t) - I2 = TensorKit.domainind(t) - return transpose(t, ((I1..., reverse(Base.tail(I2))...), (I2[1],))) + return repartition(t, numind(t) - 1, 1) end function _transpose_tail(t::AbstractTensorMap) # make TensorMap{S,1,N₁+N₂-1} - I1 = TensorKit.codomainind(t) - I2 = TensorKit.domainind(t) - return transpose(t, ((I1[1],), (I2..., reverse(Base.tail(I1))...))) + return repartition(t, 1, numind(t) - 1) end function _transpose_as(t1::AbstractTensorMap, t2::AbstractTensorMap) - I1 = (TensorKit.codomainind(t1)..., reverse(TensorKit.domainind(t1))...) - - A = ntuple(x -> I1[x], numout(t2)) - B = ntuple(x -> I1[x + numout(t2)], numin(t2)) - - return transpose(t1, (A, B)) -end - -function _repartition!(tdst::AbstractTensorMap{<:Any,S,N₁,N₂}, - tsrc::AbstractTensorMap{<:Any,S}) where {S,N₁,N₂} - numind(tdst) == numind(tsrc) || throw(ArgumentError("number of indices must match")) - inds_dst = (TensorKit.codomainind(tdst)..., reverse(TensorKit.domainind(tdst))...) - inds_src = (TensorKit.codomainind(tsrc)..., reverse(TensorKit.domainind(tsrc))...) - @boundscheck all(space.(Ref(tdst), inds_dst) .== space.(Ref(tsrc), inds_src)) - - p = (ntuple(x -> inds_src[x], N₁), reverse(ntuple(x -> inds_src[x + N₁], N₂))) - return transpose!(tdst, tsrc, p) + return repartition(t1, numout(t2), numin(t2)) end function _similar_tail(A::AbstractTensorMap) @@ -118,17 +98,6 @@ function _can_unambiguously_braid(sp::VectorSpace) return true end -#needed this; perhaps move to tensorkit? -TensorKit.fuse(f::T) where {T<:VectorSpace} = f - -function inplace_add!(a::Union{AbstractTensorMap,Nothing}, - b::Union{AbstractTensorMap,Nothing}) - isnothing(a) && isnothing(b) && return nothing - isnothing(a) && return b - isnothing(b) && return a - return axpy!(true, a, b) -end - #= map every element in the tensormap to dfun(E) allows us to create random tensormaps for any storagetype @@ -159,11 +128,6 @@ function tensorexpr(name::Symbol, indout, indin) return Expr(:typed_vcat, name, Expr(:row, indout...), Expr(:row, indin...)) end -# check all elements are equal -> only defined in 1.8+ -@static if !isdefined(Base, :allequal) - allequal(itr) = isempty(itr) ? true : all(isequal(first(itr)), itr) -end - function check_length(a, b...) L = length(a) all(==(L), length.(b)) || throw(ArgumentError("lengths must match")) diff --git a/test/algorithms.jl b/test/algorithms.jl index fa4dc7e2d..b96752383 100644 --- a/test/algorithms.jl +++ b/test/algorithms.jl @@ -498,7 +498,7 @@ end Δt = 0.1 expH = make_time_mpo(H, Δt, WII()) - O = DenseMPO(expH) + O = MPSKit.DenseMPO(expH) Op = periodic_boundary_conditions(O, 10) Op′ = changebonds(Op, SvdCut(; trscheme=truncdim(5))) @@ -698,8 +698,8 @@ end dt = 1e-3 sW1 = make_time_mpo(H, dt, TaylorCluster(; N=3)) sW2 = make_time_mpo(H, dt, WII()) - W1 = DenseMPO(sW1) - W2 = DenseMPO(sW2) + W1 = MPSKit.DenseMPO(sW1) + W2 = MPSKit.DenseMPO(sW2) ψ1, _ = approximate(ψ, (sW1, ψ), VOMPS(; verbosity)) ψ2, _ = approximate(ψ, (W2, ψ), VOMPS(; verbosity)) diff --git a/test/operators.jl b/test/operators.jl index 57444b7c5..4c09ae65e 100644 --- a/test/operators.jl +++ b/test/operators.jl @@ -241,7 +241,7 @@ end ψ = InfiniteMPS([pspace], [ou ⊕ pspace]) - W = DenseMPO(make_time_mpo(ham, 1im * 0.5, WII())) + W = MPSKit.DenseMPO(make_time_mpo(ham, 1im * 0.5, WII())) @test W * (W * ψ) ≈ (W * W) * ψ atol = 1e-2 # TODO: there is a normalization issue here end diff --git a/test/other.jl b/test/other.jl index b0dc6fd7e..494b1df17 100644 --- a/test/other.jl +++ b/test/other.jl @@ -15,7 +15,7 @@ using Aqua @testset "Aqua" begin # TODO fix this - Aqua.test_all(MPSKit; ambiguities=false, piracies=false, unbound_args=false) + Aqua.test_all(MPSKit; ambiguities=false, piracies=false) end @testset "plot tests" begin diff --git a/test/states.jl b/test/states.jl index eebd254b5..1ffbed239 100644 --- a/test/states.jl +++ b/test/states.jl @@ -9,6 +9,7 @@ using ..TestSetup using Test, TestExtras using MPSKit using MPSKit: _transpose_front, _transpose_tail +using MPSKit: TransferMatrix using TensorKit using TensorKit: ℙ @@ -185,8 +186,8 @@ end normalize!(ψ) #rand_quasiparticle is a private non-exported function - ϕ₁ = MPSKit.LeftGaugedQP(rand, ψ) - ϕ₂ = MPSKit.LeftGaugedQP(rand, ψ) + ϕ₁ = LeftGaugedQP(rand, ψ) + ϕ₂ = LeftGaugedQP(rand, ψ) @test norm(axpy!(1, ϕ₁, copy(ϕ₂))) ≤ norm(ϕ₁) + norm(ϕ₂) @test norm(ϕ₁) * 3 ≈ norm(ϕ₁ * 3) @@ -200,7 +201,7 @@ end @test norm(ϕ₁_f) ≈ norm(ϕ₁) atol = 1e-5 ev_f = expectation_value(ϕ₁_f, H) - expectation_value(ψ, H) - ev_q = dot(ϕ₁, effective_excitation_hamiltonian(H, ϕ₁)) + ev_q = dot(ϕ₁, MPSKit.effective_excitation_hamiltonian(H, ϕ₁)) @test ev_f ≈ ev_q atol = 1e-5 end @@ -212,14 +213,14 @@ end ψ = InfiniteMPS(fill(d, period), fill(D, period)) #rand_quasiparticle is a private non-exported function - ϕ₁ = MPSKit.LeftGaugedQP(rand, ψ) - ϕ₂ = MPSKit.LeftGaugedQP(rand, ψ) + ϕ₁ = LeftGaugedQP(rand, ψ) + ϕ₂ = LeftGaugedQP(rand, ψ) @test norm(axpy!(1, ϕ₁, copy(ϕ₂))) ≤ norm(ϕ₁) + norm(ϕ₂) @test norm(ϕ₁) * 3 ≈ norm(ϕ₁ * 3) @test dot(ϕ₁, - convert(MPSKit.LeftGaugedQP, convert(MPSKit.RightGaugedQP, ϕ₁))) ≈ + convert(LeftGaugedQP, convert(RightGaugedQP, ϕ₁))) ≈ dot(ϕ₁, ϕ₁) atol = 1e-10 end end