Configurable backends#486
Conversation
a285b80 to
0034862
Compare
48d6c3a to
079a4e1
Compare
|
This is cool. It would be extra cool if Aer could autogen the noisy sims from those found doing sim = Aer.get_backend('vigo_simulator')
job = execute([qc], sim)
... |
079a4e1 to
d684399
Compare
d684399 to
e01e375
Compare
e01e375 to
4862ec4
Compare
95a95d8 to
8230e14
Compare
vvilpas
left a comment
There was a problem hiding this comment.
Looks good. I have some very minor comments/sugggestions (most of them remainders to add 'cy' in list of basis)
| if hasattr(self.configuration(), 'hamiltonian'): | ||
| warn('Specifying both a configuration with a Hamiltonian and a ' | ||
| 'system model may result in inconsistencies.') |
There was a problem hiding this comment.
Shouldn't we raise an exception in this case?
There was a problem hiding this comment.
I figured a warning gives a bit more flexibility, enabling the user to independently specify a system model without having to modify other backend attributes. At the same time, I don't have a very clear/obvious use-case for this, and in any case if we change it to an exception, the user could still specify an independent system model by first deleting the Hamiltonian. I think personally I'm leaning towards keeping it as is and leaving it up to the user to choose what to do, though I acknowledge changing it to an exception does keep the object state "cleaner".
9001555 to
7a97b47
Compare
Make aer simulator backends configurable Add deprecation warning to backend_options kwarg Update AerJob and AerBackend Update PulseSimulator configurable backends Clean up config, properties, defaults option settings in AerBackend This simplifies the _set_option method in the PulseSimulator and QasmSimulator Simplify handling of run options in qobj config Make pulse_controller only require qobj input Update docs for pulse simulator Co-Authored-By: Daniel Puzzuoli <dan.puzzuoli@gmail.com>
Qiskit Aqua was making direct use of internal AerBackend and AerJob functions that would break its use with thie refactor. This adds deprecated backwards compatible internal functions until aqua can be updated.
system_model has been changed from arg to kwarg, so this allows old way of passing by arg and raising a deprecation warning.
bb76d56 to
dce1c5a
Compare
mtreinish
left a comment
There was a problem hiding this comment.
At a high level this looks good to me. It aligns with the model we're moving towards in Qiskit/qiskit#5086 and puts us in a good place to switch over to that in the next aer release. The only piece missing is the default options (which being none is fine for a default) to define which options are available for a backend. Right now there isn't an easily discoverable way since everything is done via kwargs besides reading the docs. But, that's fine to do in a follow up when we migrate this Aer to be a v2 provider.
I just had a question inline and a doc suggestion, but easy enough to fix in a follow up.
Summary
Makes simulator backends have configurable options. Allows configuring a noisy backend from
Closes #645
Details and comments
Backend options initialization of the simulator object, or after, and still overridden using execute/run kwargs as previously.
All backend options may be passed in as kwargs, rather than a dict (though dict is maintained for backwards compatibility).
Example
Configuring a simulator after initializing
Make a noisy backend from backend noise model
TODO:
backend_optionskwargQasmSimulator.from_backendPulseSimulator.from_backendFollow up