You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering why "all_states" (and to also states_to_number) of the hilbert space "Spin" uses the convention
state[i] = - 2 sz[i] ?
Using "all_states" on a hilbert space of just one spin-1/2, you get the states array: [[-1],[1]]. In essence, if you implement a new type of operator (e.g. in my case PauliStrings that work with Spin instead of Qubit), you might want to check the sz[i] directly to compute the "get_conn_padded" (as is now also done for the qubit case). Wouldn't it be more straightforward to take state[i] = 2 sz[i] ?
This does not really affect much code, I think, since all operators use the 'number' indices of the states anyways. However, if you want to extend PauliStrings to Spins, it would be clearer if you change signs whenever "-1" occurs.
The text was updated successfully, but these errors were encountered:
It’s a limitation of our implementation of local operators.
We need the states to be sorted from lowest to highest, but the standard convention of writing the Pauli basis is from highest to lowest.
we would like to address this but to solve it we need to support arbitrary ordering of the local basis in LocalOperator.
The change is not trivial because that code is rather messy.
I was planning on rewriting it eventually and with a rewrite address this issue, automatically.
But right now I don’t have time to work on this
I'm wondering why "all_states" (and to also states_to_number) of the hilbert space "Spin" uses the convention
state[i] = - 2 sz[i] ?
Using "all_states" on a hilbert space of just one spin-1/2, you get the states array: [[-1],[1]]. In essence, if you implement a new type of operator (e.g. in my case PauliStrings that work with Spin instead of Qubit), you might want to check the sz[i] directly to compute the "get_conn_padded" (as is now also done for the qubit case). Wouldn't it be more straightforward to take state[i] = 2 sz[i] ?
This does not really affect much code, I think, since all operators use the 'number' indices of the states anyways. However, if you want to extend PauliStrings to Spins, it would be clearer if you change signs whenever "-1" occurs.
The text was updated successfully, but these errors were encountered: