-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc strings and default behavior for pulse simulator #521
Conversation
Fixing CMake file for pulse simulator
* Add readme and example * Add qubit whitelist, update example * Added a frequency to the channels * Adding frame rotation, doesn't quite work yet * Fixed bug, now works for general oscillation frequencies * Added dressed state measurement * Notebook updated with Rabi and CR * Update readme.md * Reorder estates after dressing to original ordering. Uses a very basic routine so won't work at avoided crossings * Generalize qubit operators, fix transformation error * Updated notebook with the correct sims * Fixed some path issues, replaced absolute with relative paths * Moved example, fixed error for unitary solver in opsolve * Updated to work with the pulse_simulator backend * Put header into results so that get_counts will work * Updated measurement to fix an error in the eigenstate mapper, add measurement level 1 and clean up example * Fixed hamiltonian issues with noise, fixed measurement, finalized notebook * Fixed issue with default config in pulse sim backend * Fix reference to qiskiterror * Fixed some import errors after merging with paul
…supported Added warning messages for Pulse Simulator untested features
- Changed 'seed' in digest_pulse_obj to be drawn from config_dict_sim instead of config_dict config_dict_sim pertains to aspects of the simulation, so it is a more natural place for this option to be drawn from. - Corrected change in digest.py from last commit for drawing 'seed' from config_dict_sim. - Updated functions backend_options_1q and backend_options_2q in TestPulseSimulator to also set a 'seed' to make tests deterministic. Ran tests a few times and verified that the random results of simulations (e.g. counts) became deterministic. - Corrected the skipping of 'test_persistent_value' to be done with the '@unittest.skip' decorator.
* Add HamiltonianModel class for pulse simulator * update digest to use HamiltonianModel * change statevector pulse tests to use state_fidelity
…ianModel (Qiskit#496) * added PulseSystemModel to extract information about backend relevant to simulation * Moved HamiltonianModel.calculate_frequencies to PulseSystemModel.calculate_channel_frequencies * Modifying constructors for HamiltonianModel to separate object specification from string parsing * added PulseDefaults object into the pulse_simulator, and changed the default memory_slots setting in digest to be equal to the number of qubits * changed digest default 'meas_level' to 2
* Calling c++ implementation of the numeric integrator solver function (just a basic scaffolding) * Adding C++ and helpers code (still not building) * Adding tests for the C++ helpers on Python C API * Adding my ordered_map to guarantee order insertion iteration (ala Python's OrderedDict) * Adding muparserx library for parsing hamiltonian math expressions * Now we can use both Cython and C++ func ODE solver depending on a config param: use_cpp_ode_func * Disabling Pulse simulator related tests for Python 3.5
…mulator (Qiskit#503) * removed noise_model from digest args, and also sim_config handling * Changed warnings in digest for persistentValue pulses * multiplying qubit_lo_freq by 1e9 in digest.py, as assemble divides it by 1e9
…mModel and HamiltonianModel about how values are handled
…ently relevant for qubit_lo_freq determination
…in digest to allow backend_options to override anything in digest
45f1533
to
ddc09c5
Compare
@@ -33,19 +33,87 @@ | |||
|
|||
class PulseSimulator(AerBackend): | |||
"""Aer OpenPulse simulator | |||
|
|||
The `PulseSimulator` simulates pulse `Schedules` on a model of a quantum system, where a model | |||
is specified by a `PulseSystemModel` object, which stores Hamiltonian and control channel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should be able to link documentation by using sphinx directives. Eg:
:class:`~qiskit.path-to.PulseSystemModel`
**Example of usage** | ||
|
||
To use the simulator, `assemble` a `PulseQobj` object from a list of pulse `Schedules`, using | ||
`backend=PulseSimulator()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In sphinx you need to use double-ticks for "code" formatting eg:
``backend=PulseSimulator()``.
@DanPuzzuoli can you rebase this PR against master now that the |
Summary
This PR contains both clarification of default behaviors in
digest.py
, as well as added doc strings forHamiltonianModel
,PulseSystemModel
, andPulseSimulator
. (Both were done at the same time as default behavior influences doc strings.) The doc string forPulseSimulator
will likely need to be edited, but this is at least a start, and contains all of the information from the pulse simulator readme.Closes #501 and #433
Details and comments
Specific changes for
digest
:qubit_lo_freq
indigest.py
qobj
passed by the usersystem_model._qubit_freq_est
digest
to test for the above behavior.digest
that allowsbackend_options
to override any key/value inqobj_config
.Changes for doc strings:
HamiltonianModel
andPulseSystemModel
PulseSimulator
. May need more work, but it at least contains everything from the original readme.