Giter Club home page Giter Club logo

Comments (4)

mtfishman avatar mtfishman commented on June 26, 2024

Sorry, I just noticed this. I'm not sure why I don't get notifications about issues raised, I'll have to look into my settings.

Thanks for pointing that out. It would be great to have ITensors working with Optim. I'll look into the best way to get it working (it may be just adding the solution that Julia recommends).

from ndtensors.jl.

mtfishman avatar mtfishman commented on June 26, 2024

This should be fixed on master and will be included in the next ITensors release (v0.1.38), please let me know if you continue to have problems like this.

from ndtensors.jl.

gamatos avatar gamatos commented on June 26, 2024

Hi,

I'm not sure whether I should be posting in this Issue or opening a new one - apologies if the latter. Today I tried using ITensors.jl to do some calculations and had this same problem. If I use a package which depends on ArrayInterface.jl and then try to run, for instance, the first half of the DMRG example script https://itensor.org/docs.cgi?vers=julia&page=getting_started/dmrg :

using ITensors
let
  N = 100
  sites = siteinds("S=1",N)

  ampo = AutoMPO()
  for j=1:N-1
    ampo += "Sz",j,"Sz",j+1
    ampo += 1/2,"S+",j,"S-",j+1
    ampo += 1/2,"S-",j,"S+",j+1
  end
  H = MPO(ampo,sites)
end

I get the same error. I fixed it by extending your fix to accept two integer arguments

# This is needed to fix an ambiguity error with ArrayInterface.jl
# https://github.com/ITensor/NDTensors.jl/issues/62
@propagate_inbounds function setindex(T::EmptyTensor, x, I::Int, J::Int)
  return _setindex(T, x, I, J)
end

I assume this happens because when constructing the MPO from the AutoMPO, ITensors needs to set two indices at once when instantiating the local operators, and the previous solution only fixed it when setting one index.

from ndtensors.jl.

mtfishman avatar mtfishman commented on June 26, 2024

Thanks for pointing that out, I'm fixing it now (more generically by defining setindex(T::EmptyTensor, x, I::Int...)).

from ndtensors.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.