-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Schedule with backend v2 #10564
Schedule with backend v2 #10564
Conversation
…e/target_from_cofiguration
@@ -31,5 +30,5 @@ def __init__(self, inst_map: InstructionScheduleMap, meas_map: List[List[int]], | |||
dt: Sample duration. | |||
""" | |||
self.inst_map = inst_map | |||
self.meas_map = format_meas_map(meas_map) | |||
self.meas_map = meas_map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed format_meas_map
.
When I make target
class like this
Target(meas_map=schedule_config.meas_map)
the type of meas_map
is restricted to list
(#10258 (comment)).
qiskit/scheduler/lowering.py
Outdated
def convert_to_target(func): | ||
""" | ||
A wrapper function that prepares target instead of scheduleConfig | ||
when the ScheduleConfing is specified. | ||
|
||
If the ScheduleConfig is deprecated, this fucntion will be removed. | ||
""" | ||
|
||
@deprecate_arg( | ||
"schedule_config", | ||
deprecation_description="Using target instead of schedule_config.", | ||
since="0.25.0", | ||
pending=True, | ||
predicate=lambda schedule_config: schedule_config is not None, | ||
) | ||
def _wrapped(circuit: QuantumCircuit, schedule_config: ScheduleConfig, target: Target): | ||
if schedule_config is not None: | ||
target = Target(schedule_config.meas_map) | ||
target.update_from_instruction_schedule_map(schedule_config.inst_map) | ||
return func(circuit, target=target) | ||
|
||
return _wrapped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a wrapper function for ScheduleConfig
deprecation.(ref: #10285 (comment))
One or more of the the following people are requested to review this:
|
Hi @to24toro, I'm also studying in area that needs schedule function and reached to this end of your work. You seem to have changed a lot in qiskit/pulse. I assume that I connected wrongly with my current qiskit well. It would be great if you leave the comment of whether current branch is working well or not. Also, if you are okay, I'd like to hear and participate in your progress. Thanks for the work. |
@sungwooahn |
715e090
to
c63073f
Compare
c63073f
to
609e238
Compare
c7dfb53
to
7c276e4
Compare
7c276e4
to
983d3e4
Compare
#10988 solve the bug of scheduling with backendV2. |
Summary
Closed #10285 and reopened at this PR.
This PR fixes the bug of scheduling with backendV2.
We aim to replace ScheduleConfig with Target when backendV1 will be deprecated in the future.
Details and comments
When making a schedule, Target and ScheduleConfig are prepared by dispatching the type of backend. Now I consider ScheduleConfig class will be deprecated at the same time the backendV1 is dropped.
When deprecating ScheduleConfig, Target will become required and ScheduleConfig will be dropped.
Added the new test for schedule with backendV2 in
test/python/pulse/test_builder_v2.py
.API change
target
toschedule
inschedule.py
.target
tosequence
insequence.py
.target
tolower_gates
inqiskit/scheduler/lowering.py
.target
tolas_soon_as_possible
inqiskit/scheduler/methods/basic.py
.target
toas_late_as_possible
inqiskit/scheduler/methods/basic.py
.target
toschedule_circuit
inqiskit/scheduler/schedule_circuit.py
.