Skip to content

Conversation

@AFeuerpfeil
Copy link
Contributor

@AFeuerpfeil AFeuerpfeil commented Nov 19, 2025

This PR implements the methods AC2, dot, isapprox, norm, normalize(!) as well as the left and right fixedpoints for an AbstractMPS by dispatching on GeometryStyle. These functions will be overloaded for the different types of MPS and GeometryStyle in future commits.

This commit should not break anything, because these functions have more specialized definitions for each of the AbstractMPS types, so should not be called at all right now.

Examples for future overloads are

function TensorKit.dot(::FiniteChainStyle, ψ₁::AbstractMPS, ψ₂::AbstractMPS)
    #todo : rewrite this without having to gauge
    length(ψ₁) == length(ψ₂) || throw(ArgumentError("MPS with different length"))
    ρr = TransferMatrix(ψ₂.AR[2:end], ψ₁.AR[2:end]) * r_RR(ψ₂)
    return tr(_transpose_front(ψ₁.AC[1])' * _transpose_front(ψ₂.AC[1]) * ρr)
end

for the FiniteMPS and

function AC2(::InfiniteStyle, ψ::AbstractMPS, i::Integer; kind = :ACAR)
    if kind == :ACAR
        return ψ.AC[i] * _transpose_tail.AR[i + 1])
    elseif kind == :ALAC
        return ψ.AL[i] * _transpose_tail.AC[i + 1])
    else
        throw(ArgumentError("Invalid kind: $kind"))
    end
end

for the InfiniteMPS.

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.

1 participant