forked from qiskit-community/qiskit-ignis
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Rb logging #1
Open
eliarbel
wants to merge
155
commits into
master
Choose a base branch
from
rb_logging
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rb logging #1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Add appveyor config to test on windows We support running ignis on windows, osx, and linux but we only currently test running things on linux. This commit adds the initial config for running tests under windows too so we can verify that it works as expected. * Switch to conda and install mkl * Add -y to conda install * Don't upgrade pip * Tweak install steps slightly * Tweak conda install command * More conda tweaks * Drop --user pip flag * Re-add pip update pip * Re-add pip update pip * Switch to lists of file content instead of using filecmp in clifford tests * Uncomment aer requirement * Fix lint * Install more via conda * Fix typos and reorder * No conda numpy * Downgrade python 3.5 * Disable python 3.7 and 3.5 jobs and remove conda usage This commit removes the python 3.7 and 3.5 jobs because the aer wheels published on pypi are broken and unusable. There is also no sdist published to automate a build via pip. Cloning and building Aer from source isn't worth it just for unit testing python 3.7 and 3.5 on windows. So until there are working Aer builds published on pypi this commit just comments out those jobs. We can add them back when/if there are working windows wheels for python 3.7 and 3.5. This commit also removes the conda usage since all that manipulation was in an attempt to get the wheels to load against potentially missing dynamic libs. But since that never worked there should be no need to interact with conda (or use it) in the jobs. This comments them out just in case we need to add it in the future. * Switch back to conda to install mkl for cvx
We support running ignis on windows, osx, and linux but we only currently test running things on linux. This commit adds the travis config for running tests under osx too so we can verify that it works as expected. Since this basically doubles the number of travis jobs we're running to conserve throughput this also adds job staging. So when a PR is pushed first it will run the lint checks and python 3.5 tests on linux. If those pass then it will run tests unittests in the remaining linux environments and on osx.
…ion of apply is not ready
…es gives the same answer
…en tany truncation issues (qiskit-community#246)
…nity#248) * Make azure pipeline steps fail on intermediate commands The azure pipelines commands were previously using the script directive which on windows uses cmd.exe to run commands. The return code for the step process only returns non-zero and exits if the last command in the script returns non-zero, it will continue running if an intermediate command fails. This can lead to hard to parse errors because something failed earlier in the pipeline and we don't catch it until later. For example pip install tox failing because of a network issue and then we get a command not found error for tox later when it goes to run tests. This commit fixes this potential issue by switching all the script to use base and then using 'set -e' to set errexit to make sure any failing command causes the job to fail there. * Use bash style variables instead of cmd * Add trace mode for debugging
…it-community#248)" (qiskit-community#249) This PR was merged by mistake before it was ready. The switch to bash scripts breaks the anaconda commands. It still needs to be debugged. Eventually we'll want this change because it'll make our jobs more reliable in the long run. But the last details still need to be worked out. This commit reverts the change to unblock the windows CI until it is ready. This reverts commit e3420a6.
…qiskit-community#247) * Small changes in the guess values of RBFitter.fit_data * Fixed the rb fit bounds * lint
This commit updates the CHANGELOG and prepares for the 0.2.0 release. This should be the last commit on master prior to the 0.2.0 release.
Now that qiskit-ignis 0.2.0 is out the door we should bump the version string on master to show the source version we're installing is newer than what's been released.
Update new Tutorials URL in readme
…ity#255) * moved load_tables to clifford_utils.py * move get_quantum_circuit to circuits.py * replace: random_clifford_gates --> random_gates, find_inverse_clifford_gates --> find_inverse_gates * added parameter group_gates and replaced clutils-->futils * replaced: Clifford --> Ggroup, clutils --> Gutils * replaced: Clifford --> Ggroup * replaced clifford_tables --> group_tables, updated comments * updated comments * fix lint error * fix lint errors * update comment with group_gates * fix lint errors * updated circuits.py following review, refactor: Cliffs-->Elmnts * fix lint error * new func find_key added to clifford_utils to find the cliff index * fix lint error * add a BasicUtils class * create a CliffordUtils class instead of clifford_utils functions * updated test_clifford with CliffordUtils class * Update README.md (qiskit-community#261) Update new Tutorials URL in readme * Fixed circular ref issues and lint
…due to Windows directory separator)
osqp gets pulled in as a dependency by cvxpy but the recent 0.6.0 (and 0.6.1) releases on pypi did not include a prebuilt binary wheel for python 3.5 on Windows and macOS, see: osqp/osqp#187. This breaks our windows CI on python 3.5 because we do not have the environment configured to install that package from source. To work around this in the meantime this commit pins the version of osqp we install to be the previous release, 0.5.0, which had prebuilt binaries for all our testing environments.
The contributing doc was quite out of date. It looks like it was originally copy and pasted from an old version of the terra CONTRIBUTING file and contained information that was never accurate for ignis. It also had a number of markdown style issue and a lot of language that was worded in a confusing manner. This commit updates all of this and tries to make the document up to date and easier to read. Fixes qiskit-community#230
* WIP tutorial for ignis logging * Fix to issue qiskit-community#257: replaing \ with \\ in re.compile (due to Windows directory separator) * no need for examples here
* Execute tests in parallel for CI This commit switches the test runner we use to use stestr [1] for running tests in parallel instead of the built in unittest test runner which just runs things serially. Right now a test job takes ~3 minutes to run all the tests serially. This can be sped up by running tests in parallel. In testing locally it's consistently taking between 70-80 secs with parallel execution. [1] https://stestr.readthedocs.io/en/latest/MANUAL.html * Group tests by class * Revert "Group tests by class" This did not provide any speed up so there's no need to do any grouping. Instead let the stestr scheduler individually split methods between workers since that gives it more flexability in the local execution case where there is historical timing data to inform scheduling decisions. This reverts commit d3e6834. * Add caching of stestr timing data This commit adds caching of the stestr timing data so that the scheduler can use that data to improve the test run times. The only catch is that we need to ensure that travis doesn't create a blank directory when loading from the cache because that will break the test execution.
The test_rb test case is the slowest test and is built by having nested loops to go over all the combinations of the number of qubits, rb pattern, and multiplier type. This results in 2 issues, first the test case is quite slow, but more importantly it's very difficult to debug. By running the same test code over and over again with different parameters it makes detecting a problem harder (especially when tests run in parallel) but also it makes reproducing a failure much more difficult because there is no way to run the test with just one set of input parameters. This commit addresses this by switching the test to use ddt instead. ddt will let us reuse the same test code from inside the loops but instead of doing it one giant test case it will construct separate smaller test cases for each input parameter combination. This leads to faster execution when running in parallel because the scheduler can split the test up over multiple workers. But also gives us a separate test case that can be rerun by itself when an error is encountered.
* add_docs_locally * add dev sphinx * rm ds * rm_ds
…mmunity#270) The missing binaries have been uploaded to pypi per: osqp/osqp#187 so we can remove the cap from ci and use the latest release. This reverts commit 0807d40.
…logging_issue_257
* * First draft of API for the abstract discriminator class. * * Added diclaimer to discriminator.py * Added class LinearDiscriminator that leverages scikit learn. * * Added calibration circuits and expected results as input to AbstractDiscriminator. * First implementation of linear._extract_data. * * Added a list of data circuits (i.e. circuits for which we do not know their outcome like for cal) to AbstractDiscriminator. * Added setter method for _fitted in AbstractDiscriminator. * Renamed LinearDiscriminator to LinearIQDiscriminator. * Implemented all methods in LinearIQDiscriminator required by AbstractDiscriminator. * * created folder measurement and move the discriminator related classes to it. * * deleted discriminator.py. * Modified the linear discriminator to inherit from BaseFitter. * * Added a skeleton for testing * * Made linear._calc_data() consistent with data structure. * Unit test test_iq_discriminator.py is now implemented. * Changed _excpected_state to a dict. * * Cleaned up code style in discriminator.py and unit tests. * Added a Jupyter notebook to exemplify the IQ discriminator. * * added .ipynb_checkpoints to .gitignore. * * Added quadratic discriminant analysis. * Generalized LinearIQDiscriminationFitter to IQDiscriminationFitter. * LinearIQDiscriminationFitter now inherits from IQDiscriminationFitter. * Disabled a pylint error in test_state_tomography.py. * Added scikit-learn>=0.17 to requirements. * * renamed linear.py to iq_discrimination.py. * * Added a filter for discrimination. * Added the method extract_xdata in BaseFitter. * Added the method extract_xdata in IQDiscriminationFitter. * extract_xdata retrives the xdata from a result in a format that the discriminator can use. * Added the filter to the unit test. * * Made small style changes to please pylint. * Move unit test for filter to case with self.qubits = [0, 1]. * * Renamed IQDiscriminationFitter to ScikitIQDiscriminationFitter and: - added docstrings. - removed description. It is now set by children classes. - changed circuit_names to schedules. - changed error message. * Added more info in filters.py docstring. * Moved the function that simulates IQ shots to utils and modified test_iq_discriminator. * * schedules is now an optional argument. Default is to use all results. * Changed _calc_data to handle schedules. * discriminator_parameters is now optional. * Added type hints to Linear and Quadratic dsicriminators. * * Adapted the unit tests to the new arguments ordering. * * Added the option to rescale the qubit IQ data. * Refactored the unit tests. * * Refactored the code so that the scaling parameters are calculated by a function. * * Added discriminate function to Discriminator. * * Switched sclaing in discriminator to the sklearn preprocessing scaler. * Added a tutorial notebook combining pulse and discriminator. * * Added the filter to the jupyter notebook. * Changes done in discriminator.filters.py - Modified docstring - Added method to convert discriminated results into counts. - Added base variable and get_base() method to allow users to specify qubit states beyond 0/1 such as 0,1,2 * Added unit tests for filters.py. * characterization.fitters.py made self.expected_state a property so that it can be accessed by the filter in to infere the base of the expected states. * Fixed test_iq_discriminator to match the changes above. * * Fixed style in ignis.utils.py * * Fixed style in Utils.py * * Small change in docstring. * * Added more details in the markdown of the notebook. * Added an example showing how to use the discriminate method of the discriminator. * * Moved utils.py to test folder. * * Added y_data into memory of the discriminated level 2 data. See filters.py line 85. * Added corresponding unit test that checks the length of the memory using get_memory. * * Changed method extract_xdata of ScikitIQDiscriminatorFitter to handle avg data. * Added corresponding unit test. * * Small refactor of extract_xdata to improve readability. * * Refactored _calc_data in discriminator to handle 'single' and 'avg' data. * Added function _add_ydata to avoid code duplication. * Refactored extract_xdata some more for readability. * * Implemented a BaseDiscriminator that is independent of BaseFitter. * Reverted BaseFitter back to its original state. * * Refactored the unit tests to the new Discriminator methodology. * Refactored filter.apply to comply with the new discriminator methodology. * Added fitted property and expected states to BaseDiscriminatorFitter. * * Renamed iq_discrimination.py to discriminators.py * * Made BaseDiscriminationFitter inherite from ABC. * * IDDiscrimnationFitter inherits from ABC. * Added a pass statement to get_ydata in base class. * Made Jupyter notebook compatible with new changes. * * Refactored docstrings, e.g. better description and type hints everywhere. * Implemented add_data in BaseDiscriminationFitter. * Implemented _add_expected_states and _get_schedules, class internal methods. * Added expected_sates and schedules as properties of BaseDiscriminator. * * Move the IQ discriminators to their own python file. * * Removed ABC from IQDiscriminationFitter. * Moved implementation of _scale_data to BaseDiscriminationFitter. * * Improved docstrings. * Add inits to test * * Added module docstrings. * Replaced state_labels with _ to get ride of linter errors. * Changed import order. * * Added class and method docstrings to test methods. * move the discriminator tutorial
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Details and comments