Skip to content

Remove unnecessary parameter table from pulse program#6172

Closed
nkanazawa1989 wants to merge 2 commits into
Qiskit:mainfrom
nkanazawa1989:remove_parameter_table
Closed

Remove unnecessary parameter table from pulse program#6172
nkanazawa1989 wants to merge 2 commits into
Qiskit:mainfrom
nkanazawa1989:remove_parameter_table

Conversation

@nkanazawa1989
Copy link
Copy Markdown
Contributor

Summary

In #5854 parameter table is deprecated and ParameterManager is introduced. This PR removes unnecessary parameter tables and .parameters, .assign_parameters methods from pulse instructions and channels.

Details and comments

Simple benchmark

%%time

for _ in range(100):
    sched = pulse.ScheduleBlock()
    for _ in range(3000):
        sched += pulse.Play(pulse.Gaussian(circuit.Parameter('dur'), 
                                           circuit.Parameter('amp'), 
                                           circuit.Parameter('sigma')), 
                            pulse.DriveChannel(circuit.Parameter('ch')))

This PR:
CPU times: user 35.8 s, sys: 1.1 s, total: 36.9 s
Wall time: 36.9 s

master:
CPU times: user 46.2 s, sys: 1.36 s, total: 47.6 s
Wall time: 47.6 s

This improvement is simply thanks to the removal of parameter table. All instructions and channels had been initializing the table in the constructor, but this is just an overhead to create new instance. We just added deprecation warning in 0.17, perhaps this PR should be on hold. However, considering the performance improvement, it could be better to remove them soon.

@mtreinish
Copy link
Copy Markdown
Member

Per the deprecation policy: https://qiskit.org/documentation/contributing_to_qiskit.html#deprecation-policy this is way too soon to remove. I'm marking this as on hold until we have given users a chance to adapt based on the deprecation.

@mtreinish mtreinish added the on hold Can not fix yet label Apr 7, 2021
@nkanazawa1989
Copy link
Copy Markdown
Contributor Author

replaced with #7267

@nkanazawa1989 nkanazawa1989 deleted the remove_parameter_table branch November 25, 2022 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on hold Can not fix yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants