I don’t remember, and I can only hope for a faster solution. I want to just have partial eigen on my own to speed up the filter massively as well. Something like meigen, but with eigenvector and at k. Maybe some day too.
Another idea for eigen: Can it be multi-threaded? Seems to use a single thread. I was testing eigen on a 8192*8192 diagonal image, it appears single threaded. Or even trimmed eigen. I would only like certain ranges and skip the rest.
Here’s the code anyway:
#@cli rep_quantum_billiard_2d: 0<=position[%]<=100%,auto_fit={ 0=do_not_autofit | 1=do_autofit }
#@cli : Generates series of quantum billiard image stacked together along z-axis unless $1 is specified.
#@cli : G'MIC code is based on Python code provided by weightan at github - https://github.com/weightan/SchrodingerWellPython/tree/main .
rep_quantum_billiard_2d:
skip ${1=},${2=1}
use_position_reference,test_auto_fit=0,{$2&1}
if narg($1)
use_position_reference=1
position={cut($1,0,1)}
fi
foreach {
if d>1 continue fi
if s!=1 continue fi
use_auto_fit=0
if $test_auto_fit?(w!=h)
ow,oh={[w,h]}
max_image_dimension,difference={max(w,h)}
if wh>8192 error too_large_image fi
{vector(#2,$max_image_dimension)}
image[-1] [-2],.5~,.5~
autocrop_coords 0
crop_coordinates=${}
remove[-2]
use_auto_fit=1
else
if wh>8192 error too_large_image fi
fi
original_image_dimensions={[w,h]}
sqrt_image_dimension,image_dimension={[sqrt(wh),wh]}
i_sqrt_image_dimension={round($sqrt_image_dimension)}
increment={sqr(1/($i_sqrt_image_dimension-1))}
increment_value={-1/$increment}
zeroV={4/$increment}
unroll x
*. $increment_value
crop. 0,{w-2}
+crop. 0,{w+1-$i_sqrt_image_dimension}
$image_dimension,1,1,1,$zeroV
diagonal
image[2] [0],1,0,0,0,-1
image[2] [0],0,1,0,0,-1
image[2] [1],$i_sqrt_image_dimension,0,0,0,-1
image[2] [1],0,$i_sqrt_image_dimension,0,0,-1
keep[2]
eigen
keep[1]
if $use_position_reference
point_position={int($position*(w-1))}
crop $point_position,$point_position
fi
abs
if $use_position_reference
resize $original_image_dimensions,1,100%,-1
else
rotate -90
resize $original_image_dimensions,$image_dimension,100%,-1
fi
if $use_auto_fit
x0,y0,z0,x1,y1,z1=$crop_coordinates
crop $x0,$y0,0,$x1,$y1,100%
fi
}