Skip to content

Commit

Permalink
Update transpiler documentation of instruction_durations (#6799)
Browse files Browse the repository at this point in the history
* Fix issue 6667 by updating transpiler

Add condition in `qiskit.compiler.transpiler`: if `scheduling_method` is not provided and `instruction_durations` argument specified, set `scheduling_method=as_late_as_possible`.
Note that the `as_late_as_possible` scheduling method was chosen as it is the one applied by default by the scheduler when no method is specified. This scheduling method improves the outcome fidelity over the `as_soon_as_possible` scheduling method.

When the `transpile()` function is provided with the `instruction_durations` argument and no `scheduling_method` argument is specified, the behaviour before update is to ignore the `instruction_durations` argument and not apply any scheduling pass.

After the update, the behaviour is to apply scheduling pass with the default scheduling method: `as_late_as_possible`.

Fixes: #6667

* Fix issue 6667 by updating docstring in transpiler

Update docstring to indicate that the argument `instruction_durations` provided to the `transpile()` function is only applicable if the argument `scheduling_method` is also provided.

Fixes: #6667

Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 13, 2021
1 parent 7c30a6e commit a79709a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions qiskit/compiler/transpiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def transpile(
in the ground state when possible. (alias: ``'alap'``)
If ``None``, no scheduling will be done.
instruction_durations: Durations of instructions.
Applicable only if scheduling_method is specified.
The gate lengths defined in ``backend.properties`` are used as default.
They are overwritten if this ``instruction_durations`` is specified.
The format of ``instruction_durations`` must be as follows.
Expand Down

0 comments on commit a79709a

Please sign in to comment.