Skip to content
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

Add PulseSimulator feature branch to master #542

Merged
merged 24 commits into from
Jan 24, 2020

Conversation

chriseclectic
Copy link
Member

Summary

This is a rebase of the openpulse-sim feature branch to cleanup the early commit history for merging into master.

NOTE: It should be merge committed to preserve history from multiple authors rather than squashed.

Details and comments

Due to rebasing issues and changes in build system, the CMakeLists and setup.py need a clean up @atilag

nonhermitian and others added 23 commits January 23, 2020 12:08
* changed example to use fake backend, updated for pep8

* fix lint errors
* Adding CMakeLists.txt to new cython files from OpenPulse
* Simplified CMakeLists to build all the Cython related stuff
* Removing unnecessary init python files
* Adding CMake helper files
* Add init files for Cython imports
* Adding pulse_sim.py example, extracted from the already existing Notebook code
* Fixed ordering for meas level 2

* Fixed error in example
Add Pulse Simulator tests
* Add backend_options to PulseSimulator.run

* Update pulse simulator example notebook

* Update pulse tests
- The module seems to be conflicting while cython builds, with the standard
  math module, in some specific configurations.
* added check for backend_config['qubit_lo_freq'] in openpulse/qobj/digest.digest_pulse_qobj for computing qubit_lo_freq from the Hamiltonian itself

* added class for tests of digest.py, along with a test for the option qubit_lo_freq from_hamiltonian

* added pulse_sim_utils.py

* moved compute_lo_freq_from_hamiltonian from pulse_simulator to pulse_sim_utils

* moved PulseSimulator.get_dressed_energies to pulse_sim_utils
Qiskit#473)

* fixed handling of time in digest.experiment_to_structs by changing all appearances of inst['t0'] to inst['t0']*dt

* Added test test_dt_scaling_x_gate to TestPulseSimulator

This tests that dt is being used correctly. The structure of the test is the same as
test_x_gate; but runs the test multiple times with different dt values, along with
the other parameters scaled accordingly, so that all of the simulations have different
dt values but should have the same result. This test fails on the original code this
branch was created from, but passes on the current branch.
- 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
* Created new file for helper functions for creating HamiltonianModel and PulseSystemModel objects for duffing oscillator systems

* increased max shots in pulse_simulator

* added PulseSystemModel.control_channel_index() along with tests
* Add muparserx submodule needed by the pulse simulator solver

* Moved muparserx library to tag v4.0.8

* Fix git submodules in Azure Pipelines CI

* Integrate muparserx source code dependency into the build system
  This way there's no need for anyone to explicitly initialize submodules, and
  installations without git presence like `pip install https://....zip` will
  clone from muparserx repo and checkout the correct commit
@chriseclectic chriseclectic changed the title [WIP] Add PulseSimulator feature branch to master Add PulseSimulator feature branch to master Jan 24, 2020
@chriseclectic chriseclectic merged commit 40d9037 into Qiskit:master Jan 24, 2020
@chriseclectic chriseclectic deleted the openpulse-sim-rebase branch April 28, 2020 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants