Effective method to obtain subsector matrix

Hello,
I’m currently facing the following issue:
Suppose I have a qn-conserving ITensor (matrix) with incoming and outgoing legs. Each Index has the same set of QNs; How to get effectively the matrix in array format for a given QN, for example for QN(0)? Is it possible to delete all other QN sectors with the corresponding data, except of the given one?
EDITED:
I found the following solution:
Q=Array(ITensors.blockview(ITensors.tensor(R),nzblocks(R)[1]))

Thank you,
Best regards,
Murod

Glad you figured it out! In the future, we hope to have a better interface for things like this (tensor slicing and related operations).

Hi Miles, I am interested in taking this on if someone is willing to help plan and spec it out and code review the PR. I can start by summarizing the previous discussion.

Regards
Jan