Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issue#104 #116

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix Issue#104 #116

wants to merge 1 commit into from

Conversation

VinceNeede
Copy link

@VinceNeede VinceNeede commented Mar 4, 2025

Added keyword tags to

function (::Type{MPST})(
  A::ITensor, sites; 
  leftinds=nothing, 
  orthocenter::Integer=length(sites), 
  tags::Vector{TagSet}=[defaultlinktags(i) for i in 1:(length(sites)-1)], 
  kwargs...
) where {MPST<:AbstractMPS}

Allowing to pass the tags to use in the factorization, using defaultlinktags by default.
Then changed the function

function setindex!(
  ψ::MPST,
  A::ITensor,
  r::UnitRange{Int};
  orthocenter::Integer=last(r),
  perm=nothing,
  kwargs...,
) where {MPST<:AbstractMPS}

To pass the correct linktags to the previous function. i.e.

  linktags=[defaultlinktags(i) for i in firstsite:(lastsite - 1)]

  ψA = MPST(A, sites; leftinds=lind, orthocenter=orthocenter - first(r) + 1, tags=linktags, kwargs...)

  ψ[firstsite:lastsite] = ψA

It can be tested that @assert hasdefaultlinktags(ψ) is valid

…ing to pass the tags to use in factorization. Used that keyword to fix the call from setindex!(::MPST,::ITensor,::UnitRange...)
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