Open vprusso opened 8 months ago
When attempting to fix this issue, it might also be better to use the function's docstrings to distinguish between the functions described in the issue's description vs. the vec
and unvec
functions already in matrix_ops/
.
Good point. I'll make sure to accentuate that vectorize_hermitian_matrix
is specialized for Hermitian matrices and includes scaling to account for the complex structure of such matrices. In contrast, the vec
operation is a general matrix-to-vector transformation without any modifications to the matrix elements.
The ability to vectorize and unvectorize a Hermitian matrix will be useful when generating random PPT states.
Something like this following:
Vectorize:
Unvectorize:
The unvectorize function is the inverse of the vectorize one, so a set of tests that capture that, like the following, would be helpful:
This would most likely live in
matrix_ops/
with the corresponding tests intest_matrix_ops/
.