Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

DOCplex has removed one_letter_symbol() from VarType causing problems in Aqua optimization module #1420

Merged
merged 4 commits into from
Nov 9, 2020

Conversation

adekusar-drl
Copy link
Contributor

@adekusar-drl adekusar-drl commented Nov 9, 2020

Summary

This PR fixes #1419

Details and comments

The latest release of DOCplex does not have one_letter_symbol method which is referenced in the Aqua code.
So now this is replaced with an explicit type check via isinstance.

@manoelmarques
Copy link
Collaborator

manoelmarques commented Nov 9, 2020

Does the property cplex_typecode exist for older docplex ? do we need to change requirements.txt and setup.py to add docplex>=2.16.196 ?

@adekusar-drl
Copy link
Contributor Author

@manoelmarques I have not verified all versions, but this property exists in the version where one_letter_symbol also exists. So, should be fine.

@woodsp-ibm woodsp-ibm added Changelog: Bugfix Include in the Fixed section of the changelog stable backport potential The bug might be minimal and/or import enough to be port to stable labels Nov 9, 2020
@adekusar-drl adekusar-drl requested a review from pbark as a code owner November 9, 2020 17:15
@adekusar-drl
Copy link
Contributor Author

adekusar-drl commented Nov 9, 2020

@manoelmarques I decided to replace cplex_typecode with an explicit type check, should be safer.

woodsp-ibm
woodsp-ibm previously approved these changes Nov 9, 2020
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request Nov 9, 2020
The recent new release of docplex has broken the released version of
aqua. There is a fix in aqua in-progress qiskit-community/qiskit-aqua#1420, but
until that is included in a release we won't be able to use the latest
version of docplex in the tutorials CI job. This commit adds a pin on
the version of docplex used in the constraints file to always use a
known working version to unblock CI.
mtreinish added a commit to Qiskit/qiskit-metapackage that referenced this pull request Nov 9, 2020
* Pin docplex version in CI

The latest docplex version which was released recently breaks the aqua
quadratic_program module. This commit pins the docplex version to
unblock CI, while we wait for the in-progress aqua PR
qiskit-community/qiskit-aqua#1420 fixing this to be included in a release.
 
* Use constraints in tutorials job too
@manoelmarques manoelmarques merged commit 172866f into qiskit-community:master Nov 9, 2020
mtreinish added a commit to Qiskit/qiskit that referenced this pull request Nov 9, 2020
* Pin docplex version in constraints.txt for tutorials CI job

The recent new release of docplex has broken the released version of
aqua. There is a fix in aqua in-progress qiskit-community/qiskit-aqua#1420, but
until that is included in a release we won't be able to use the latest
version of docplex in the tutorials CI job. This commit adds a pin on
the version of docplex used in the constraints file to always use a
known working version to unblock CI.

* Remove windows pip cache

The windows CI images seem to have been updated and now the pip cache
step can't find the local pip cache to upload to azure. To unblock CI
this commit just removes the windows caching from CI. It will add some
execute time, but that's still better than not working.
manoelmarques pushed a commit to manoelmarques/qiskit-aqua that referenced this pull request Nov 9, 2020
… in Aqua optimization module (qiskit-community#1420)

* fix

* better fix

* added reno

* fix lint
mergify bot pushed a commit to Qiskit/qiskit that referenced this pull request Nov 10, 2020
* Pin docplex version in constraints.txt for tutorials CI job

The recent new release of docplex has broken the released version of
aqua. There is a fix in aqua in-progress qiskit-community/qiskit-aqua#1420, but
until that is included in a release we won't be able to use the latest
version of docplex in the tutorials CI job. This commit adds a pin on
the version of docplex used in the constraints file to always use a
known working version to unblock CI.

* Remove windows pip cache

The windows CI images seem to have been updated and now the pip cache
step can't find the local pip cache to upload to azure. To unblock CI
this commit just removes the windows caching from CI. It will add some
execute time, but that's still better than not working.

(cherry picked from commit 2d3df51)
mergify bot added a commit to Qiskit/qiskit that referenced this pull request Nov 10, 2020
…5369)

* Pin docplex version in constraints.txt for tutorials CI job

The recent new release of docplex has broken the released version of
aqua. There is a fix in aqua in-progress qiskit-community/qiskit-aqua#1420, but
until that is included in a release we won't be able to use the latest
version of docplex in the tutorials CI job. This commit adds a pin on
the version of docplex used in the constraints file to always use a
known working version to unblock CI.

* Remove windows pip cache

The windows CI images seem to have been updated and now the pip cache
step can't find the local pip cache to upload to azure. To unblock CI
this commit just removes the windows caching from CI. It will add some
execute time, but that's still better than not working.

