Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TranspilerError: 'The parameters pass_manager conflicts with the following parameter(s): unitary_synthesis_method.' #7663

Closed
kevinsung opened this issue Feb 14, 2022 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@kevinsung
Copy link
Contributor

Environment

  • Qiskit Terra version: 1ae663d
  • Python version: 3.9.6
  • Operating system: RHEL 8.5

What is happening?

Passing pass manager to transpile without also setting unitary_synthesis_method to None gives an error.

How can we reproduce the issue?

from qiskit import QuantumCircuit, transpile
from qiskit.test.mock import FakeMumbai
from qiskit.transpiler import PassManagerConfig
from qiskit.transpiler.preset_passmanagers import level_3_pass_manager

backend = FakeMumbai()
qubits = [0]

circuit = QuantumCircuit(1)
circuit.x(0)

pass_manager_config = PassManagerConfig(initial_layout=qubits, backend_properties=backend.properties())
pass_manager = level_3_pass_manager(pass_manager_config)

transpiled = transpile(circuit, pass_manager=pass_manager)
---------------------------------------------------------------------------
TranspilerError                           Traceback (most recent call last)
Input In [3], in <module>
     12 pass_manager_config = PassManagerConfig(initial_layout=qubits, backend_properties=backend.properties())
     13 pass_manager = level_3_pass_manager(pass_manager_config)
---> 15 transpiled = transpile(circuit, pass_manager=pass_manager)

File ~/projects/qiskit-terra/qiskit/compiler/transpiler.py:264, in transpile(circuits, backend, basis_gates, inst_map, coupling_map, backend_properties, initial_layout, layout_method, routing_method, translation_method, scheduling_method, instruction_durations, dt, approximation_degree, timing_constraints, seed_transpiler, optimization_level, pass_manager, callback, output_name, unitary_synthesis_method, unitary_synthesis_plugin_config, target)
    261         return circuits[0]
    263 if pass_manager is not None:
--> 264     _check_conflicting_argument(
    265         optimization_level=optimization_level,
    266         basis_gates=basis_gates,
    267         coupling_map=coupling_map,
    268         seed_transpiler=seed_transpiler,
    269         backend_properties=backend_properties,
    270         initial_layout=initial_layout,
    271         layout_method=layout_method,
    272         routing_method=routing_method,
    273         translation_method=translation_method,
    274         approximation_degree=approximation_degree,
    275         unitary_synthesis_method=unitary_synthesis_method,
    276         backend=backend,
    277         target=target,
    278     )
    280     warnings.warn(
    281         "The parameter pass_manager in transpile is being deprecated. "
    282         "The preferred way to tranpile a circuit using a custom pass manager is"
   (...)
    285         stacklevel=2,
    286     )
    287     return pass_manager.run(circuits, output_name=output_name, callback=callback)

File ~/projects/qiskit-terra/qiskit/compiler/transpiler.py:349, in _check_conflicting_argument(**kargs)
    347 conflicting_args = [arg for arg, value in kargs.items() if value]
    348 if conflicting_args:
--> 349     raise TranspilerError(
    350         "The parameters pass_manager conflicts with the following "
    351         "parameter(s): {}.".format(", ".join(conflicting_args))
    352     )

TranspilerError: 'The parameters pass_manager conflicts with the following parameter(s): unitary_synthesis_method.'

What should happen?

Should not be forced to set unitary_synthesis_method to None.

Any suggestions?

No response

@kevinsung kevinsung added the bug Something isn't working label Feb 14, 2022
@jakelishman
Copy link
Member

This is true, but with the pass_manager argument to transpile deprecated, probably the best solution for us is just to effect the removal of the pass_manager keyword entirely for 0.20, and skip all that code - the deprecation has been kicking around since #4060, which was a little under a year ago now (so probably Terra 0.17 or 0.18).

@mtreinish
Copy link
Member

Closed by: #7679 which removes the pass_manager kwarg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants