-
Notifications
You must be signed in to change notification settings - Fork 376
Enable Pauli operator snapshot mode for VQE on Aer QasmSimulator #715
Enable Pauli operator snapshot mode for VQE on Aer QasmSimulator #715
Conversation
I identify at least eight options:
In particular I'm wondering about the required number of shots for each option.
Is this correct? |
@yaelbh yep ideal qasm simulator with snapshot and no measurement will only simulate 1 shot regardless of what is passed in. With regards to noise: qasm-noise-snapshot and qasm-noise measurement would be different in the sense that snapshot is many shots of 1 circuit, while qasm-noise-measurement is many shots of many circuits (using decomposition of operator into measure circuits). One key point though is I would discourage ever using the statevector simulator (unless for some reason Aer is unavailable and you are stuck using BasicAer). The only reason for using the statevector simulator in the past was before we had implemented the snapshot instructions as the expectation value was computed from the returned statevector. |
@chriseclectic Thanks for the contribution.
For now, I think it is reasonable to only support 1, 2 and 4 for now, we can extend it later.
In this case, you need to update the logic to determine whether or not to use expectation snapshot in the vqe.py. |
* use new Aer Snapshot instruction
to use_simulator_snapshot_mode
0b7d53a
to
7fdd065
Compare
@chunfuchen I made changes to enable snapshot mode for the qasm simulator only when |
…c/fix/vqe-snapshot Enable Pauli operator snapshot mode for VQE on Aer QasmSimulator
…c/fix/vqe-snapshot Enable Pauli operator snapshot mode for VQE on Aer QasmSimulator
…c/fix/vqe-snapshot Enable Pauli operator snapshot mode for VQE on Aer QasmSimulator
…c/fix/vqe-snapshot Enable Pauli operator snapshot mode for VQE on Aer QasmSimulator
Summary
Using snapshots for weighted Pauli operator expection values should be done using the qasm simulator instead of the statevector simulator if the final statevector isn't required, as the later has the overhead of deserializing and returning the final state.
Details and comments
This is WIP with a couple of questions (probably for @chunfuchen)
With regards to the last point this could be enabled by default if noise model has readout or measure errors. Technically it should be enabled if single-qubit Pauli gates have errors too, but maybe we want to allow relaxing that since it will lead to a large huge increase in simulator efficiency (the snapshot is always computed "ideal").