Commit Graph

80 Commits

Author SHA1 Message Date
Ali Javadi-Abhari 21a3424368 reorganize passes directory (#3621)
* reorganize passes directory

* release notes

Co-authored-by: Luciano Bello <luciano.bello@ibm.com>
2020-01-09 13:43:11 +00:00
prakashmurali 53e99fa4fe Crosstalk adaptive gate scheduling pass (#3532)
* Implementation of crosstalk adaptive scheduling

* Updated constructor params

* fixed lint issues

* fix test case bugs

* fixed lint issues

* updated setup.py requirements list with z3

* address review comments

* address review comments

* fixed parse_backend_properties

* Update qiskit/transpiler/passes/crosstalk_adaptive_schedule.py

Co-Authored-By: Kevin Krsulich <kevin@krsulich.net>

* computing descendants and ancestors once per gate

* fixed comments

Co-authored-by: Kevin Krsulich <kevin@krsulich.net>
Co-authored-by: Ali Javadi-Abhari <ajavadia@users.noreply.github.com>
2019-12-22 22:16:09 +00:00
Matthew Treinish f17f8f073e Add python 3.8 support and deprecate python 3.5 (#3268)
* Add python 3.8 support and deprecate python 3.5

This commit adds support for running terra under python 3.8. It does
this by adding the trove classifiers to the package metadata and adding
a test job for python 3.8 (only travis for now this can be expanded in
the future when azure pipelines adds it to their image). At the same
time this commit starts the deprecation window for python 3.5. Python
3.5 goes end of life by upstream python in Sept. 2020. We should give
our users running with python 3.5 (which is about 10% of our users based
on pypi data) fair notice that when upstream python stops supporting it
we do as well.

* Fix lint

* Add back empty cache detection

As part of the refactors the empty stestr timing cache removal code was
removed from the travis config, but the cache wasn't removed. Adding the
python 3.8 job causes a failure because travis has no cached timing data
but still creates the empty directory which triggers
mtreinish/stestr#266. This adds back the empty cache removal to
workaround it so we can use the timing data for scheduling in future
runs.

* Add azure-pipelines python 3.8 jobs too

* Fix python 3.8 dictionary keys changed error

Starting in python 3.8 a new RuntimeError is raised, RuntimeError:
dictionary keys changed during iteration. This is caused by modifying an
iterator while looping over it. We were doing that in the
optimize_swap_before_measure pass. This commit fixes this by wrapping
the iterator in list() to make a copy of it for looping. This way we
don't modify the contents of what we're iterating over in the pass.

* Revert "Add azure-pipelines python 3.8 jobs too"

The missing matplotlib wheels are blockers for windows and osx
environment. Since we do not have the necessary dependencies installed
in those ci envs to compile matplotlib from source. We'll rely on just
travis for 3.8 testing until the matplotlib 3.2.0 release is pushed so
we don't have to compile it.

This reverts commit 40157621b1.

* Add skip for failing matplotlib test

The image comparison tests which are quite flaky are failing with
matplotlib compiled on 3.8. Looking at the image output from these
failures are very subtle (looks like resolution differences) again
questioning the value of these tests. This commit just skips the test
that is failing here to unblock the PR.

* Add azure 3.8 test jobs

* Pin to pre-release mpl for python 3.8

* Add spawn guard for python3.8 osx in examples

When running examples with execute, transpile, or any other calls using
parallel_map() the new default for spawn instead of fork requires that
scripts have a __name__ == "__main__" check in them to function
properly. If not calls to parallel_map fail errors around the
bootstrapping phase. To avoid this in the ci jobs this commit adds the
necessary checks to the example scripts we run in ci as part of
test_examples.

* Remove cryptography pin from constraints file

We pinned the cryptography package version back during the cryptography
2.6 release which broke our ci. It was a temporary step to avoid a
packaging issue in CI that was blocking development. However, when the
issue was resolved we never circled back to fix the issue. Now trying to
enable python 3.8 support to terra cryptography >=2.8 is needed for
python 3.8 on windows (to get a precompiled binary). This commit removes
the unecessary pin to unblock windows 3.8 ci.

* Bump cibuildwheel version to build 3.8 wheels

cibuildwheel 1.0.0 was released in early November [1] and added support
for building python 3.8 wheels. This commit bumps the cibuildwheel
version we use in the wheel build jobs at release time to also build 3.8
wheels for upload to pypi.

* Add skip and release note about macos py38 issues

This commit adds a skip for the failing python 3.8 test on osx and
windows so that we don't block everything over a small issue in the
tests. It also add a release note documenting the limitation with python
3.8 on macos with regardess to parallel_map/multiprocessing. Since this
limitation is new for this release (being the first release with python
3.8 support) we should document it as a known issue in the release
notes, especially since it likely won't be resolved until a python 3.8.1
release.

* Revert "Add spawn guard for python3.8 osx in examples"

While we can fix the tests to work on osx python3.8 by adjusting the
example scripts to only call functions using parallel_map from inside a
block run via if __name__ == '__main__': this unecessarily changes the
scripts for the quirks of a single environment. This commit reverts the
example scripts back to their original form and instead just skips the
unittest that executes them on python 3.8 macOS. We already have
documented this limitation in the release notes. When/if we have an
alternative solution for how we launch additional processes in python
3.8 on macOS that does not require this workaround we can look at
removing the skip.

This reverts commit 76ae197631.

* Apply suggestions from code review

Co-Authored-By: Kevin Krsulich <kevin@krsulich.net>
2019-12-10 22:43:58 +02:00
Matthew Treinish c028aee79d Bump version string post release (#3589)
Now that qiskit-terra 0.11.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.
2019-12-10 07:44:52 -05:00
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
Matthew Treinish 4a6eb32337
Mostly remove sympy and deprecate sympy Instruction parameters (#3156)
* Remove sympy from everywhere

This commit removes all the sympy usage from qiskit-terra. Sympy is very
slow, not just to perform computations, but also to just import (being
the second slowest import in terra, only behind qiskit.version which
calls git and pip in a subprocess) and doesn't actually provide us any
real advantages inside terra. None of the expressions or calculations
terra is doing need to be done symbolically, and using sympy as just an
output formatter (to get pretty output for things like pi) is overkill.

* Fix lint

* Fixes from running openqasm conformance tests

* Import sympy lazily for circuit Parameters.

* Add back sympy to requirements

While sympy has been removed from most places in the repo as of this
point, it is still used internally in the Parameter and
ParameterExpansion classes. The imports there have been made runtime to
remove the import performance impact and they are self contained in
those classes as of this commit. We can remove sympy from the
requirements in the future when we come up with way to replace the
parameter classes' use of sympy we can remove it from the requirements
lists.

* Make type warning a deprecation warning

* Fix rebase issue (and unnecessary runtime import)

* Update instruction parameter type handling

This commit updates some issues found during code review with the
parameter handling. Now instead of casting string parameters as a float
incorrectly, this uses them to create a new symbolic parameter. Also for
numpy number types that are not caught by the earlier type checks item()
is called as was the previous behavior.

* Revert switch from Node.sym->Node.num()

For ast Node parameter types that were passed as parameters for an
instruction the method call to get the value was incorrectly changed
to num() from sym(), which doesn't exist. This was a sloppy regex find
replace that did it by accident. This commit reverts that mistake and
restores the functionality.

* Deprecate not remove sympy.basic and sympy.matrix params

This commit adds back support, albeit it deprecated form, for passing in
instruction parameters as sympy.basic and sympy.matrix objects. It also
updates the release notes to reflect this change.

* Add deprecation for sympy.Expr instruction param too

* Update release notes

* Remove sympy types usage from unit tests

This commit removes the usage of sympy types from unit tests. There were
several cases of unit tests that were using sympy's pi or similar
constants for no particular reason. Since this usage is now deprecated
it is better to remove this. The only sympy usage that remains in the
tests now are for test cases that are explicitly testing behavior with
sympy. These will remain until the sympy support has been removed since
we need to verify that the deprecated feature still works as is until
removal.

* Update release of deprecation to 0.11.0

* Update changed error exception class

* lint
2019-10-23 16:15:44 -04:00
Matthew Treinish 0727d60922 Bump version string post release (#3271)
Now that qiskit-terra 0.10.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.
2019-10-16 12:11:34 -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 d2b15b13e2
Bump version string post release (#3031)
Now that qiskit-terra 0.9.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.
2019-08-22 10:41:40 -04:00
James Weaver 5cea4605c5 Enhance appearance and correctness of Q-sphere visualization (Issue #2932) (#2933)
Enhance appearance and correctness of Q-sphere visualization in the following ways:

- All complementary basis states are antipodal
- Phase is indicated by color of line and marker on sphere's surface
- Probability is indicated by translucency of line and volume of marker on sphere's surface

There is one new required dependency, seaborn, for color palettes for associating colors to phases in the Q-sphere plot as well as its legend.

Fixes #2932

* Q-sphere plot enhancements. Note that requirement for seaborn module has been added.

* CHANGELOG update for Q-sphere plot enhancements (#2932)

* lint fixes

* add seaborn to visualization req

* remove seaborn from requirements

* add seaborn to dev req
2019-08-12 14:48:26 -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
Matthew Treinish 48b6792f1a
Add pyproject.toml to declare cython build requirement (#2278)
Right now when you try to build terra >=0.8.0 and you don't have Cython
installed it will fail. This is because we rely on cython being present
to build the stochastic swap code. While we have a setuptools
setup_requires defining this dependency it doesn't work because the
dependency on cython is needed before setuptools can resolve that for
us. PEP518 provides a solution for this problem by adding the concept of
a pyproject.toml file which can be used to outline build requirements
which are build time depdencies needed before the setup.py is run. With
this file present when you run:

pip install git+https://github.com/Qiskit/qiskit-terra

(or running on a local checkout)
and cython isn't installed pip will acquire it and use it for building
the sdist.
2019-05-13 22:13:38 -04:00
Matthew Treinish b2f112ca68
Cleanup setup.py (#2327)
The setup.py for terra has grown organically as we've added and removed
different functionality from the repo. This has led to some pieces in
there which were out of date, others which weren't actually used, or
some missing metadata. This commit goes through the code in the setup.py
and removes unused or things not needed anymore and updates some of the
metadata for when we push future releases to pypi.
2019-05-07 22:16:51 -04:00
Matthew Treinish a4d22dbe4a Bump version string post release (#2298)
Now that qiskit-terra 0.8.0 is out the door we should bump the version
string on master to show the source verrsion we're installing is newer
than what's been released.
2019-05-03 15:52:31 -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
Paul Nation 97cf677137
Copyrights (#2249)
* 2017 cps

* 2018 cps

* 2019 cps
2019-04-30 10:36:47 -04:00
Matthew Treinish 9fde3527ea Fix typo in setuptools extras declaration (#2100)
The name of the key is extras_require not extra_requires to declare
optional dependencies. [1] This commit corrects the typo so it works
correctly.

[1] https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies
2019-04-08 15:16:44 -05:00
Diego M. Rodríguez 75a6fee6de Remove underscore from tools and transpiler (#2095) 2019-04-08 12:09:12 +02:00
Paul Nation 171254d34c remove flag from win build (#1855) 2019-02-24 08:07:16 -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 623b00d098
1000x faster swap mapping and Cython build chain (#1789)
* Add Cython files.

* by error

* Modify swap mapper

* cleanup setup.py

* move cythonize to main setup.py

* fix style and add cython to requirements

* have travis build cython before testing

* disable lint checks that fail due to compiled code

* add cython to requirements (the txt one)

* revert to NumPy RandomState RNG for deterministic random generation

* remove unused import

* update tests

* make Cython build more portable

* move cython to dev requirements

* remove unused code

* turn on warnings, and fix old docstring

* fix import errors

* add cython build to appveyor

* add cython to appveyor

* revert aer changes

* fix "ground truth"

* this should not be here

* this should not be here

* this should not be here

* this should not be here

* this should not be here

* this should not be here

* I have no idea why they are saying they are modified

* Add Cython to setup_requires for setup.py

The setup_requires parameter to the setup() function is used to
specify packages that need to be present in order for the setup script
to run. [1] With the introduction of Cython to the setup.py this is now
required to be installed for setup, so this commit adds Cython to
setup_requires to indicate this.

[1] https://setuptools.readthedocs.io/en/latest/setuptools.html

* add to changelog

* Update Cython version in setup_requires
2019-02-21 13:58:06 -05: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
Matthew Treinish fe5f712c92 Clean up unused code in setup.py (#1670)
Since #1644 we've removed all the C++ code from the terra repository.
That commit updated the setup.py and build process to not assume we're
compiling code to build the simulators. However we missed a lot of
parameters imports and other code in the setup.py which are not needed
or don't apply anymore now that terra is just python code. This commit
cleans that all up so we minimize what we include in the setup.py.
2019-01-12 17:09:04 -05:00
Diego M. Rodríguez a3b08ad164
Update marshmallow version in setup.py (#1654) 2019-01-09 10:59:20 +01:00
Christopher J. Wood 4bf0db919f Remove legacy C++ simulator code (#1644)
* Remove legacy cpp code

* remove legacy cpp sim from make and travis

* Rename decorator and folder for aer provider tests

* remove Cpp simulator for setup.py

* fixup

* Remove all cmake and cleanup travis config

Since we're no longer building any C++ code there is no need to keep
cmake usage around anymore. This commit removes the last cmake remnants
and also cleans up the travis config to simply run make && make test to
install everything and then just invoke the test runner. It also
deduplicates jobs now that there is no distinction between no_compile
and compile jobs.

* Fix some small oversights

* Remove legacysimulator contributing doc section
2019-01-08 17:22:18 -05:00
Jay Gambetta b2bbb3f059 Remove legacy simulators (#1615)
* Removing simulators

* Fixing some test

* Fixing test

* Test

* Email

* Fixing test

* Passing locally

* Hack to get aer

* Diego fix

* Trying to fix windows errors

* Aer to basicaer

* Adding lint

* Removing test around and making aer only on one folder.

* Adding HACK FROM THE DEPTHS OF DESPAIR AS AER DOES NOT WORK ON MAC

* Oops Diego hack I did not implement correctly

* Linting

* do not import Aer at the top of tests

* lint

* two more CHANGELOG lines
2018-12-28 17:32:27 -05:00
Diego M. Rodriguez 21afb312bc Bump version to 0.8.0 2018-12-19 14:48:02 +01: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
Salvador de la Puente González accaebf6c0
Proposing a better name for Aer simulators (#1525) 2018-12-17 20:13:28 +01:00
Salvador de la Puente González 5dc716ea2f Trying to import Aer provider and adding the Aer element as a feature (#1492) 2018-12-14 09:06:35 -05:00
Matthew Treinish 27876a798f Add setuptools extras for installing matplotlib (#1304)
* Add setuptools extras for installing matplotlib

This commit adds a setuptools extras [1] entry for optionally installing
matplotlib. This enables users to just run:
'pip install qiskt[visualization]' and instlal qiskit and the
visualization dependencies in one command. Right now this is only
matplotlib, but it will likely also include nxpd too in the near future.

[1] https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies

* Add installation docs for new extras
2018-11-21 08:16:25 -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
Luciano a4331001f1 networkx 2.2 in setup and changelog (#1267)
* networkx2.2 in setup and changelog

* Update CHANGELOG.rst
2018-11-14 10:30:21 +01: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 cf5ea462a9
Updated changelog and making Qiskit installable again. (#1069) 2018-10-10 16:19:36 +02:00
Matthew Treinish 5a1879f378 Add the setup.py back (#1033)
Not having a setup.py causes all sorts of headaches for anyone trying to
use the package from source. Having cmake generate one is kind of absurd
when all it really does is add a version string. There are other ways to
do that (if the burden of updating a version string is too high) in an
automatic fashion (see pbr for an example that uses git tags to
autogenerate the version number). But for right now this just adds the
setup.py back so people will be able to install just the python code
easily, and use tools that expect a python repo to be installable on a
clean checkout without any additional steps.
2018-10-04 18:54:13 -04:00
Juan Gomez 7347fd1af4 [WIP] CMake integration (#274)
* CMake integration:
* Qiskit simulator now builds on/for Linux 64, Win64 and Darwin
* Added support for creating pip distributable packages (sdist
  and wheels) for Linux, Windows and MacOS
* Added support for testing and lintering via CMake
* Added Windows lib/dll dependencies for C++ simulator
* Added support for building when installing via Pip from source
  distribution, so non-supported platforms have a chance to build
  the C++ code

* Documentation updated, but still a WIP.

* Fix .rst formatting issues

* Restore qiskit-simulator latest changes

* Remove garbage file

* CMake integration:
* Added make "doc" target for Sphinx documentation
* Added both sdist and bdist_wheel distribution packages builds

* CMake integration:
* Setup.py.in now generates the correct platform tag for wheels
  distribution package

* CMake integration:
* 'make clean' target now removes all custom generated files and
  directories.
* Fxied 'make pypi_package' to not include binaries in the source
  distribution package (sdist)

* CMake integration: Addressing review comments
* Git-ignoring some autogenerated files
* Changed linter target name to "lint"
* Improved documentation

* CMake integration: Adressing review comments (2)
* Added qiskit/backends/qiskit_simulator to .gitignore
2018-02-05 15:42:10 +01:00
Juan Gomez da01470df0 Merge branch 'stable' 0.4.6 2018-01-22 15:32:11 +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
Juan Gomez 9989c47171 * Added support for Windows cpp simulator (#249)
* * Added support for Windows cpp simulator
* Bumped version to: 0.4.5

* * Bumped to version: 0.4.5 on qiskit/__init__.py too.

* Remove -static flag!!

* Making peace with my beloved linter.
2018-01-12 18:22:25 +01:00
Diego M. Rodriguez 4d95921a64 pip release: 0.4.4 2018-01-09 19:37:46 +01:00
Diego M. Rodríguez 5ecf64ca88 Revise dependencies, allow more recent versions (#238)
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.
2018-01-09 19:33:50 +01:00
Diego M. Rodríguez a068a6b4f9
Revise dependencies, allow more recent versions (#238)
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.
2018-01-09 19:29:59 +01:00
Juan Gomez 38c6e1d0c9 Bumper version to: 0.4.3 2018-01-08 18:05:39 +01:00
Juan Gomez a390883637 Bumping version to the next release: 0.5.0 2018-01-08 15:14:19 +01:00