Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip: initial move * fix a bug when no coupling_map is supplied * Improved documentation and parameter settings * Improved logical/physical qubit mapping * Better handling of measurements and final layout * minor fixes * add unit tests * wip: start refactoring * improve layout handling * simplify dag construction and fix to output all ops * fix to work with ApplyLayout * focus on layout+routing * improve how to call MIPMapping * simplify the spec * add an error handling * fix how to call MIPMapping pass * update user warning for change of given layout * wip: refactor mip model * improve top-level interface * return original dag if fails to solve MIP * minor fixes * care the case no cplex is installed * fix not to ignore swaps in original layers * fix mismatch in layer and su4layer indices * simplify by focusing only on depth objective * rename MIP to BIP * lint lint lint lint * improve interface around dummy steps * improve error message when cplex fails * restore level3 preset passmanager * improve depth objective * Rework optional dependency and add test configuration This commit reworks the logic around the optional dependency on cplex. The pass despite raising an exception if cplex wasn't installed was unconditionally trying to import cplex from the model module at import time. To avoid failures from that this adds a try block around the actual cplex usage in the model module and exports whether it's available or not. At the same time this is leveraged to add a skip condition on the tests so we only run them if cplex is installed. Then to run tests in CI we install cplex in the linux 3.7 job so we at least run it in one environment. It's not available in all our supported environments so getting full coverage in every env is not worth trying for, so just testing the qiskit portion works is enough. * Fix lint * Fix test, lint and logging * Fix lint and test, update docstring * Fix docstring and improve performance taking the risk of failing to map * Update docstring * Replace cplex.Cplex with docplex.mp.model.Model to improve readability Replace cplex.Cplex with docplex.mp.model.Model to improve readability fix requiring docplex version move docplex to requirements-dev * Improve BIPMappingModel interface simplify and improve docstring Improve BIPMappingModel interface * Update qiskit/transpiler/passes/routing/algorithms/bip_model.py Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com> * Fix docplex dependency * fix unnecessary-comprehension * lint * lint * update how to set cplex params and remove redundant constraints * skip unless docplex * fix a bug in arg threads * remove python version restriction * Change spec to require the number of virtual and physical qubits are the same * Update to use 'requires' to require precondition passes * Update qiskit/transpiler/passes/routing/algorithms/bip_model.py Co-authored-by: Luciano Bello <bel@zurich.ibm.com> * lint * Add release note Add release note fix typos * Update docstring Update docstring fix typo * Improve error handling * Change to return mapped dag for circuits with only 1q-gates * Revert the spec change in the case of only 1q-gates * Update releasenotes/notes/add-bip-mapper-f729f2c5672d7f3e.yaml Co-authored-by: Ali Javadi-Abhari <ajavadia@users.noreply.github.com> * Update releasenotes/notes/add-bip-mapper-f729f2c5672d7f3e.yaml Co-authored-by: Ali Javadi-Abhari <ajavadia@users.noreply.github.com> * Update qiskit/transpiler/passes/routing/bip_mapping.py Co-authored-by: Ali Javadi-Abhari <ajavadia@users.noreply.github.com> * Update qiskit/transpiler/passes/routing/bip_mapping.py Co-authored-by: Ali Javadi-Abhari <ajavadia@users.noreply.github.com> * Update qiskit/transpiler/passes/routing/bip_mapping.py Co-authored-by: Ali Javadi-Abhari <ajavadia@users.noreply.github.com> * Update qiskit/transpiler/passes/routing/bip_mapping.py Co-authored-by: Ali Javadi-Abhari <ajavadia@users.noreply.github.com> Co-authored-by: Giacomo Nannicini <gnannicini@users.noreply.github.com> Co-authored-by: Giacomo Nannicini <giacomo.n@gmail.com> Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com> Co-authored-by: Luciano Bello <bel@zurich.ibm.com> Co-authored-by: Ali Javadi-Abhari <ajavadia@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information