Qiskit uses the little endian convention for ordering the factors in a tensor product. For example, the statevector for a 3-qubit state would use the ordering Q2 ⊗ Q1 ⊗ Q0. It would be useful to add support for specifying the tensor product order. This could be used, for example, to request a state vector using the common big endian ordering.
This can be implemented by adding a qubit_order argument to all functions that implicitly rely on a choice of tensor product ordering. This argument would be a list of the qubit indices in the desired tensor product order. So for the example above, it would be [2, 1, 0] to get the state in big-endian order.
The following is a non-exhaustive list of functions that would be affected:
Description
Implement the feature requested at https://github.com/Qiskit/qiskit-terra/issues/7628. Description copied below:
Qiskit uses the little endian convention for ordering the factors in a tensor product. For example, the statevector for a 3-qubit state would use the ordering
Q2 ⊗ Q1 ⊗ Q0
. It would be useful to add support for specifying the tensor product order. This could be used, for example, to request a state vector using the common big endian ordering.This can be implemented by adding a
qubit_order
argument to all functions that implicitly rely on a choice of tensor product ordering. This argument would be a list of the qubit indices in the desired tensor product order. So for the example above, it would be[2, 1, 0]
to get the state in big-endian order.The following is a non-exhaustive list of functions that would be affected:
Result.get_statevector
Result.get_counts
Operator
SparsePauliOp
Statevector
quantum_info
moduleDeliverables
Issue https://github.com/Qiskit/qiskit-terra/issues/7628 is resolved.
Mentors details
Number of mentees
1
Type of mentees