-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
- Qiskit Terra version: 0.23.1
- Python version: 3.10.6
- Operating system: Ubuntu Linux
What is happening?
The global phase of some circuits generated by SolovayKitaev
seems wrong.
How can we reproduce the issue?
>>> from qiskit.transpiler.passes.synthesis import SolovayKitaev
>>> from qiskit.quantum_info import Operator
>>> from qiskit import QuantumCircuit, Aer, transpile, assemble
>>> c = QuantumCircuit(1)
>>> c.y(0)
<qiskit.circuit.instructionset.InstructionSet object at 0x7f62280bc910>
>>> skd = SolovayKitaev(recursion_degree=3)
>>> dc = skd(c)
>>> c.draw()
┌───┐
q: ┤ Y ├
└───┘
>>> dc.draw()
global phase: 3π/4
┌───┐┌───┐┌───┐┌───┐┌─────┐┌─────┐┌───┐┌───┐┌───┐
q: ┤ H ├┤ T ├┤ T ├┤ H ├┤ Tdg ├┤ Tdg ├┤ H ├┤ T ├┤ T ├
└───┘└───┘└───┘└───┘└─────┘└─────┘└───┘└───┘└───┘
>>> Operator(c)
Operator([[0.+0.j, 0.-1.j],
[0.+1.j, 0.+0.j]],
input_dims=(2,), output_dims=(2,))
>>> Operator(dc)
Operator([[-1.11022302e-16+7.85046229e-17j,
1.05981241e-15+1.00000000e+00j],
[-9.43689571e-16-1.00000000e+00j,
0.00000000e+00-3.92523115e-17j]],
input_dims=(2,), output_dims=(2,))
What should happen?
Given Operator(dc).data
aprroximately equals to [[0, 1j], [-1j, 0]]
which equals to -Operator(c).data
, dc
's global phase should be π rather than 3π/4, I believe.
Any suggestions?
No response
KY2001
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working