* apply_operation_back/front take the op object
* remove wire_type and index input/output_map over objects
* restore qargs/cargs fields to op nodes
* define wire as (Register,int) object
* remove unused concept of precision in unrollers and dag
* add more dag tests. new function get_op_nodes
* factor out tests into setUp
* update unrollers
* simplify dagunroller and dagbackend
* decomposition rules in gate definitions as list of DAGs
* fix cyclic import by moving visualization import inside circuit.draw()
* recursive unrolling until hitting basis
* adding more mini dags to standard gates
* fix unroll AST to DAG
* update test_unroller.py
* convert load qasm to go qasm, ast, dag, circuit.
* remove unrollers _circuitbackend and _printerbackend
* instruction.param are qasm.node objects. convert to real or sym at your will.
* tweaks to jsonbackend and dagbackend
* return register objects in visualization.utils.get_instructions.
visualizers get param from node['op'].param now.
* Instruction param as sympy objects
* unify generation of json for all instructions, including basics
* update aer tests to not use unrollers, add simulator extensions as dag
basis
* clean decomposition rules per gate
* snapshot label/slot must be string. clarify allowed instruction param formats
* style and lint
* make all node names str.
* update mapper to new dag
* docstring
* lint
* broken test/python/aer/test_statevector_simulator.py
* lint
* bug
* fix bug in constructing DAG from AST node with conditional
* fix get_instructions test
* tests
* test_dagcircuit.TestDagRegisters.test_add_qreg_creg had empty assert
* get_qubits
* fix accessing None conditions
* fixing backend configuration to new diego style
* test dag equality not qasm equality
* fixes#1235 by @1ucian0
* use bin_to_hex_keys in qasm simulator py test
* update swap mapper to work with new dag
* ground truth in test.python.circuit.test_circuit_load_from_qasm.LoadFromQasmTest
* import errors
* test_qasm_file
* update check on qargs
* binding mistake
* some variation in the test
* fix serializing QuantumRegister for c++ sim
* op.qargs -> qargs
* test.python.test_mapper.TestMapper.test_yzy_zyz_cases
* fix some mapper tests. json backend gets qarg from node['qarg'] not op.qarg
* keep layouts in old format in transpiler. convert to (reg, int) in mapper
* check_map
* lint
* run a slow test with cpp simulator
* typo
* test.python.test_mapper_coupling
* temporarily skip two tests due to wire fragment bug in mapper
* test_circuit_operations.py
* test_dag_to_dag_expand_gates_default_basis
* test_from_ast_to_dag
* test_qobj_2_circuits
* style in qiskit/
* style in test/
* docstrings in DAGCircuit
* circuit equivalence
* dag comparison
* pass correct conditional in apply_operation_back
* re-remove get_qasm_snapshot test
* lint
* CHANGELOG. update sympy requirement.
* replace one more qasm comparison with circuit comparison
* readjust the tests
* linting
* no skip in test_visualization
* a deeper catch
* simpler
* test_qcvv_fitters does not depend on matplotlib
* matplotlib from requirements to requirements-dev
* style
* linting
* Add skeleton models and schemas in qiskit.models
Add `qiskit.models`, with the basis for defining objects (models) that
are used for interfacing with terra and formally defined in the specs
(schema). The classes in `base` are meant to be subclasses for each
entity - an example is included in `backend_status`.
* Update requirements
* Add tests for qiskit.models
* Adding validator decorator and moving to Marshmallow 2 (#7)
* Adding validator decorator and moving to Marshmallow 2
* Adding docstrings
* Documenting returns
* Feature/polyfields (#8)
* Moving validation infrastructure to qiskit.validation
* Providing a PolyField basic implementation
* The decorators raises when trying to bind the same schema twice.
* Better PolyField building blocks
* Move fields to own file, tweak and document
Move the Fields related code to `qiskit.validation.fields`, for clarity.
Update `BasePolyField` and `TryFrom` with tweaks to match the expected
functionality, linter and add documentation. Add tests, reorganizing
them slightly into TestCases.
* Revise validation documentation
* Add ByAttribute polymorphic field, fixes
Add the `ByAttribute` polymorphic field, allowing to chose an schema
based on the presence of an attribute. Fix the `to_dict_selector`s in
order to use inspection on the Models directly. Add tests.
* Remove BackendStatusSchema
Remove the `BackendStatusSchema` implementation, in order to introduce
it in future PRs along with its usage.
* Allow for top-level validation in instantiation (#9)
* Allow for top-level validation in instantiation
Update the instantation of a `Model` from kwargs in order to perform
a validation of the regular, top-level fields but not full validation
of the compound fields via a `schemalite` attribute.
* Update top-level validation during instantiation
Fix top-level validation during instantiation, making it take into
account other types of fields. Update tests and style and naming
tweaks.
* Rename test_models to test_validation
For consistency with the module name `qiskit.validation`.
* Updates to validation.base from review
* Copy IBMQuantumExperience 2.0.4 into ibmq
Copy the `IBMQuantumExperience` files (version 2.0.4, 2ab2401) into
the `qiskit.backends.ibmq.api` package. The credit for the code is for
@pacomf with the help of contributors in the original repository [1].
[1] https://github.com/Qiskit/qiskit-api-py
* Lint and style fixes for IBMQuantumExperience
* Linter warnings for IBMQuantumExperience
Less trivial fixes for linter warnings:
* simplify run_experiment return logic
* add `requests.codes.ok` to list of generated members, as they are
populated dynamically
* disable a spurious urllib3 import
* Rename IBMQuantumExperience to IBMQConnector
* Replace IBMQuantumExperience usages
Replace the usages of `IBMQuantumExperience` with usages of
`qiskit.backends.ibmq.api.IBMQConnector`, updating docstrings and
text in the process.
Update the dependencies accordingly.
* Remove functions from qiskit._util
Remove or move several functions from `qiskit._util`:
* remove `_check_ibmqx_version`, as it has been rendered obsolete
* move `_dict_merge` to qiskit.backends.ibmq
* remove `_parse_ibmq_credentials`, as it was unused
* Add IBMQConnector tests
Add tests for IBMQConnector, copying them from the original repository
and adjusting for style and conformance to Terra testing structure.
Original work by @pacomf and contributors at qiskit-api-py.
* Disable api.run_experiment tests
Disable the tests related to api.run_experiment(), as the function is
not used in terra.
* Remove test_util
* Update CHANGELOG
* Replace API calls with lightweight status calls
In `IBMQJob`, replace the calls for listing jobs and retrieving a
previous job with the new endpoints that provide enough info for
recreating a `Job` based on them. The side effect is that the results
are not consumed until `job.result()` is called.
* Use API status in IBMQJob constructor
Allow passing the API status field to the IBMQJob constructor in order
to avoid extra API calls when constructing an already sent job.
New matplotlib 3.0 version breaks backwards compatibility by raising
an ImportError when Python is not installed as a framework in MacOS X.
This PR pins Matplotlib to versions under 3.0 since it is the fastest
way to ensure we are not introducing breaking changes in visualization
tools given the proximity of the new release.
* Parallel tools and compiling
* add blank line
* Add parallel compile test
- Also try to work around lint and optional imports
* disable import-error for optional import
* fix indent
* Major update wiht magics
* fix compile lint
* fix style
* disable import errors
* white space
* Add compile with TextProgressBar test
* Remove jupyter components
* shorten parallel test time
* Minimize the parallel routines
* cleanup merge
* updates
* more updates
* fix comtypes issue
* add comtypes
* make comtypes requirement on windows
* update changelog
* review updates
* more updates
* remove callback function
* fix conflict
* Add progressbars back
* fix lint errors
* better grabbing of progress bars
* grab bars in order created
* Make jupyter tools availabel by default
* fix circular import
* switch used order
* fix move lint disable
* fix signature
* fix changelog and releases
* revert erroneous changes from git history
* revert one more
* add back psutil requirement
* remove high-level imports
* refine changelog
* move everything to transpiler folder
This PR factor out the decisions about when to use the new implementation
for Qobj-based jobs (IBMQJob) or the previous one (IBMQJobPreQobj) and a
bungh of module-level functions.
For distinguishing between jobs sent using Qobj or the old format, the
backend team included a `kind: "q-object" field in the job response.
After conversations with the backend team, it is assumed that all the
backends should answer with the new QobjResult format if the job was a
Qobj-based job and with the previous format if the job was using the old
format.
The PR also extends `from_dict` capabilities to cast numpy types to Python
types.
This PR modify IBMQ backends to create QObject or pre-QObjects jobs.
It also consider scenarios when a mixture between new and old jobs can be
retrieved. For instance and during the transition when asking for past jobs.
New jobs are a subtype of `IBMQJob` named `IBMQJobPreQobj` and it's intended
to be deprecated.
This commit switches the default graphing method to use the interactive
plot_state method if the environment conditions support it. There are 2
conditions when iplot_state can be used, the first is that things are
running inside jupyter, the second is that the environment has an
internet connection and can reach the js source needed for the
visualization. This will verify these 2 conditions by checking if the
ipykernel module is present and they trying to do an HTTP GET on
the url where the page is hosted to verify the plot function can do the
same.
The requests library is used directly to perform the HTTP GET call so it
is added to the requirements.txt file in this commit. However this was
already an implicit requirement for qiskit-terra because it's what the
IBMQuantumExperience package uses for its HTTP client. This only adds it
to the requirements file because it is now directly called.
Fixes#806
The current commit introduces several changes to the testing infrastructure.
First, it provides a way of running IBM-Q tests against pre-recorded responses. The software in charge of recording and mocking-up the responses is VCRPy[1] and it is configured and used in `test/common.py`. Cassettes can be updated by using `make test_recording`.
[1] https://github.com/kevin1024/vcrpy
The commit also includes the latest responses (under `tests/casettes`) for a successful test run but a default execution with `make test` will only use them if no IBM-Q credentials are found. To force a run against mocked responses, use `make test_mock`.
Finally, the commit also unifies the several test options in a unique environmental variable called `QISKIT_TESTS` (in `tests/python/_test_options.py`). These are the main equivalences but the set of options is described in the developer introduction [2]:
- `SKIP_SLOW_TESTS=False` is now achieved by `QISKIT_TESTS=run_slow`
- `SKIP_ONLINE_TESTS=1` is now achieved by `QISKIT_TESTS=skip_online`
[2] https://github.com/Qiskit/qiskit-terra/blob/master/doc/dev_introduction.rst#testing-options
* Testing non commercial backends accepts cancellation.
* Passing linter
* Marking test_cancel of ibmqjobs as slow
* Factoring out job tests-specific methods.
* Adding changelog modification
* Increasing timeout
* Distinguishing backend in case the tests are passed with IBM-Q credentials
* Use get_status_job() in IBMQJob, bump 1.9.8
Use the recently included `api.get_status_job()` for checking the
status of an online job, as it is more performant than the existing
`api.get_job()`. Bump IBMQuantumExperience dependency.
* Update changelog
* Adding Python 3.7 to the Travis Matrix for Linux and OSX.
Waiting for Appveyor to support Python 3.7 natively before adding it to the matrix.
* Used pyenv and venvwrapper for both OSX stages.
* Update OSX Python 3.7 stage key
* CMake improvements:
* Static linking is not the default anymore.
* Platform Wheel Tag is now configurable via cmake variable.
* Updated documentation
* CI config file updated accordingly
* Added support for Win64 builds on Visual Studio 2017
* Windows C++ Simulator now links with a prebuilt version of
OpenBLAS (64 bits), so there's no need to link against
LAPACK anymore
* cmake added as a dependency
* Restored --static-libgcc flag for static MacOS builds so gcc
can create *semi* static executables again. Clang doesn't have
static compilation.
* Remove default WHEEL_TAG value so if not specified, the tag is
choosen by the wheel module
* Bump `IBMQuantumExperience` dependency to 1.8.29, as it fixes a bug
and will be required by the next sdk release.
* Fix the `_check_ibmqe_version()`, as after #286 there where cases
where the `requirement.txt` file was not present, resulting in the
wrong warning. Now uses a simple approach: the check is only performed
if installed via pip, assuming in the rest of the cases the user is
responsible for updating the dependencies (ie. `pip install -U`).
* Revise `_AssertNoLogsContext` in order to produce more informative
failure messages.
* removing ambiguities that created different compilation results in different python versions
* linting
* Bump networkx to >=2.0 in setup.py
* Fix results and bug for test_run_async_stress
Fix the values expected by the test_run_async_stress test in order to
match the ones produced with networkx 2.0.
Fix a bug re-raising the exception when that test fails, and a linter
issue from a previous PR.
* Revise the travis configuration for using `cmake` for the several
targets, and use "stages" instead of parallel jobs:
* define three stages that are executed if the previous one suceeds:
1. "linter and pure python test": executes the linter and a test
without compiling the binaries, with the idea of providing quick
feedback for PRs.
2. "test": launch the test, including the compilation of binaries,
under GNU/Linux Python 3.6 and 3.6; and osx Python 3.6.
3. "deploy doc and pypi": for the stable branch, deploy the docs
to the landing page, and when using a specific commit message,
build the GNU/Linux and osx wheels, uploading them to test.pypi.
* use yaml anchors and definitions to avoid repeating code (and
working around travis limitations).
* Modify the `cmake``configuration to accomodate the stages flow:
* allow conditional creation of compilation and QA targets, mainly
for saving some time in some jobs.
* move the tests to `cmake/tests.cmake`.
* Update the tests:
* add a `requires_qe_access` decorator that retrieves QE_TOKEN and
QE_URL and appends them to the parameters in an unified manner.
* add an environment variable `SKIP_ONLINE_TESTS` that allows to
skip the tests that need network access.
* replace `TRAVIS_FORK_PULL_REQUEST` with the previous two
mechanisms, adding support for AppVeyor as well.
* fix a problem with matplotlib under osx headless, effectively
skipping `test_visualization.py` during the travis osx jobs.
* Move Sphinx to `requirements-dev.txt`.
* one more initializer test case
* updating version requirement for IBMQuantumExperience
* fixing per diego's comments
* circuit_drawer() visualization.py, generating PIL images
* adding circuit drawing function and embedded example in initialize
* added test
* linting
* more linting
* better exception handling in case dependencies not installed.
* fixing circuit drawing tests
* more linting-_-
* fixing per diego's comments
* lint
* improved exception handling for dependencies pillow, poppler, pdflatex, qcircuit
* adding id to drawing basis default
* Fix typo in setup.py.in
* Bumped to version: 0.4.6
* Upgraded external dependencies
* Make graph code in QISKit compatible with NetworkX 2.0
NetworkX 1.11 which is required by qiskit uses some deprecated
functions for plotting that generate a warning with matplotlib. The
proposed changes make QISKit compatible with both versions of NetworkX.
In a second step we should upgrade the code to use only NetworkX 2.0
and later since some functions were added that make things more
elegant. See
https://networkx.github.io/documentation/stable/release/migration_guide_from_1.x_to_2.0.html
* Reintroduce AppVeyor (#252)
Re-enable the AppVeyor CI, as the conflicts with the version were
hopefully solved after bumping the scipy dependency and others.
Revise the dependencies in order to:
* drop `requests`, as it is not needed directly by the SDK
* for several packages, test that the most recent *major* versions of
them work with QISKit, and adjust the comparators accordingly.
* fix a test that was failing due to the precision.
Update QuantumProgram.set_api() and add a new set_api_hubs_config()
method for being able to pass hub, group and project parameters to the
API, and modify it.
* Add runtime check for IBMQuantumExperience version
Add `qiskit._util._check_ibmqe_version()` (invoked on the main import)
for emitting a warning if the installed version of IBMQuantumExperience
does not match the version defined on `setup.py`.
* Rename requires.txt and requires-dev.txt
Rename to "requirements.txt" and "requirements-dev.txt", in order to
conform better to the de-facto practices.
Update the requirements to match the versions specified in setup.py.
* setup.py: OS classifiers, backend, IBMQE version
* Explicitly require IBMQuantumExperience>=1.8.13, as older versions
might not contain all the functionality needed.
* Include "qiskit.backends" as a package instead of "qiskit.simulators".
* Add trove classifiers for the operative systems supported.
* Fix PEP8 warnings for long description.
* Avoid using __version__ in setup.py due to imports
Revert the change of using "__version__" imported from "__init__.py"
directly on "setup.py", as the current importing of the modules from
"__init__.py" causes the building to fail due to the dependencies not
being available at the time of invocation.