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

[ITensors] [BUG] Compilation using ITensors.compile() doesn't work; "No method is defined..." #1605

Closed
jaredjeya opened this issue Dec 12, 2024 · 6 comments
Labels
bug Something isn't working ITensors Issues or pull requests related to the `ITensors` package.

Comments

@jaredjeya
Copy link

Description of bug

When running ITensors.compile(), as detailed here, I get an error: the method doesn't seem to be found. The code in compile.jl seems to be missing: see here

Minimal code demonstrating the bug or unexpected behavior

Minimal runnable code

using ITensors
ITensors.compile()

Expected output or behavior

ITensor compiles without issue.

Actual output or behavior

Output of minimal runnable code

julia> ITensors.compile()
ERROR: MethodError: no method matching compile(::NDTensors.BackendSelection.Algorithm{:PackageCompiler, @NamedTuple{}})
The function `compile` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  compile(; backend, kwargs...)
   @ ITensors ~/.julia/packages/ITensors/HwzqQ/src/packagecompile/compile.jl:39

Stacktrace:
 [1] compile(; backend::NDTensors.BackendSelection.Algorithm{:PackageCompiler, @NamedTuple{}}, kwargs::@Kwargs{})
   @ ITensors ~/.julia/packages/ITensors/HwzqQ/src/packagecompile/compile.jl:40
 [2] compile()
   @ ITensors ~/.julia/packages/ITensors/HwzqQ/src/packagecompile/compile.jl:39
 [3] top-level scope
   @ REPL[7]:1

Version information

  • Output from versioninfo():
julia> versioninfo()
Julia Version 1.11.2
Commit 5e9a32e7af2 (2024-12-01 20:02 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 48 × Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, broadwell)
Threads: 48 default, 0 interactive, 24 GC (on 48 virtual cores)
  • Output from using Pkg; Pkg.status("ITensors"):
julia> using Pkg; Pkg.status("ITensors")
Status `/storage/slow_raid5/SYSTEM/localhome/phyjj/[redacted]/Project.toml`
  [9136182c] ITensors v0.7.8
@jaredjeya jaredjeya added bug Something isn't working ITensors Issues or pull requests related to the `ITensors` package. labels Dec 12, 2024
@mtfishman
Copy link
Member

Please try loading ITensorMPS.jl before running ITensors.compile(), the compilation relies on running DMRG which is now in ITensorMPS.jl. See https://itensor.github.io/ITensors.jl/dev/#News.

@jaredjeya
Copy link
Author

Thanks, I’ll try that.

Can you update the documentation to reflect that please, since it’s currently not clear? (A quick google for the error I had wasn’t helpful either)

@mtfishman
Copy link
Member

Sure, will do.

mtfishman added a commit that referenced this issue Dec 13, 2024
Add warning in `ITensors.compile()` docstring about requiring `ITensorMPS.jl` to be loaded in ITensors v0.7. Addresses #1605.
@jaredjeya
Copy link
Author

jaredjeya commented Dec 13, 2024

This actually still doesn't work for me. I'm doing exactly what you've put in the new docs, i.e.

using ITensors, ITensorMPS
ITensors.compile()

but I get the same error.

I've also replicated this error on three different machines (one Windows, two Linux).

@jaredjeya jaredjeya reopened this Dec 13, 2024
@mtfishman
Copy link
Member

Oops, sorry about that. I forgot you also have to install and load PackageCompiler.jl since the functionality was moved to a package extension so that we don't force everyone to install PackageCompiler.jl even if they don't want to use ITensors.compile().

So this should work:

using ITensors, ITensorMPS
using PackageCompiler
ITensors.compile()

I'll clarify that in the docs.

@jaredjeya
Copy link
Author

Thanks, seems to be working now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ITensors Issues or pull requests related to the `ITensors` package.
Projects
None yet
Development

No branches or pull requests

2 participants