# Using AI programming problem solvers to help develop Julia Linear Algebra ecosystem

**URL:** https://discourse.julialang.org/t/using-ai-programming-problem-solvers-to-help-develop-julia-linear-algebra-ecosystem/129501
**Category:** General Usage
**Tags:** linearalgebra
**Created:** [May 31, 2025, 11:07am UTC](https://discourse.julialang.org/t/using-ai-programming-problem-solvers-to-help-develop-julia-linear-algebra-ecosystem/129501 "2025-05-31T11:07:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Tarny\_GG\_Channie](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)
#### Post date: [May 31, 2025, 11:07am UTC](https://discourse.julialang.org/t/using-ai-programming-problem-solvers-to-help-develop-julia-linear-algebra-ecosystem/129501/1 "2025-05-31T11:07:50Z")

</div>

We’ve had yet another instance of slow matrix operation due to generic fallback.

> [@Very long time for addition of complex identity matrix to transposed sparse matrix](https://discourse.julialang.org/t/very-long-time-for-addition-of-complex-identity-matrix-to-transposed-sparse-matrix/129465):
>
> Hi, I am surprised by these timings on 1.10. Can it be improved? using SparseArrays, LinearAlgebra A = sprandn(90000,90000, 1e-5) @time (A + complex(0,1.) \* I); # 0.001344 seconds (13 allocations: 7.342 MiB) @time (transpose(A) + complex(0,1.) \* I); #101.973608 seconds (193.74 k allocations: 21.416 MiB, 0.08% compilation time)

This is not the only one for example.

> [@How to reduce a (reshaped) sparse matrix to a max or sum with acceptable speed?](https://discourse.julialang.org/t/how-to-reduce-a-reshaped-sparse-matrix-to-a-max-or-sum-with-acceptable-speed/112888/4):
>
> Clearly view and reshape of SparseMatrixCSC are not performing well. It gets tedious to write, but sometimes you can decompose the reduction into two parts with the first operating on a raw sparse array. If you are always reducing over the 4th dimension, for example, consider reducing over it first and then handle the others after. Like this sz4 = (300, 300, 36, 2 \* 60 \* 12) sz2 = (sz4[1] \* sz4[2] \* sz4[3] , sz4[4]) activitygrid = sprand(Float32, sz2..., 111f-6) # reduce over 4th dim, then 3r…

Guess what? We have a set of self-contained problems with known ground truth (implemented by the generic fallbacks).

You know what? This screams like it’s a good time to use something like Alphacode.

> **[Competitive programming with AlphaCode](https://deepmind.google/discover/blog/competitive-programming-with-alphacode/)**
>
> Solving novel problems and setting a new milestone in competitive programming.

We have some open-source versions like this one:

> **[GitHub - shyamsaktawat/OpenAlpha\_Evolve: OpenAlpha\_Evolve is an open-source Python...](https://github.com/shyamsaktawat/OpenAlpha_Evolve)**
>
> OpenAlpha\_Evolve is an open-source Python framework inspired by the groundbreaking research on autonomous coding agents like DeepMind's AlphaEvolve.

The plan is simple.

1. Define a search space of arrays, matrices, etc (including ones like maybe Transposed XXX matrix or whatever).
2. Benchmark the generic implementation as a baseline.
3. Use Alphacode or similar algorithms to generate specialized dispatches for all the esoteric operations out there, benchmark them, and integrate the result much faster than generic methods.
4. Perhaps do some pruning where you prune out some specialized logic already covered by a more generic code.
5. Perhaps manually review the generated code.

Who wants to do it? Who wants to lead the effort? I might be able to help (might be, not guaranteed). This could be a good test case on whether or not AI code generation could significantly help software development beyond the “vibe coding” trend.

Hopefully, this one is an achievable idea. I do not know if it would turn out to be yet another hard idea but I think this one is a small idea.

---

<div class="post-metadata">

### Author: ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)
#### Post date: [May 31, 2025, 12:36pm UTC](https://discourse.julialang.org/t/using-ai-programming-problem-solvers-to-help-develop-julia-linear-algebra-ecosystem/129501/2 "2025-05-31T12:36:31Z")

</div>

Please do it

---

<div class="post-metadata">

### Author: ![Tarny\_GG\_Channie](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)
#### Post date: [May 31, 2025, 12:53pm UTC](https://discourse.julialang.org/t/using-ai-programming-problem-solvers-to-help-develop-julia-linear-algebra-ecosystem/129501/3 "2025-05-31T12:53:43Z")

</div>

Let’s break it down then. The step 2 is trivial. Step 4 needs step 1,3 to figure out the result first. Step 5 is likely optional.

The first step are that I need to get one of the Alphacode or similar algorithms working, and another thing is that I need to define the search space. However, I do not know every type of search space and the behaviors of their domains. For example, sparse matrices need to actually be sparse to be worthwhile, whereas triangular matrices need to be triangular, and so on. We would need to list the matrices and so on and their search space if we want to try these.

Then comes the issue of Alphacode itself. I’ve never tried installing and using this software and its API. Not sure if it would be easy or difficult, and we still need to connect them to the benchmarks. What next? Who’s going to help me with these 2 steps?
