Hi @KFrank!
Thanks for the quick and detailed response!



 KFrank:

I doubt that your nested-loop version scales worse that det(). Your
version scales in time as n**2 (just count the number of times through
the loop), while det() scales as n**3.


That’s what I thought but when I tested it the Vandermonde determinant scales bettter initially but for larger N performed worse. The Vandermonde det scaled approximately N**2 but torch.linalg.det scaled better which doesn’t make sense to me because it’s an N**3 operation, although that’s the naive scaling of it as it can be reduced.
What I’m probably doing is calculating the scaling wrong. The TL;DR of that is I just use curve_fit from scipy and fit a function of f = a*x**b. For Vandermonde is was about 2.1 and for torch.linalg.det it was like 1.4 (which doesn’t make sense at all, most likely because I’m calculating the scaling wrong). Perhaps it’d be better to curve_fit to logarithm of the runtime.



 KFrank:

Yes. With a little bit of monkeying around, you can perform the n**2
computation with pure, non-loop tensor operations:


Thanks for the great example!