Another example of using type domain information in Julia

By: Julia on EPH

Re-posted from: https://ericphanson.com/blog/2019/another-example-of-using-type-domain-information-in-julia/

In a previous post, I discussed using type domain information to speed up generation of random density matrices with small dimension in Julia. There, we gave the Julia compiler knowledge of the dimension of the matrices at the time it generates code, instead of passing that dimension as a runtime variable, and saw significant runtime speedups as a consequence. This time, let’s push this further by giving the compiler a whole vector of numbers instead of a single integer.