(cherry picked from commit 2d3df51)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
mtreinish added a commit to mtreinish/qiskit-tutorial that referenced this pull request Nov 11, 2020
The recent new release of docplex has broken the released version of
aqua. There is a fix in aqua qiskit-community/qiskit-aqua#1420 which was released
in 0.8.1, but this hasn't been included in a metapackage release yet as
we're waiting for bugfix releases from all the other elements in the
next couple of days. Until that is included in a metapackage release we
won't be able to use the latest version of docplex in the CI job. This
commit adds a pin on the version of docplex used in a constraints file
to always use a known working version to unblock CI.
mtreinish added a commit to Qiskit/qiskit-tutorials that referenced this pull request Nov 11, 2020
The recent new release of docplex has broken the released version of
aqua. There is a fix in aqua qiskit-community/qiskit-aqua#1420 which was released
in 0.8.1, but this hasn't been included in a metapackage release yet as
we're waiting for bugfix releases from all the other elements in the
next couple of days. Until that is included in a metapackage release we
won't be able to use the latest version of docplex in the CI job. This
commit adds a pin on the version of docplex used in a constraints file
to always use a known working version to unblock CI.
@adekusar-drl adekusar-drl deleted the docplex_fix branch November 12, 2020 14:01
manoelmarques pushed a commit to qiskit-community/qiskit-optimization that referenced this pull request Jan 14, 2021
… in Aqua optimization module (qiskit-community/qiskit-aqua#1420)

* fix

* better fix

* added reno

* fix lint
nonhermitian added a commit to Qiskit/qiskit-tutorials that referenced this pull request Mar 1, 2021
* Fixed issue 1034 by correcting the typo

* Fixed issue 1065 by correcting the typo

* Add new line for list to be rendered properly

The two lists are not being rendered as lists so we add an extra newline for it to behave properly.

* Fix Aer tutorials (#1074)

* fixed setting of initial unitary

* fixed build noise model tutorial

* fixed tutorial applying noise to custom gate

* fixed extended stabilizer tutorial

* fixed the MPS tutorial

* Bopes tutorial fix (#1069)

* fix in bopes sampler tutorial

* kernel renaming for CI

Co-authored-by: Paul Nation <nonhermitian@gmail.com>

* fix qgans (#1071)

* fix qgans

* fix qgan code

* Pin docplex version in constraints.txt for CI job (#1082)

The recent new release of docplex has broken the released version of
aqua. There is a fix in aqua qiskit-community/qiskit-aqua#1420 which was released
in 0.8.1, but this hasn't been included in a metapackage release yet as
we're waiting for bugfix releases from all the other elements in the
next couple of days. Until that is included in a metapackage release we
won't be able to use the latest version of docplex in the CI job. This
commit adds a pin on the version of docplex used in a constraints file
to always use a known working version to unblock CI.

* Fix incorrect fidelity calculations in tomography tutorial (#1072)

* Fix tomography tutorial

* Remove noisy GST example

The old example can't use process fidelity function because it is comparing two noisy channels. My attempt to update using diamond norm distance instead cant be run in CI due to CVXPY solver not working without BLAS or CVXOPT.

* Remove header

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* updated device noise model tutorial (#1080)

Co-authored-by: Paul Nation <nonhermitian@gmail.com>

* Add seed to quantum_instance (#1081)

Co-authored-by: Paul Nation <nonhermitian@gmail.com>

* Remove legacy tutorials (#1085)

* Combine advanced circuits and pulse (#1086)

* Combine advanced circuits and pulse

* remove pulse from toc

* fix numbering for proper globing

* All Qiskit projects point to main CoC (#1088)

* remove unused variables (#1089)

* Fixes minor typo in the electronic structure  chemsitry tutorial

* Bump cell timeout in sphinx config (#1091)

* Bump cell timeout in sphinx config

The 07_asian_barrier_spread_pricing tutorial is quite slow and often
times out in CI because running the simulation takes very close to 3
minutes in the fastest case. But, the performance of the CI nodes is
quite variable since they run on virtual machines in azure's public
cloud. So many jobs fail randomly because of timeouts on that notebook.
This commit attempts to fix this by bumping the timeout 60 seconds which
hopefully will give us enough slack time in the job to handle slow CI
nodes.

* Make cell timeout an env var

* Add missing int cast for QISKIT_CELL_TIMEOUT (#1092)

In #1091 we added a new env var to enable downstream CI to adjust the
per cell timeout to make things more reliable in variable performance
environments. But in that PR we neglected to cast the value of the env
var, which is always a string, to an int. This commit fixes that
oversight so the new env var is actually usable.

* Algorithm and machine learning tutorials (#1087)

* Add algorithm and ml tutorials for Aqua

* Number qgan and add advanced vqe

* Fix notebook link

* Change IBMQ to mock simulator

* Add folders to index.rst

* Fix warnings in grover notebook

Co-authored-by: Manoel Marques <manoel.marques@ibm.com>
Co-authored-by: Paul Nation <nonhermitian@gmail.com>

* Remove deprecated DAGCircuit method usage. (#1093)

* Fix typo (#1095)

### Summary
Fix issue #1095 

### Details and comments
Delete the wrong and meaningless part of the sentence ". which it has to do the same thing".

* Add external collaborator (#1094)

* Fixed some typos on 04_vqe_advanced.ipynb

* Delete 05_getting_started_with_pulse.ipynb

* Add files via upload

* Delete 05_getting_started_with_pulse.ipynb

* Add files via upload

* Delete 05_getting_started_with_pulse.ipynb

* Add files via upload

* Fixed a typo on 04_vqe_advanced.ipynb

* algorithms: fix typo on grover jupyter notebook

* Migrate pulse_lib to library (#1107)

* Fixed all the broken links in "05_getting_started_with_pulse.ipynb." (#1102)

* Delete 05_getting_started_with_pulse.ipynb

* Add files via upload

* Delete 05_getting_started_with_pulse.ipynb

* Add files via upload

* Delete 05_getting_started_with_pulse.ipynb

* Add files via upload

Co-authored-by: Paul Nation <nonhermitian@gmail.com>

* Delete 06_building_pulse_instructions.ipynb

* Add files via upload

* Delete 07_building_pulse_schedules.ipynb

* Add files via upload

* Delete 07_building_pulse_schedules.ipynb

* Add files via upload

* Delete 08_adding_measurements.ipynb

* Add files via upload

* Delete 09_gathering_system_information.ipynb

* Add files via upload

* Delete 01_algorithms_introduction.ipynb

* Fixed Some Broken Links in this tutorial

* Delete 03_vqe_simulation_with_noise.ipynb

* Fix some Old Links in this tutorials

* Delete 7_examples_vehicle_routing.ipynb

* Fixed some old links

* Fixed some old links

* Delete docs which are not as useful anymore

* Reindex and rename files

* Add new page about pulse gates

* Modify existing files

* Add note about openpulse being enabled for pulse gates

* Add note about scheduling

* Add Aqua operators tutorial (#1068)

* Add Aqua operators tutorial

* Make corrections and changes in PR review
	modified:   tutorials/operators/01_operator_flow.ipynb

* Add table of contents

* Remove duplicate H1 header

Co-authored-by: Paul Nation <nonhermitian@gmail.com>

* Deleting file uploading new one

* Uploaded the file with a added extra link.

* Corrected Link

* Run pulse gates on 0.16.2

* Execute on terra version 0.16.2

* Update 02_portfolio_diversification.ipynb

* Update 02_portfolio_diversification.ipynb

* Update 02_portfolio_diversification.ipynb

* Delete 08_fixed_income_pricing.ipynb

* Update file with a working link

* Delete 08_fixed_income_pricing.ipynb

* Add files via upload

* Delete 08_fixed_income_pricing.ipynb

* With Updated Qiskit version

* Delete 10_qgan_option_pricing.ipynb

* Updated Few Links

* Pin cvxpy in CI (#1127)

* Pin cvxpy in CI

The latest release of cvxpy is causing job failures because of how they
changed their numpy requirement. This commit unblocks CI by just capping
the version installed in CI to just exclude the latest version.

* Pin numpy too

* Add operators to docs structure (#1126)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Remove numpy cap from tutorials job (#1139)

Co-authored-by: Tanya Garg <tanyagarg1701@gmail.com>
Co-authored-by: Peter J <peter.j@kakao.com>
Co-authored-by: Azeem Bande-Ali <A.BandeAli@gmail.com>
Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com>
Co-authored-by: Panagiotis Barkoutsos <bpa@zurich.ibm.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com>
Co-authored-by: Maureen McElaney <mmcelaney@users.noreply.github.com>
Co-authored-by: ewinston <ewinston@us.ibm.com>
Co-authored-by: danchepkwony <dan.k.chepkwony@gmail.com>
Co-authored-by: Dan Chepkwony <67590846+danchepkwony@users.noreply.github.com>
Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com>
Co-authored-by: Shota Nakasuji <schulta.8715@gmail.com>
Co-authored-by: Dongsin Kim <ds.justin.kim@gmail.com>
Co-authored-by: Divyanshu Singh <55018955+divshacker@users.noreply.github.com>
Co-authored-by: Luís Ferreira <lsferreira169@gmail.com>
Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com>
Co-authored-by: SooluThomas <soolu.elto@gmail.com>
Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Changelog: Bugfix Include in the Fixed section of the changelog stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tutorial failure likely due to new docplex
3 participants