# Stopping DMRG in Julia

**URL:** <https://itensor.discourse.group/t/stopping-dmrg-in-julia/677>\
**Category:** DMRG and Numerical Methods\
**Created:** [March 2, 2023, 7:16pm UTC](https://itensor.discourse.group/t/stopping-dmrg-in-julia/677 "2023-03-02T19:16:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paban.patra](https://avatars.discourse-cdn.com/v4/letter/p/58956e/32.png) [@paban.patra](https://itensor.discourse.group/u/paban.patra)\
**Post date:** [March 2, 2023, 7:16pm UTC](https://itensor.discourse.group/t/stopping-dmrg-in-julia/677/1 "2023-03-02T19:16:50Z")

</div>

Hi,

I am using ITensor Julia . Due to the time limit, I want to stop DMRG sweeps without killing it entirely. I know in C++ you can create a STOP\_DMRG file in the same directory as your main file to do that. But can this be implemented in Julia?  
If it can, then can you show me an example of how to do that?

Thanks

---

<div class="post-metadata">

**Author:** ![mtfishman](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/mtfishman/32/11_2.png) [@mtfishman](https://itensor.discourse.group/u/mtfishman)\
**Post date:** [March 2, 2023, 9:59pm UTC](https://itensor.discourse.group/t/stopping-dmrg-in-julia/677/2 "2023-03-02T21:59:08Z")

</div>

What about [Observer System for DMRG · ITensors.jl](https://itensor.github.io/ITensors.jl/stable/Observer.html#Overloading-the-checkdone!-method)?

---

<div class="post-metadata">

**Author:** ![miles](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/miles/32/6_2.png) [@miles](https://itensor.discourse.group/u/miles)\
**Post date:** [March 2, 2023, 10:14pm UTC](https://itensor.discourse.group/t/stopping-dmrg-in-julia/677/3 "2023-03-02T22:14:23Z")

</div>

Yes you can overload the checkdone method for your custom observer and use the Julia isfile function to check it a particular file exists.
