Skip to content

HighLevelSynthesis raises an error with 1.3.0rc1 (no error with 1.2.4 and main branch) #13412

@t-imamichi

Description

@t-imamichi

Environment

  • Qiskit version: 1.3.0rc1
  • Python version: 3.12.7
  • Operating system: macOS 15.1

What is happening?

HighLevelSynthesis raises an error with only 1.3.0rc1. 1.2.4 and main branch work fine.

How can we reproduce the issue?

from qiskit import QuantumCircuit
from qiskit.circuit.library import QAOAAnsatz
from qiskit.quantum_info import SparsePauliOp
from qiskit.transpiler import PassManager
from qiskit.transpiler.passes import HighLevelSynthesis

qc = QAOAAnsatz(SparsePauliOp("Z"), initial_state=QuantumCircuit(1))
pm = PassManager([HighLevelSynthesis(basis_gates=["PauliEvolution"])])
qc2 = pm.run(qc)
print(qc2)

What should happen?

# 1.2.4 and main branch
   ┌──────────────────┐┌──────────────────┐
q: ┤ exp(-it Z)(γ[0]) ├┤ exp(-it X)(β[0]) ├
   └──────────────────┘└──────────────────┘
# 1.3.0rc1
Traceback (most recent call last):
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passmanager.py", line 464, in wrapper
    return meth(*meth_args, **meth_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passmanager.py", line 226, in run
    return super().run(
           ^^^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/passmanager/passmanager.py", line 232, in run
    _run_workflow(program=program, pass_manager=self, callback=callback, **kwargs)
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/passmanager/passmanager.py", line 292, in _run_workflow
    passmanager_ir, final_state = flow_controller.execute(
                                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/passmanager/base_tasks.py", line 218, in execute
    passmanager_ir, state = next_task.execute(
                            ^^^^^^^^^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/basepasses.py", line 195, in execute
    new_dag, state = super().execute(
                     ^^^^^^^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/passmanager/base_tasks.py", line 98, in execute
    ret = self.run(passmanager_ir)
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passes/synthesis/high_level_synthesis.py", line 279, in run
    out_dag = self._run(dag, tracker, context, use_ancillas=True, top_level=True)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passes/synthesis/high_level_synthesis.py", line 379, in _run
    synthesized, synthesized_context = self._synthesize_operation(
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passes/synthesis/high_level_synthesis.py", line 606, in _synthesize_operation
    synthesized = self._run(
                  ^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passes/synthesis/high_level_synthesis.py", line 379, in _run
    synthesized, synthesized_context = self._synthesize_operation(
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passes/synthesis/high_level_synthesis.py", line 606, in _synthesize_operation
    synthesized = self._run(
                  ^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passes/synthesis/high_level_synthesis.py", line 379, in _run
    synthesized, synthesized_context = self._synthesize_operation(
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passes/synthesis/high_level_synthesis.py", line 606, in _synthesize_operation
    synthesized = self._run(
                  ^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passes/synthesis/high_level_synthesis.py", line 379, in _run
    synthesized, synthesized_context = self._synthesize_operation(
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passes/synthesis/high_level_synthesis.py", line 606, in _synthesize_operation
    synthesized = self._run(
                  ^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passes/synthesis/high_level_synthesis.py", line 379, in _run
    synthesized, synthesized_context = self._synthesize_operation(
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passes/synthesis/high_level_synthesis.py", line 606, in _synthesize_operation
    synthesized = self._run(
                  ^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passes/synthesis/high_level_synthesis.py", line 379, in _run
    synthesized, synthesized_context = self._synthesize_operation(
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passes/synthesis/high_level_synthesis.py", line 570, in _synthesize_operation
    synthesized = self._get_custom_definition(operation, indices)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passes/synthesis/high_level_synthesis.py", line 655, in _get_custom_definition
    raise TranspilerError(f"HighLevelSynthesis was unable to synthesize {inst}.")
qiskit.transpiler.exceptions.TranspilerError: "HighLevelSynthesis was unable to synthesize Instruction(name='u', num_qubits=1, num_clbits=0, params=[0.0, 0.0, ParameterExpression(2.0*γ[0])])."

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/ima/tasks/4_2024/qiskit/terra/tmp/synth.py", line 9, in <module>
    qc2 = pm.run(qc)
          ^^^^^^^^^^
  File "/Users/ima/envs/qiskit130/lib/python3.12/site-packages/qiskit/transpiler/passmanager.py", line 466, in wrapper
    raise TranspilerError(ex.message) from ex
qiskit.transpiler.exceptions.TranspilerError: "HighLevelSynthesis was unable to synthesize Instruction(name='u', num_qubits=1, num_clbits=0, params=[0.0, 0.0, ParameterExpression(2.0*γ[0])])."

Any suggestions?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions