# Correction vector

**URL:** https://itensor.discourse.group/t/correction-vector/107
**Category:** DMRG and Numerical Methods
**Tags:** julia
**Created:** [May 2, 2022, 9:08pm UTC](https://itensor.discourse.group/t/correction-vector/107 "2022-05-02T21:08:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![adeorlandini](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@adeorlandini](https://itensor.discourse.group/u/adeorlandini)
#### Post date: [May 2, 2022, 9:08pm UTC](https://itensor.discourse.group/t/correction-vector/107/1 "2022-05-02T21:08:56Z")

</div>

Hi, I was doing dynamics calculations using the time evolution of the ground state. However I wonder if there is an implementation of itensor for correction vector? if it wasn’t the case, could it be implemented in a “simple” way with the current MPS paradigm using by itensor?

Cheers

---

<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: [May 3, 2022, 2:05pm UTC](https://itensor.discourse.group/t/correction-vector/107/2 "2022-05-03T14:05:00Z")

</div>

Thanks for the question, but no we don’t have an implementation of correction vector in ITensor and I don’t know of one. The basic pattern is that it uses the DMRG algorithm with the main change that instead of solving an eigenvalue problem A x = \lambda x for x it solves an Ax = b problem.

So in principle you could take our `dmrg` function here: [https://github.com/ITensor/ITensors.jl/blob/40fc8deaf94a75e8ae6c00e97d6cf234fdf14a57/src/mps/dmrg.jl#L116](https://github.com/ITensor/ITensors.jl/blob/40fc8deaf94a75e8ae6c00e97d6cf234fdf14a57/src/mps/dmrg.jl#L116)  
and change the part that calls the `eigsolve` function  
[https://github.com/ITensor/ITensors.jl/blob/40fc8deaf94a75e8ae6c00e97d6cf234fdf14a57/src/mps/dmrg.jl#L221](https://github.com/ITensor/ITensors.jl/blob/40fc8deaf94a75e8ae6c00e97d6cf234fdf14a57/src/mps/dmrg.jl#L221)  
which is a function defined by the library  
[KrylovKit.jl](https://github.com/Jutho/KrylovKit.jl), and modify the code to instead call the `linsolve` function which is [documented here](https://jutho.github.io/KrylovKit.jl/latest/man/linear/).

We are also currently working on a new implementation of our DMRG code that will make it easier to switch out the solver and define custom solvers. I expect that will happen in a few months.

Hope that helps for now –
