PauliBasisChange.get_cob_circuit¶
- PauliBasisChange.get_cob_circuit(origin)[source]¶
Construct an Operator which maps the +1 and -1 eigenvectors of the origin Pauli to the +1 and -1 eigenvectors of the destination Pauli. It does so by
converting any |i+⟩ or |i+⟩ eigenvector bits in the origin to |+⟩ and |-⟩ with S†s, then
converting any |+⟩ or |+⟩ eigenvector bits in the converted origin to |0⟩ and |1⟩ with Hs, then
writing the parity of the significant (Z-measured, rather than I) bits in the origin to a single “origin anchor bit,” using cnots, which will hold the parity of these bits,
swapping the parity of the pauli anchor bit into a destination anchor bit using a swap gate (only if they are different, if there are any bits which are significant in both origin and dest, we set both anchors to one of these bits to avoid a swap).
writing the parity of the destination anchor bit into the other significant bits of the destination,
converting the |0⟩ and |1⟩ significant eigenvector bits to |+⟩ and |-⟩ eigenvector bits in the destination where the destination demands it (e.g. pauli.x == true for a bit), using Hs 8) converting the |+⟩ and |-⟩ significant eigenvector bits to |i+⟩ and |i-⟩ eigenvector bits in the destination where the destination demands it (e.g. pauli.x == true and pauli.z == true for a bit), using Ss
- Parameters
origin (
Union
[Pauli
,PauliOp
]) – ThePauli
orPauliOp
to map.- Return type
(<class ‘qiskit.aqua.operators.primitive_ops.primitive_op.PrimitiveOp’>, <class ‘qiskit.aqua.operators.primitive_ops.pauli_op.PauliOp’>)
- Returns
A tuple of a
PrimitiveOp
which equals the basis change mapping and aPauliOp
which equals the destination basis.- Raises
TypeError – Attempting to convert from non-Pauli origin.
ValueError – Attempting to change a non-identity Pauli to an identity Pauli, or vice versa.