Skip to content

Commit

Permalink
Merge main and fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
manoelmarques committed May 26, 2021
2 parents 77dc2c3 + f3a4df4 commit bbb8c8e
Show file tree
Hide file tree
Showing 108 changed files with 4,832 additions and 2,436 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
6a7642d84e43c5a33c60630363633905992f8cc7
724158ba42f4b75758edc1de42f6f665660ec27e
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- uses: ./.github/actions/install-optimization
- name: Install Dependencies
run: |
pip install -U jupyter sphinx nbsphinx sphinx_rtd_theme 'matplotlib<3.3.0' qiskit-terra[visualization]
pip install jupyter sphinx_rtd_theme 'matplotlib<3.3.0' qiskit-terra[visualization]
sudo apt-get install -y pandoc graphviz
shell: bash
- name: Build and publish
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- uses: ./.github/actions/install-optimization
- name: Install Dependencies
run: |
pip install -U jupyter sphinx nbsphinx sphinx_rtd_theme 'matplotlib<3.3.0' qiskit-terra[visualization]
pip install jupyter sphinx_rtd_theme 'matplotlib<3.3.0' qiskit-terra[visualization]
sudo apt-get -y install pandoc graphviz
sudo apt-get -y install python3-enchant
sudo apt-get -y install hunspell-en-us
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
- uses: ./.github/actions/install-optimization
- name: Install Dependencies
run: |
pip install -U jupyter sphinx nbsphinx sphinx_rtd_theme 'matplotlib<3.3.0' qiskit-terra[visualization]
pip install jupyter sphinx_rtd_theme 'matplotlib<3.3.0' qiskit-terra[visualization]
sudo apt-get install -y pandoc graphviz
shell: bash
- name: Run Qiskit Optimization Tutorials
Expand Down
76 changes: 58 additions & 18 deletions .pylintdict
Original file line number Diff line number Diff line change
@@ -1,41 +1,56 @@
acc
adaptively
admmstate
aer
aer's
al
annealers
applegate
args
arxiv
autosummary
backend
bb
benchmarking
bitstring
bitstrings
bixby
bool
boolean
boyd
bravyi
catol
chu
chvátal
cobyla
coeffs
combinatorial
conv
cplex
cplexoptimizer
cts
currentmodule
cvar
deterministically
dic
dicts
disp
docplex
docplex's
doi
dok
dtype
durr
eckstein
ee
egger
eigen
eigensolver
eigenstate
entangler
eq
erdos
et
exponentiated
farhi
fmin
formatter
func
fval
Expand All @@ -44,16 +59,18 @@ gambella
geq
getter
goemans
goldstone
grover
groveroptimizer
gset
gurobi
gurobipy
gutmann
hamilton
hamiltonian
hamiltonians
hardcoded
hb
hastings
hoyer
ij
imode
init
initializer
Expand All @@ -65,88 +82,111 @@ iter
iteratively
karimi
kwargs
lagrangian
len
leq
lin
linearconstraint
lowerbound
lp
lucas
macos
makefile
matplotlib
maxcut
maxfun
maxiter
mdl
minimizer
minimumeigenoptimizationresult
networkx
minimumeigenoptimizer
multiset
ndarray
ndarrays
noop
networkx
neven
nosignatures
np
num
numpy
optimality
optimizationresult
optimizationresultstatus
optimizers
param
params
parikh
pauli
paulis
peleato
penality
pooya
pos
pre
preprint
presolver
princeton
probabilistically
qaoa
qasm
qiskit
qiskit's
qp
quadratically
quadraticconstraint
quadraticobjective
quadraticprogram
quantuminstance
qubit
qubits
qubo
readme
renyi
representable
rhobeg
rhoend
rhs
ronagh
rqaoa
rtype
ry
rz
sahar
satisfiability
savefile
scipy
sdp
simonetto
sj
slsqp
smode
smoothen
src
statevector
stdout
str
subcollection
subgraph
submodules
sys
subproblem
summands
terra
th
toctree
todo
todok
tol
unittest
traceback
tradeoff
travelling
troyer
tsplib
undirected
upperbound
variational
vartype
vqe
writelines
xixj
wavefunction
wecker
williamson
xs
xuxv
zemlin
zi
zj
zv
zsh
5 changes: 3 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ disable=no-self-use, # disabled as it is too verbose
unnecessary-pass, # allow for methods with just "pass", for clarity
no-else-return, # relax "elif" after a clause with a return
docstring-first-line-empty, # relax docstring style
import-outside-toplevel
import-outside-toplevel,
bad-continuation, bad-whitespace # differences of opinion with black



