Closed oneTimePad closed 3 years ago
Are you currently working on a solution? I'd like to take a look at this issue if that's alright.
@g-ebbs Yes please do! No I am not currently working on anything.
Hm, the issue comes likely from the the workflow:
Operator
Operator
is appended a generic synthesis algorithm is used that implements the operation up to a global phaseIf the operator would be synthesized w/o global phase that error would likely be resolved. However, the algorithms for exact synthesis are more expensive afaik. You could argue that adding a matrix to a circuit is inefficient either way and it might as well be exact.
@Cryoris In this case, the synthesis algorithm tracks the global phase
pauli = Operator(Pauli(label='X'))
gate = UnitaryGate(pauli)
print(gate.definition)
Operator(gate.definition)
---
global phase: -π/2
┌────────────────┐
q_0: ┤ U3(π,π/2,-π/2) ├
└────────────────┘
array([[0.-0.j, 1.+0.j],
[1.+0.j, 0.-0.j]])
but control()
fails to do so.
Information
What is the current behavior?
Most of the info and explanation is described in this post : https://quantumcomputing.stackexchange.com/questions/14147/odd-behavior-with-qiskit-pauli-operators
To summarize the issue, when adding a control qubit to a
qiskit.quantum_info.operators.Pauli
object, at least I tested for Pauli-X, that is wrapped inqiskit.quantum_info.operators.Operator
, there is an incorrect relative phase introduced between the control system and the target system. This issue might be present for other Pauli operators as well.Steps to reproduce the problem
As mentioned in the post on 'Quantum Computing Stackexchange', the user (tsgeorgios) answering my question posted a quick and easy way to verify what I found:
What is the expected behavior?
The relative phase introduced should not be there.
Suggested solutions
No suggestions.