Open Brogis1 opened 1 year ago
@Brogis1 Could you please add a small code snippets to the description above?
Right now the PyQ convention is made to align with the qubit index (qubit indices between 0, ... n-1 coincide with the dimensions 0, ... n-1 of the tensor).
I think however that changing it would not be too much problematic for the usage. It seems that there is no critical reason for the batch to be last dimension, so I would be in favor to change it as you suggest.
Implementing both conventions seems hard because we would make all functions like _apply_gate
being also dependent of theat keyword. This ay slow down perfomances.
@dominikandreasseitz Is this still relevant ? I have the feeling it is closeable.
I think long-term it would make sense to make the switch
Problem
Right now we have the batch dimension at the back of tensors in PyQ. However, in PyTorch it is in front.
Consequence
This entails reshaping tensors back and forth to make them compatible with PyTorch/PyQ convention. Hence, there are unnecessary code lines just for that.
Suggested Solution
We can make it possible to have both conventions (with a keyword argument) or just one (for instance, the batch dimension is the first and not last in PyQ tensors).