Skip to content

[ITensors] [ENCHANCEMENT] Remove TimerOutputs.jl as a dependency #1526

Open
@MazenAli

Description

@MazenAli

Description of bug

The @timeit_debug decorator from TimerOutputs does not to seem to function properly as timeit_debug_enabled is not defined in ITensors. See also screenshot of README from TimerOutputs.

Screenshot 2024-09-09 at 16 08 05

Minimal runnable code

using Pkg
Pkg.add("TimerOutputs")

using ITensors, ITensorMPS, TimerOutputs
TimerOutputs.enable_debug_timings(ITensors)
const timer = TimerOutput()

# Build MPO
J = 4.0
h = 1.0
L = 15
ampo = AutoMPO()
for j in 1:(L - 1)
  add!(ampo, -J, "Sz", j, "Sz", j + 1)
  add!(ampo, -h, "Sx", j)
end
add!(ampo, -h, "Sx", L)
sites = siteinds("S=1/2", L)
ham = MPO(ampo, sites)

# Do DMRG
psi0 = MPS(sites, "Up")
nsweeps = 20
maxdim = 15
cutoff = 0

@timeit_debug timer "dmrg" energy, _ = dmrg(ham, psi0;
                 nsweeps=nsweeps,
                 maxdim=maxdim,
                 mindim=maxdim,
                 cutoff=cutoff,
                 outputlevel=0)
println("Run $i: $energy")
println(timer)

Output of minimal runnable code

root@8506b93efb68:/opt/project/examples# julia tmp.jl 
   Resolving package versions...
  No Changes to `~/.julia/environments/v1.10/Project.toml`
  No Changes to `~/.julia/environments/v1.10/Manifest.toml`
ERROR: LoadError: UndefVarError: `timeit_debug_enabled` not defined
Stacktrace:
 [1] enable_debug_timings(m::Module)
   @ TimerOutputs ~/.julia/packages/TimerOutputs/Lw5SP/src/TimerOutput.jl:187
 [2] top-level scope
   @ /opt/project/examples/tmp.jl:5
in expression starting at /opt/project/examples/tmp.jl:5
root@8506b93efb68:/opt/project/examples# 

Version information

  • Output from versioninfo():
julia> versioninfo()
Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (aarch64-linux-gnu)
  CPU: 8 × unknown
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, generic)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Environment:
  JULIA_GPG = 3673DF529D9049477F76B37566E3C7DC03D6E495
  JULIA_VERSION = 1.10.5
  JULIA_PATH = /usr/local/julia
  • Output from using Pkg; Pkg.status("ITensors"):
julia> using Pkg; Pkg.status("ITensors")
Status `~/.julia/environments/v1.10/Project.toml`
  [9136182c] ITensors v0.6.17

Metadata

Metadata

Assignees

No one assigned

    Labels

    ITensorsIssues or pull requests related to the `ITensors` package.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions