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

Defaults in TranspileConfig (now called PassManagerConfig) #3035

Merged
merged 87 commits into from
Feb 9, 2020

Conversation

1ucian0
Copy link
Member

@1ucian0 1ucian0 commented Aug 23, 2019

While write the release notes for #3004, I realized editing a preset passmanager is a real use-case. That requires a more user-friendly TranspileConfig. For example, it needs good defaults.

If I understand correctly this use-case, a user should be able to instantiate a preset pass manager doing something like this:

from qiskit.transpiler.preset_passmanagers.level0 import level_0_pass_manager
from qiskit.transpiler.transpile_config import TranspileConfig
pass_manager = level_0_pass_manager(TranspileConfig())
pass_manager.draw()

If the level_0_pass_manager parameter is not optional, then TranspileConfig() should be a thing. This PR allows it.

CHANGELOG.md Outdated Show resolved Hide resolved
qiskit/transpiler/transpile_config.py Outdated Show resolved Hide resolved
@1ucian0 1ucian0 changed the title Defaults in TranspileConfig Defaults in TranspileConfig (now called PassManagerConfig) Sep 8, 2019
@1ucian0 1ucian0 assigned ajavadia and unassigned 1ucian0 Jan 13, 2020
qiskit/transpiler/transpile_circuit.py Outdated Show resolved Hide resolved
qiskit/compiler/transpile.py Outdated Show resolved Hide resolved
qiskit/compiler/transpile.py Show resolved Hide resolved
qiskit/compiler/transpile.py Show resolved Hide resolved
Copy link
Member

@ajavadia ajavadia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me but am thinking it's better to merge after release to minimize risk due to API changes.

@mtreinish
Copy link
Member

I agree with @ajavadia lets make this an early merge for the 0.13.0 cycle. I'm updating the milestone accordingly.

@mtreinish mtreinish modified the milestones: 0.12, 0.13 Feb 5, 2020
@1ucian0 1ucian0 added on hold Can not fix yet and removed on hold Can not fix yet labels Feb 6, 2020
@1ucian0
Copy link
Member Author

1ucian0 commented Feb 6, 2020

Removing on hold since there was a release.

@mergify mergify bot merged commit 03083dc into Qiskit:master Feb 9, 2020
@1ucian0 1ucian0 deleted the defaults_TranspileConfig branch February 28, 2020 17:12
faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this pull request Aug 5, 2020
* TranspileConfig defaults

* defatuls for TranspileConfig

* explicit kwargs

* remove __getattr__ None

* move cm checks to _parse_coupling_map

* transpile_config as a dict

* pass manager config

* circuit is yet another transpiler param

* TranspileConfigSchema -> PassManagerConfigSchema

* removing unsed parameters in PassManagerConfig

* no need for _transpile_circuit anymore

* pass manager callback at construction time

* docstring

* changelog

* deprecate callback from construction time

* _parse_output_name creates Nones instead of circuit.name

* transpile_config -> transpile_args

* CouplingMap(backend.configuration().coupling_map)

* reformat

* fixing test/python/transpiler/test_passmanager_run.py

* run(..., output_name=None, callback=None)

* basis

* kwargs

* transpile_args[pass_manager_config].basis_gates

* callback at run time

* lint

* release note

* docstring

* other -> upgrade

* release note

* style

* fix

* line too long

* reverse the changes in about parallel

* rollback transpile_circuit

* lint

* release note

* expanding the parameters

* remove optimization level

* remove pass_manager_config as a transpile_circuit arg

* output_name and callback are optional

* Update qiskit/compiler/transpile.py

Co-Authored-By: Ali Javadi-Abhari <ajavadia@users.noreply.github.com>

* documentation

* parse callback

* remove circuit from transpile_args

* Update qiskit/transpiler/transpile_circuit.py

Co-Authored-By: Ali Javadi-Abhari <ajavadia@users.noreply.github.com>

* rename transpile_args_circuits to list_transpile_args.append

* new path for passes

* back to old _parse_coupling_map

* undoing _parse_output_name

* comments on the transpiler configuration

* docstring

* remove transpile_circuit

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Kevin Krsulich <kevin@krsulich.net>
Co-authored-by: Ali Javadi-Abhari <ajavadia@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: API Change Include in the "Changed" section of the changelog Changelog: Deprecation Include in "Deprecated" section of changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants