qiskit-advocate / qamp-spring-22

Qiskit advocate mentorship program (QAMP) spring 22 cohort (Mar - Jun 2022)
13 stars 1 forks source link

Support alternative tensor product ordering #12

Closed kevinsung closed 2 years ago

kevinsung commented 2 years ago

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:

Deliverables

Issue https://github.com/Qiskit/qiskit-terra/issues/7628 is resolved.

Mentors details

Number of mentees

1

Type of mentees

HuangJunye commented 2 years ago

Closing this issue as it was not paired with any mentee. Thank you for suggesting the project idea!