Commit Graph

56 Commits

Author SHA1 Message Date
Matthew Treinish 37036f494d Rewrite dag drawer to not use nxpd (#3280)
* Rewrite dag drawer to not use nxpd

The nxpd library is quite stale and hasn't seen an update in 3 years.
The most recent release of networkx 2.4 is incompatible with nxpd now
because nxpd was using deprecated (and now removed) api calls from
networkx. Additionally, the functionality provided by nxpd already
exists in networkx so there is no reason to rely on an additional
library outside of networkx and pydot. This commit updates the dag
drawer to no longer use nxpd and uses networkx's drawing features
instead.

* Cap networkx for python 3.5

In the networkx release notes for 2.4 [1] it states clearly that the 2.4
release is the last release with python 3.5 support. Since the release
timeline is not fixed and we may end up support python 3.5 in terra
longer than networkx this adds a capped version of networkx on 2.4 for
python 3.5.

[1] https://networkx.github.io/documentation/stable/release/release_2.4.html

* Adjust python 3.5 cap

Since networkx 2.4 is seemingly relying on the guaranteed insertion
ordering for dicts introduced in 3.6 for how we're using topological
sort this adjusts the cap previously introduced to be <2.4 instead of
<=2.4. This should avoid the failures related to this on python 3.5 and
networx 2.4.

* Avoid duplicate requirements with cap
2019-11-09 04:49:46 +00:00
Luciano 6745b1ecec
Parallel support for PassManager.run() (#3290)
* split!

* passes()

* max_iteration

* replace

* some RunningPassManager clean up

* callback support

* property_set result

* lint

* cleaning up runninpassmanager

* docstring

* args

* parallel

* test

* parallelize using dill

* dill in requirements.txt

* lint

* runningpassmanager style

* dill in setup

* fix the drawer with the new format from passes

* new refs

* Update qiskit/visualization/pass_manager_visualization.py

Co-Authored-By: Ali Javadi-Abhari <ajavadia@users.noreply.github.com>

* no label for linear

* refs

* _pass_sets

* pass set in a docstring

* lint

* different circuits

* circuit_or_circuits -> circuits
2019-10-28 14:29:23 -04:00
Diego M. Rodríguez 1db14a2016 Update marshmallow dependency to v3 (#3084)
* Remove silencing ChangedInMarshmallow3Warning

* Fix passing missing when required=True

* Handle unknown keys via unknown=INCLUDE

* Update ModelValidationError

* Update qiskit.validation.fields

* Add **kwargs to different functions
* Remove explicit strict parameter
* Update imports and other tweaks

* Remove load_additional_data from base

Remove the load_additional_data hook, as it is handled by the `unknown`
mechanism.

* Update kwargs for base

* Update dump and load expected return

* Updates and tweaks to fields

* Fix wrong `Mapping` import introduced in an eaerlier commit.
* Expand the `ByType` catching of unserializable/undeserializable fields
  as exceptions are no longer swallowed.
* Adjust to renamed `container` member.

* Use make_error instead of fail

* Wrap serialize errors into dict

During a field's `_serialize`, the exceptions raised did not contain
the nested structure that allows identifying the field. This commit
updates `InstructionParameter` so the message is nested.

* Use pre_load for qobj.type and qobj.schema_version

* Lint and kwargs fixes

* Bump marshmallow and marshmallow_polyfield version

* Revert extra import
2019-09-17 17:19:08 -04:00
Matthew Treinish e1fc918751
Remove jsonschema cap (#3037)
We have had the jsonschema version capped since it was introduced as a
requirement into terra. There is no clear reason for this and it limits
interoperability with other python packages. Especially because
jsonschema is commonly used library across the python ecosystem. The
version we were capping to was also quite old being release 2.5 years
ago. This commit removes the cap so that people can run terra in
environments where newer jsonschema is required.
2019-08-23 15:35:32 -04:00
Matthew Treinish 52110adad5 Make pylatexenc and pillow optional (#2451)
* Make pylatexenc and pillow optional

The pylatexenc and pillow requirements are only used in the latex and
latex_source circuit drawers. Since this isn't used by everyone and is a
non-default circuit drawer there is no reason we should force our users
to install these by default. This commit updates the requirements list
and setup.py to make these 2 requirements optional and included in the
visualization setuptools extras to ease installation. If the packages
are not installed it will raise an ImportError with a detailed exception
explaining how to install the missing dependency.

Fixes #2417

* Fix lint

* Fix lint again
2019-05-21 07:36:50 -04:00
Lev Bishop 1b4a6976b7 require scipy>=1.0 and go back to scipy.stats.unitary_group for random_unitary() (#2275) 2019-05-02 04:55:45 -04:00
Matthew Treinish d2e5281f59 Use pylatexenc utf8tolatex for gate names in latex drawer (#2246)
* Use pylatexenc utf8tolatex for gate names in latex drawer

When the latex drawer goes to draw custom gates they can be named and
valid unicode string. That's because the gate name attribute is a
string. However, latex doesn't know how to handle all utf8 characters
and requires escaping or custom libraries to render many of them.
Instead of trying to handle every edge case this commit uses the
pylatexenc lib (which is a MIT licensed lib with no additional
dependencies) which contains a mapping of all the unicode characters
with the latex equivalent. This means that things like '_' in custom
gate names will render properly now.

Partially Addresses #2235

* Fix lint
2019-05-01 18:20:00 -04:00
Jay Gambetta efe09ce7f7 Adding random unitary (#1857)
* Adding random unitary that does not use spicy

* Changhegog
2019-02-25 04:09:02 -05:00
Matthew Treinish 4f9034306d
Remove numpy max version cap (#1848)
* Remove numpy max version cap

The version cap was put in place to prevent a potential incompatibility
but removing doesn't seem to cause any issues. Having it in place on
terra will cause an issue with ignis which requires numpy>=1.16.0 to
work as expected. While they're both co-installable because pip doesn't
have a depedency solver this only works if ignis is installed second.
(as installing terra second pip will use it's requirements with the
version cap, instead of ignis which has already been installed). To
avoid any potential confusion just removing the version cap is easiest.

* Disable misbehaving pylint checks
2019-02-22 21:38:28 +00:00
Paul Nation 88a15d49ee
Terra no longer depends on requests (#1835)
* remove requests

* remove from setup
2019-02-19 19:15:43 -05:00
Diego M. Rodríguez a967fcd8e2 Remove travis documentation deploy, other fixes (#1678)
* Remove documentation deploy

Remove documentation script and travis job.

* Remove deploy stage from travis

Remove the "deploy doc and pypi" stage entirely, and revise the
"subclassing" of the osx jobs.

* Fix travis script make invocation

* Fix extra lint script commands

* Pin numpy version to <1.16

Pin the numpy version to <1.16 until the potential incompatibilities
are fixed.

* Remove numpy from whitelist, ignore random instead

Remove `numpy` from the `extension-pkg-whitelist`, and instead manually
ignore the check for the members of  `numpy.random`, as it was the
only place where the check was significant.
2019-01-14 07:03:54 -05:00
ewinston 02f3b1f917 bump marshmallow version requirement to 2.17.0 (#1652)
marshmallow.warnings used in qiskit/_util.py was introduced after 2.16.3.
2019-01-07 23:54:21 -05:00
Diego M. Rodríguez 8a01bcb7c7
Update setup.py from requirements (#1527)
* Update setup.py from requirements

Update `setup.py` following previous changes to `requirements.txt`:
* remove `matplotlib` (already in extras)
* move `nxpd` to extras
* move `ipywidgets` to extras
* bump `sympy` to 1.3+
* reorder

* Revise dependencies (ipywidgets 7.3, pydot)
2018-12-18 13:07:01 +01:00
Paul Nation 8a5b221880
Make nxpd optional (#1515)
* make nxpd optional

* add to dev

* updates

* add missing pydot requirement

* lint

* minor msg tweak
2018-12-16 10:32:44 -05:00
Ali Javadi-Abhari b9f33d2bea Refactor DAGCircuit and Unrollers (#1210)
* 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
2018-12-01 08:17:33 -05:00
Luciano fcdb2e150d runtime matplotlib import (#1281)
* 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
2018-11-17 09:09:16 -05:00
Diego M. Rodríguez 2067a18d43
Add auto-validated objects machinery (#1249)
* 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
2018-11-14 11:40:41 +01:00
Kevin Krsulich 233682dd77 Update networkx to 2.2 (#1265)
Fixes #1264
2018-11-13 13:37:03 -05:00
Diego M. Rodríguez 1b879e7177 Copy IBMQuantumExperience 2.0.4 into terra (#1198)
* 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
2018-11-06 20:55:54 +00:00
Diego M. Rodríguez c31dcdc924 Avoid consuming results during `.retrieve_job()` and `.jobs()` (#1082)
* 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.
2018-10-11 11:19:28 +02:00
Salvador de la Puente González 9c8f35eb4e
Adding DAG visualizer (#1059)
This PR introduces a graphical DAG visualizer to ease the task of debugging the transpilation procedure.
2018-10-09 09:35:49 +02:00
Paul Nation c1b40c4bc9 Remove mpl-3 restriction 2018-09-27 05:27:42 -04:00
Diego M. Rodriguez 6f93ff6071 Fix setup.py dependencies
Update `setup.py` with latest dependencies.
2018-09-21 09:46:52 +02:00
Salvador de la Puente González 4c743e9b7e Pinning to matplotlib < 3 to avoid incompatibility issues.
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.
2018-09-20 18:54:39 +02:00
Paul Nation c9c4ed5242
Parallel tools and compiling (#701)
* 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
2018-09-17 23:35:18 -04:00
Salvador de la Puente González c67f33629b Isolate legacy code.
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.
2018-09-14 18:37:30 +02:00
Erick Winston fcaf3d5649 Add support for QObject and pre-QObject formats.
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.
2018-09-14 10:49:57 +02:00
Paul Nation fc221f845b
Properly check if connection can be established for importing interactive visualizations (#892)
* check if has connection

* Removed requests and updated changelog
2018-09-13 11:16:02 -04:00
Matthew Treinish f4303a5d38 Switch to iplot_state by default if env supports it (#862)
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
2018-09-05 13:23:14 -04:00
Diego M. Rodríguez dea7aa7e1e Fix dependencies: add jsonschema, remove vcrpy (#853)
* Fix dependencies: jsonschema, vcrpy

* Add vcrpy to appveyor

* Remove jsonschema from appveyor
2018-09-03 18:37:20 +02:00
Luciano 97d24d1130 Save network interactions to allow tests to run offline by providing mocked responses (#697)
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
2018-08-20 20:42:23 +02:00
Salvador de la Puente González 34358bdbb6 Testing non commercial backends accepts cancellation. (#690)
* 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
2018-08-03 14:14:59 +02:00
Diego M. Rodríguez 8253cf4a98 Use get_status_job() in IBMQJob, bump 1.9.8 (#641)
* 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
2018-07-11 11:47:37 -04:00
Salvador de la Puente González ab54183620 Python3.7 compatibility (#620)
* 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
2018-07-05 23:09:14 +02:00
Diego M. Rodríguez a7984800fe Bump IBMQuantumExperience dependency to 1.9.6 (#600) 2018-06-28 16:59:31 +02:00
Paul Nation 532a7c311c spurious comma 2018-06-13 10:25:41 -04:00
Paul Nation cad289e7be Remove upper bound on dependencies 2018-06-13 10:21:15 -04:00
Diego M. Rodríguez 26a897d603 Bump api version to 1.9.2 (#558) 2018-06-11 12:24:06 +02:00
Paul Nation 5c1c68a5aa Bump upper limits on requirements packages to next minor release number (#509)
* Increase upper bounds on packages
2018-05-29 09:34:22 +02:00
Juan Gomez 72eae89453 CMake improvements! (#468)
* 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
2018-05-15 19:04:04 +02:00
Diego M. Rodriguez 2de3efa62c Bump IBMQuantumExperience version 2018-05-11 20:48:24 +02:00
Diego M. Rodríguez b6815da4f5 Bump IBMQuantumExperience dependency to 1.9 (#437) 2018-04-30 13:17:14 -04:00
Diego M. Rodriguez 3dbcd7bf20 Bump API version, fix check, _AssertNoLogsContext
* 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.
2018-03-19 15:03:39 +01:00
Juan Gomez cd1b1067de
Merge pull request #327 from diego-plan9/fix/api-version
Bump IBMQuantumExperience dependency version
2018-03-09 16:59:34 +01:00
Luciano ae7790c9b0 the compilation output should not depend on the Python version (#313)
* 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.
2018-03-09 16:38:20 +01:00
Diego M. Rodriguez 504f7e0308 Bump IBMQuantumExperience dependency version
Bump the required version of `IBMQuantumExperience` version, as it
includes a fix for the latest errors with hpc and ibmqx2 backends.
2018-03-09 14:53:21 +01:00
Diego M. Rodriguez de5a9415e8 Revise travis configuration, using cmake
* 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`.
2018-02-22 14:56:20 +01:00
Ali Javadi-Abhari c30110e208 Circuit image plotter (#295)
* 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
2018-02-19 10:59:47 +01:00
Luciano 3372a4d6fb Remove setuptools.setup mock (#286)
* tests for _util.py

* remove mock mess. KISS by reading the file directly.
2018-02-12 20:35:19 +01:00
Juan Gomez 87a995b2d8
Upgrade QISKit depdencies (#261)
* 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.
2018-01-22 15:17:31 +01:00