-
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.24.0.dev0+84a0fdd
- Python version: 3.9
- Operating system: MacOS
What is happening?
When unitary_synthesis
is called with a particularly restrictive basis_gates
, it seems to generate a None
output as best_synth_circuit
, which makes optimize_1q_decomposition
raise.
How can we reproduce the issue?
from qiskit import *
circuit = QuantumCircuit(1)
circuit.append(Operator([[0.96891242+0.j , 0. -0.24740396j],
[0. -0.24740396j, 0.96891242+0.j ]]), [0])
transpile(circuit, basis_gates=['h', 'rx']).draw()
...
<reducted>/qiskit/transpiler/passes/synthesis/unitary_synthesis.py in run(self, unitary, **options)
741 if unitary.shape == (2, 2):
742 _decomposer1q = Optimize1qGatesDecomposition(basis_gates, target)
--> 743 return _decomposer1q._gate_sequence_to_dag(
744 _decomposer1q._resynthesize_run(unitary, qubits[0])
745 )
<reducted>/qiskit/transpiler/passes/optimization/optimize_1q_decomposition.py in _gate_sequence_to_dag(self, best_synth_circuit)
144 out_dag = DAGCircuit()
145 out_dag.add_qubits(qubits)
--> 146 out_dag.global_phase = best_synth_circuit.global_phase
147
148 for gate_name, angles in best_synth_circuit:
AttributeError: 'NoneType' object has no attribute 'global_phase'
What should happen?
work or nicer error
Any suggestions?
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working