# Extracting internally computed array from \`KrylovKit.eigsolve\` (without forking)

**URL:** <https://discourse.julialang.org/t/extracting-internally-computed-array-from-krylovkit-eigsolve-without-forking/130161>\
**Category:** General Usage\
**Created:** [June 24, 2025, 10:53am UTC](https://discourse.julialang.org/t/extracting-internally-computed-array-from-krylovkit-eigsolve-without-forking/130161 "2025-06-24T10:53:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![NitinGupta](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nitingupta/32/53176_2.png) [@NitinGupta](https://discourse.julialang.org/u/NitinGupta)\
**Post date:** [June 24, 2025, 10:53am UTC](https://discourse.julialang.org/t/extracting-internally-computed-array-from-krylovkit-eigsolve-without-forking/130161/1 "2025-06-24T10:53:05Z")

</div>

I’d like to access the array `T` defined at line 44 of [`KrylovKit.jl/src/eigsolve/lanczos`](https://github.com/Jutho/KrylovKit.jl/blob/master/src/eigsolve/lanczos.jl) external to the function `KrylovKit.eigsolve` i.e. I want that `eigsolve` return `T` as well.

What is the best way to go about this without forking the repository?

My goal is to be able to extract the so called Lanczos coefficients from the function because, to my knowledge, `KrylovKit.jl` does not explicitly provide a way to extract them.

Thanks!

---

<div class="post-metadata">

**Author:** ![lkdvos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lkdvos/32/43091_2.png) [@lkdvos](https://discourse.julialang.org/u/lkdvos)\
**Post date:** [June 24, 2025, 11:12am UTC](https://discourse.julialang.org/t/extracting-internally-computed-array-from-krylovkit-eigsolve-without-forking/130161/2 "2025-06-24T11:12:36Z")

</div>

I’m not sure if there is a way to do so without forking, or copying over some code. The easiest solution would be to simply copy that function, give it a new name and also return the values you like. You’ll have to qualify some names to make sure the namespace is correct, but otherwise this isn’t too much hassle I think?

---

<div class="post-metadata">

**Author:** ![NitinGupta](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nitingupta/32/53176_2.png) [@NitinGupta](https://discourse.julialang.org/u/NitinGupta)\
**Post date:** [June 24, 2025, 11:41am UTC](https://discourse.julialang.org/t/extracting-internally-computed-array-from-krylovkit-eigsolve-without-forking/130161/3 "2025-06-24T11:41:23Z")

</div>

Yeah, I guess copying would be the best. I was hoping there were some methods built-into Julia that would allow for something more optimized.

---

<div class="post-metadata">

**Author:** ![NitinGupta](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nitingupta/32/53176_2.png) [@NitinGupta](https://discourse.julialang.org/u/NitinGupta)\
**Post date:** [June 24, 2025, 11:48am UTC](https://discourse.julialang.org/t/extracting-internally-computed-array-from-krylovkit-eigsolve-without-forking/130161/4 "2025-06-24T11:48:44Z")

</div>

but there’s the other issue with copying that there are many variables and functions that `eigsolve` uses which I’d also have to import explicitly - which really makes this very cluttered and is much worse than forking ☹

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [June 24, 2025, 12:13pm UTC](https://discourse.julialang.org/t/extracting-internally-computed-array-from-krylovkit-eigsolve-without-forking/130161/5 "2025-06-24T12:13:10Z")

</div>

No need to fork, just `]dev KrylovKit` and edit the relevant files in your `/.julia/dev/KrylovKit` directory.

---

<div class="post-metadata">

**Author:** ![NitinGupta](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nitingupta/32/53176_2.png) [@NitinGupta](https://discourse.julialang.org/u/NitinGupta)\
**Post date:** [June 24, 2025, 12:31pm UTC](https://discourse.julialang.org/t/extracting-internally-computed-array-from-krylovkit-eigsolve-without-forking/130161/6 "2025-06-24T12:31:49Z")

</div>

that is nice, I guess I will need to keep an eye out for updates to `KrylovKit` and do the same modifications again (if I want to keep using the latest version)?

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [June 24, 2025, 12:51pm UTC](https://discourse.julialang.org/t/extracting-internally-computed-array-from-krylovkit-eigsolve-without-forking/130161/7 "2025-06-24T12:51:59Z")

</div>

Yes

> **[3. Managing Packages · Pkg.jl](https://pkgdocs.julialang.org/v1/managing-packages/#developing)**
>
> Documentation for Pkg.jl.
