Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
Remove note on reversing order of qubits
Browse files Browse the repository at this point in the history
Using Operator(QuantumCircuit) gives the same qubit ordering
that the previous unitary-simulator-based code did. I removed
the comment entirely because the behavior depends only on
Operator(QuantumCircuit), which is not obscure.
  • Loading branch information
jlapeyre committed Sep 11, 2020
1 parent 0c00019 commit 0bba1eb
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions qiskit/aqua/operators/primitive_ops/circuit_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,6 @@ def to_matrix(self, massive: bool = False) -> np.ndarray:
' in this case {0}x{0} elements.'
' Set massive=True if you want to proceed.'.format(2 ** self.num_qubits))

# TODO: Check order of qubits. The note below refers to using the unitary simulator.
# But, we have replaced this code with qiskit.quantum_info.Operator
# NOTE: not reversing qubits!! We generally reverse endianness when converting between
# circuit or Pauli representation and matrix representation, but we don't need to here
# because the Unitary simulator already presents the endianness of the circuit unitary in
# forward endianness.
unitary = qiskit.quantum_info.Operator(self.to_circuit()).data
# pylint: disable=cyclic-import
from ..operator_globals import EVAL_SIG_DIGITS
Expand Down

0 comments on commit 0bba1eb

Please sign in to comment.