Closed vprusso closed 1 month ago
Upon being given a list of $n$ vectors in dimension $d$, wouldn't it more convenient for the end-user to return a $n\times n$ matrix whose $(i,j)$ entry would be $\left\langle\psi_i\middle|\psi_j\right\rangle$ (that is, the Gram matrix if I'm not mistaken)?
Wouldn't returning a list like this may make this a bit difficult to index a specific inner product?
True. I suppose one way around this would be to retain the indices and have the return be a dictionary whose keys are the index pairs and whose values are the corresponding inner product values. Would that seem a bit more sensible to you, @tnemoz ?
Sure! I wouldn't mind doing it if that's OK with you!
That would be wonderful, thank you, @tnemoz !
I just noticed that there is a vectors_to_gram_matrix
function in matrix_ops
. Since this already allows for getting the inner products, I'm unsure about what should be done here. Wouldn't this function clearly overlap (haha) with vectors_to_gram_matrix
? What would be the difference between the two?
Hmm, that's a good point. In some sense, this information is already accessible from this function. I would even say that we can close this one out in favor of that. Good point, @tnemoz , I'll close this issue with the note that vectors_to_gram_matrix
already has the overlap information baked into it. Thanks for the comment!
It would be helpful to have a function that provides the mutual overlaps (inner products) of a list of numpy arrays (representing vectors of quantum states).
Something like the following:
In addition, we can refactor
is_mutually_orthogonal.py
to use this function as there is going to be a good amount of redundancy between these functions as is.The function should also include proper documentation, examples, and tests.