Expand Down Expand Up @@ -215,7 +216,7 @@ max-nested-blocks=5
[FORMAT]

# Maximum number of characters on a single line.
max-line-length=100
max-line-length=105

# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
Expand Down
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ please ensure that:
make style
```
from the root of the Optimization repository clone for lint and style conformance checks.

If your code fails the local style checks (specifically the black
code formatting check) you can use `make black` to automatically
fix update the code formatting.

For unit testing please see [Testing](#testing) section below.

Expand Down Expand Up @@ -303,3 +307,27 @@ the following steps:

The `stable/*` branches should only receive changes in the form of bug
fixes.

## Dealing with the git blame ignore list

In the qiskit-optimization repository we maintain a list of commits for git blame
to ignore. This is mostly commits that are code style changes that don't
change the functionality but just change the code formatting (for example,
when we migrated to use black for code formatting). This file,
`.git-blame-ignore-revs` just contains a list of commit SHA1s you can tell git
to ignore when using the `git blame` command. This can be done one time
with something like

```
git blame --ignore-revs-file .git-blame-ignore-revs qiskit_optimization/version.py
```

from the root of the repository. If you'd like to enable this by default you
can update your local repository's configuration with:

```
git config blame.ignoreRevsFile .git-blame-ignore-revs
```

which will update your local repositories configuration to use the ignore list
by default.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ mypy:
mypy qiskit_optimization test tools

style:
pycodestyle qiskit_optimization test tools
black --check qiskit_optimization test tools

black:
black qiskit_optimization test tools

test:
python -m unittest discover -v test
Expand All @@ -57,6 +60,7 @@ test_ci:

spell:
pylint -rn --disable=all --enable=spelling --spelling-dict=en_US --spelling-private-dict-file=.pylintdict qiskit_optimization test tools
make -C docs spell SPHINXOPTS=$(SPHINXOPTS)

copyright:
python tools/check_copyright.py
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ To do this follow the instructions in the

### Optional Installs

* **IBM CPLEX** may be installed using `pip install 'qiskit-optimization[cplex]'` to enable the reading of `LP` files.
* **IBM CPLEX** may be installed using `pip install 'qiskit-optimization[cplex]'` to enable the reading of `LP` files and the usage of
the `CplexOptimizer`, wrapper for ``cplex.Cplex``.

* **CVXPY** may be installed using command `pip install 'qiskit-optimization[cvx]'` to install the
package. CVXPY being installed will enable the usage of the Goemans-Williamson algorithm as an optimizer `GoemansWilliamsonOptimizer`.

* **Matplotlib** may be installed using command `pip install 'qiskit-optimization[matplotlib]'` to install the
package. Matplotlib being installed will enable the usage of the `draw` method in the graph optimization application classes.

### Creating Your First Optimization Programming Experiment in Qiskit

Expand Down
10 changes: 9 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
# (C) Copyright IBM 2018, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand All @@ -15,14 +15,22 @@ SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = _build
STUBSDIR = stubs

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

spell:
rm -rf $(BUILDDIR)
rm -rf $(STUBSDIR)
@$(SPHINXBUILD) -M spelling "$(SOURCEDIR)" "$(BUILDDIR)" -W $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
rm -rf $(BUILDDIR)
rm -rf $(STUBSDIR)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Loading

0 comments on commit bbb8c8e

Please sign in to comment.