-
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 version: 1.4.2
- Python version: 2.9.0
- Operating system: linux
What is happening?
Rx(theta) = H Rz(theta) H
This conversion theoretically does not generate any global phase. However, the transpiler from qiskit will generate an extra global phase pi here.
How can we reproduce the issue?
from qiskit import QuantumCircuit, transpile
import numpy as np
theta = 0.5*np.pi
circuit1 = QuantumCircuit(1)
circuit1.rx(theta, 0)
circuit2 = transpile(circuit1, basis_gates=['h','rz' ])
global_phase = circuit2.global_phase-circuit1.global_phase
print(global_phase)
circuit2.draw('mpl')
output:
3.141592653589793
What should happen?
During the transformation of Rx gate, the global phase may be added incorrectly, resulting in an error in the final result.
Any suggestions?
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working