unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
359 stars 157 forks source link

Add description of `functools.partial` in Executors documentation #2360

Open jordandsullivan opened 4 months ago

jordandsullivan commented 4 months ago

Discussed in https://github.com/unitaryfund/mitiq/discussions/2326

Originally posted by **jordandsullivan** April 25, 2024 In a fair number of example notebooks and tests, the utility `functools.partial` is used to creator an executor function with fewer arguments specific arguments set to particular values. e.g. https://github.com/unitaryfund/mitiq/blob/main/docs/source/examples/ddd_tutorial.md?plain=1#L182.

Given how common a use case this is (i.e. specifying kwargs for an executor but still running it as a function), I suggest we add a short description and example of this in our Executors documentation page.