-
Notifications
You must be signed in to change notification settings - Fork 384
Enable Aer's parameter binding #1206
Enable Aer's parameter binding #1206
Conversation
201f7ad
to
acbb4be
Compare
acbb4be
to
2193487
Compare
@hhorii Hi, thanks for looking at this. Do you have any result around what sort of performance improvement can be expected? This presumably avoids the assemble stage each time - but presently this is custom to Aer it seems? Also do you think there is anyway to have this custom Aer parameterization in the Quantum Instance so other algorithms using parameterized ccts e.g VQC could take advantage of it too, and use it there from CircuitSampler rather than have it i CircuitSampler? In general we have tried to keep backend/execution capabilities in Quantum Instance to allow more general usage throughout Aqua. |
@woodsp-ibm I used To make this optimization more general, I guess that |
On the QuantumInstance, then let's leave things how you have it for now since VQE is main area where performance improvements are wanted presently. We can figure where we want to go with this more generally later perhaps, if this seems difficult to do for now. But I do think we should have a couple of unit tests with Aer and VQE whose main goal is to ensure this function continues to work as expected. My guess is that the coverage we happen to have is by virtue of the test_readme_sample in chemistry that happens to use Aer. Normally the unit tests here used BasicAer hence I needed to look to figure where the unit test coverage was coming from. |
I added some extra unit testing with Aer so as to ensure we have adequate coverage since now the parameterization behavior with VQE circuits depends on whether Aer is being used or not. |
* enable aer's parameter binding * Additional unit testing with Aer Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com> Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com> Co-authored-by: woodsp <woodsp@us.ibm.com>
* enable aer's parameter binding * Additional unit testing with Aer Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com> Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com> Co-authored-by: woodsp <woodsp@us.ibm.com>
* enable aer's parameter binding * Additional unit testing with Aer Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com> Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com> Co-authored-by: woodsp <woodsp@us.ibm.com>
* enable aer's parameter binding * Additional unit testing with Aer Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com> Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com> Co-authored-by: woodsp <woodsp@us.ibm.com>
* enable aer's parameter binding * Additional unit testing with Aer Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com> Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com> Co-authored-by: woodsp <woodsp@us.ibm.com>
Summary
Use Aer's parameter-binding if
QasmSimulator
orStatevectorSimulator
is usedDetails and comments
Enable Aer's parameter-binding instead of Terra's.
This PR assumes that
Parameter
is the only parameter type inCircuitSampler
. Currently,CircuitSampler.convert()
is called only byVQE
.VQE
uses onlyParameter
(and notParameterVector
andParameterExpression
) for parameter binding.