# Error occurs when "write\_when\_maxdim\_exceeds” arguments are given in tdvp()

**URL:** <https://itensor.discourse.group/t/error-occurs-when-write-when-maxdim-exceeds-arguments-are-given-in-tdvp/1416>\
**Category:** ITensor Julia Questions\
**Tags:** julia\
**Created:** [January 12, 2024, 4:01pm UTC](https://itensor.discourse.group/t/error-occurs-when-write-when-maxdim-exceeds-arguments-are-given-in-tdvp/1416 "2024-01-12T16:01:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wang](https://avatars.discourse-cdn.com/v4/letter/w/edb3f5/32.png) [@Wang](https://itensor.discourse.group/u/Wang)\
**Post date:** [January 12, 2024, 4:01pm UTC](https://itensor.discourse.group/t/error-occurs-when-write-when-maxdim-exceeds-arguments-are-given-in-tdvp/1416/1 "2024-01-12T16:01:59Z")

</div>

Hello everyone!  
When I use “write\_when\_maxdim\_exceeds” arguments to tdvp() function, it returns that

```auto
ERROR: LoadError: UndefVarError: `disk` not defined
Stacktrace:
 [1] tdvp(solver::Function, PH::ProjMPO, t::ComplexF64, psi0::MPS; kwargs::Base.Pairs{Symbol, Integer, NTuple{7, Symbol}, NamedTuple{(:nsweeps, :maxdim, :cutoff, :nsite, :outputlevel, :normalize, :write_when_maxdim_exceeds), Tuple{Int64, Int64, Int64, Int64, Int64, Bool, Int64}}})
   @ ITensorTDVP ~/.julia/packages/ITensorTDVP/V1Kco/src/tdvp_generic.jl:80
 [2] tdvp
   @ ~/.julia/packages/ITensorTDVP/V1Kco/src/tdvp_generic.jl:45 [inlined]
 [3] tdvp(solver::Function, H::MPO, t::ComplexF64, psi0::MPS; kwargs::Base.Pairs{Symbol, Integer, NTuple{7, Symbol}, NamedTuple{(:nsweeps, :maxdim, :cutoff, :nsite, :outputlevel, :normalize, :write_when_maxdim_exceeds), Tuple{Int64, Int64, Int64, Int64, Int64, Bool, Int64}}})
   @ ITensorTDVP ~/.julia/packages/ITensorTDVP/V1Kco/src/tdvp_generic.jl:150
 [4] tdvp
   @ ~/.julia/packages/ITensorTDVP/V1Kco/src/tdvp_generic.jl:143 [inlined]
 [5] #tdvp#41
   @ ~/.julia/packages/ITensorTDVP/V1Kco/src/tdvp.jl:47 [inlined]

```

```auto
psi = tdvp(
        HAL,
        -im*tstep,
        psi;
        nsweeps=1,
        maxdim=max,
        cutoff=0,
        nsite=1,
        outputlevel=1,
        normalize=true,
        # solver_backend="applyexp"
        write_when_maxdim_excceds=1000
        )

```

The ITensor version I use is “0.3.42” and “0.1.4” of ITensorTDVP.

It looks like a bug, since “disk()” was presents in ITensors.jl.

Is there any way to fix it?

Thanks a lot !  
Wang.
