-
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
Adding PulseSystemModel class as higher level class containing HamiltonianModel #496
Adding PulseSystemModel class as higher level class containing HamiltonianModel #496
Conversation
…ate_channel_frequencies
…ils.__init__ for pulse_sim_utils
…ngs to HamiltonianModel
…alculate_channel_frequencies
…ication from string parsing
Update: Made some changes, but in terms of the to do list, migrated the There is a slight issue that will cause things to break at some point: Edit: This inconsistency is apparently discussed in either a terra issue or PR, so should be changed at some-point soon, which will break the tests here, but I figure the only thing we can do is fix it when it happens does. |
The latest updates are described by the previous comment; it has been edited as it is mostly the same. The only edit is the removal of the methods from |
…default memory_slots setting in digest to be equal to the number of qubits
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.
Initial review. My main question is do both classes need channel
information? Currently this seems to be duplicated in both classes.
def from_string_spec(cls, hamiltonian, qubit_list=None): | ||
"""Initialize from a Hamiltonian string specification. |
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.
qubit_list
-> subsystems
or qargs
(they could be oscillator systems etc)
qargs
is kwarg uesd for QuantumCircuit
and Operator
classes for specifying subsystems
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.
Adding this to the list of things for future PRs.
|
||
# get relevant information from backend | ||
defaults = backend.defaults().to_dict() | ||
config = backend.configuration().to_dict() |
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.
Same for config
…eSystemModel._qubit_freq_est
… _oscillator_dims
…kend is in fact a pulse backend
… PulseSystemModel constructor
@@ -9,7 +9,7 @@ | |||
# Any modifications or derivative works of this code must retain this | |||
# copyright notice, and modified files need to carry a notice indicating | |||
# that they have been altered from the originals. | |||
# pylint: disable=arguments-differ | |||
# pylint: disable=arguments-differ, missing-return-type-doc |
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.
We shouldn't need to add this pylint skip, what functions were causing the missing-return-type-doc
error?
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.
LGTM, lets do rest of changes in a follow up PR
…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
…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
…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
…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
Update
This is no longer a [WIP] - and is ready for review.
Summary
This is a [WIP], but the purpose of the new class
SimSystemModel
is to:HamiltonianModel
addition, detangle the options specifications for a pulse simulation. It contains aHamiltonianModel
instance, along with any other remaining model information not naturally contained inHamiltonianModel
, such as the sampling ratedt
andu_channel_lo
.HamiltonianModel
, this is where model-based functions like frequency calculations can live that the user can use.To instantiate from a backend:
To simulate using this model, and an already assembled pulse
qobj
:Now, the argument
backend_options
will contain only information specific to the simulator backend, like ODE options (as opposed to a combination of model and solver parameters as before).Details and comments
I still need to make the following changes, but comments are welcome.
I'm not crazy about the name
SimSystemModel
, any suggestions @chriseclectic @atilag ?SystemModel
sounds better, but I thought it might be too general.