A few things that came up while working on the improvement to the noise.
The permute_basis was not doing the correct permutation, but it was going unnoticed because the expand_operator was compensating for it.
I created an alternative apply_operator_permute which is just as fast as the apply_operator function, but can serve as a basis for future changes. For now we can simply save it. It could be useful if we wish to make PyQ follow the more standard state shape of [batch_size, 2**n_qubits] instead of the [2] * n_qubits + [batch_size]. The reason I wrote it is because the logic I am working on for the apply_density_mat follows something similar, but doing it first for the normal apply_operator was easier.
A few things that came up while working on the improvement to the noise.
permute_basis
was not doing the correct permutation, but it was going unnoticed because theexpand_operator
was compensating for it.apply_operator_permute
which is just as fast as theapply_operator
function, but can serve as a basis for future changes. For now we can simply save it. It could be useful if we wish to make PyQ follow the more standard state shape of[batch_size, 2**n_qubits]
instead of the[2] * n_qubits + [batch_size]
. The reason I wrote it is because the logic I am working on for theapply_density_mat
follows something similar, but doing it first for the normalapply_operator
was easier.