Skip to content

Commit

Permalink
Merge branch 'main' into Dran-Z/main
Browse files Browse the repository at this point in the history
# Conflicts:
#	qiskit_optimization/algorithms/__init__.py
#	setup.py
  • Loading branch information
t-imamichi committed Apr 20, 2023
2 parents b511b9b + bd81a3f commit 691cb9d
Show file tree
Hide file tree
Showing 76 changed files with 2,623 additions and 1,623 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# least one codeowner. However, all Qiskit team members can (and should!) review the PRs.

# Global rule, unless specialized by a later one
* @stefan-woerner @manoelmarques @woodsp-ibm @t-imamichi
* @stefan-woerner @woodsp-ibm @t-imamichi

14 changes: 0 additions & 14 deletions .github/ISSUE_TEMPLATE/ENHANCEMENT_REQUEST.yaml

This file was deleted.

68 changes: 4 additions & 64 deletions .github/actions/install-main-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021, 2022.
# (C) Copyright IBM 2021, 2023.
#
# 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 @@ -25,7 +25,6 @@ runs:
- name: Get main last commit ids
run: |
echo "TERRA_HASH=$(git ls-remote --heads https://github.com/Qiskit/qiskit-terra.git refs/heads/main | awk '{print $1}')" >> $GITHUB_ENV
echo "AER_HASH=$(git ls-remote --heads https://github.com/Qiskit/qiskit-aer.git refs/heads/main | awk '{print $1}')" >> $GITHUB_ENV
shell: bash
- name: Terra Cache
env:
Expand All @@ -35,14 +34,6 @@ runs:
with:
path: terra-cache
key: terra-cache-${{ inputs.os }}-${{ inputs.python-version }}-${{ env.TERRA_HASH }}-${{ env.CACHE_VERSION }}
- name: Aer Cache
env:
CACHE_VERSION: v1
id: aer-cache
uses: actions/cache@v3
with:
path: aer-cache
key: aer-cache-${{ inputs.os }}-${{ inputs.python-version }}-${{ env.AER_HASH }}-${{ env.CACHE_VERSION }}
- name: Install Terra from Main
env:
MACOSX_DEPLOYMENT_TARGET: 10.15
Expand Down Expand Up @@ -81,63 +72,12 @@ runs:
pip uninstall -y setuptools_rust
fi
shell: bash
- name: Install Aer from Main
env:
MACOSX_DEPLOYMENT_TARGET: 10.16
- name: Install stable Aer
run: |
echo 'Install Aer from Main'
echo 'Install stable Aer'
if [ "${{ inputs.os }}" == "windows-2019" ]; then
source "$CONDA/etc/profile.d/conda.sh"
conda activate scsenv
fi
if [ "${{ inputs.os }}" == "ubuntu-latest" ]; then
export DISABLE_CONAN=1
sudo apt-get -y install nlohmann-json3-dev
sudo apt-get -y install libspdlog-dev
sudo apt-get -y install libmuparserx-dev
fi
git clone --depth 1 --branch main https://github.com/Qiskit/qiskit-aer.git /tmp/qiskit-aer
BASE_DIR=aer-cache
build_from_main=true
cache_hit=${{ steps.aer-cache.outputs.cache-hit }}
echo "cache hit: ${cache_hit}"
if [ "$cache_hit" == "true" ]; then
pip_result=0
pushd "${BASE_DIR}"
python -m pip install *.whl && pip_result=$? || pip_result=$?
popd
if [ $pip_result == 0 ]; then
echo 'Verifying cached Aer with tools/verify_wheels.py ...'
verify_result=0
pushd /tmp/qiskit-aer
python tools/verify_wheels.py && verify_result=$? || verify_result=$?
popd
if [ $verify_result == 0 ]; then
echo 'Cached Aer passed verification.'
build_from_main=false
else
echo 'Cached Aer failed verification.'
fi
fi
else
mkdir -p ${BASE_DIR}
fi
if [ "$build_from_main" == "true" ]; then
echo 'Create wheel file from main'
pip install -U wheel
pushd /tmp/qiskit-aer
if [ "${{ inputs.os }}" == "windows-2019" ]; then
python setup.py bdist_wheel -- -G 'Visual Studio 16 2019'
elif [ "${{ inputs.os }}" == "macos-latest" ]; then
pip install -U -c constraints.txt -r requirements-dev.txt
python setup.py bdist_wheel --plat-name macosx-10.16-x86_64
else
python setup.py bdist_wheel
fi
popd
cp -rf /tmp/qiskit-aer/dist/*.whl "${BASE_DIR}"
pushd "${BASE_DIR}"
python -m pip install *.whl
popd
fi
pip install -U qiskit-aer
shell: bash
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ concurrency:

jobs:
docs_publish:
if: ${{ startsWith(github.ref, 'refs/heads/stable') && contains('["manoelmarques","mtreinish","stefan-woerner","woodsp-ibm"]', github.actor) }}
if: ${{ startsWith(github.ref, 'refs/heads/stable') && contains('["t-imamichi","mtreinish","stefan-woerner","woodsp-ibm"]', github.actor) }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
tools/deploy_documentation.sh
shell: bash
deploy-translatable-strings:
if: ${{ startsWith(github.ref, 'refs/heads/stable') && contains('["manoelmarques","mtreinish","stefan-woerner","woodsp-ibm"]', github.actor) }}
if: ${{ startsWith(github.ref, 'refs/heads/stable') && contains('["t-imamichi","mtreinish","stefan-woerner","woodsp-ibm"]', github.actor) }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
30 changes: 13 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021, 2022.
# (C) Copyright IBM 2021, 2023.
#
# 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 Down Expand Up @@ -113,12 +113,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9, '3.10.6']
python-version: [3.7, 3.8, 3.9, '3.10', 3.11]
include:
- os: macos-latest
python-version: 3.8
- os: macos-latest
python-version: '3.10.6'
python-version: '3.10'
- os: windows-2019
python-version: 3.8
- os: windows-2019
Expand All @@ -136,7 +136,7 @@ jobs:
- name: install Windows dependencies
run: |
source "$CONDA/etc/profile.d/conda.sh"
conda create -n scsenv python=${{ matrix.python-version }}
conda create -y -n scsenv python=${{ matrix.python-version }} -c conda-forge
conda activate scsenv
conda install -y scs lapack cvxpy -c conda-forge
if: ${{ matrix.os == 'windows-2019' }}
Expand Down Expand Up @@ -166,15 +166,6 @@ jobs:
make mypy
if: ${{ !cancelled() }}
shell: bash
- name: Run lint latest version
run: |
if [ "${{ matrix.os }}" == "windows-2019" ]; then
source "$CONDA/etc/profile.d/conda.sh"
conda activate scsenv
fi
pip install -U -r requirements-dev.txt
make lint
shell: bash
- name: Optimization Unit Tests under Python ${{ matrix.python-version }}
uses: ./.github/actions/run-tests
with:
Expand Down Expand Up @@ -224,6 +215,7 @@ jobs:
Tutorials:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8]
Expand Down Expand Up @@ -312,7 +304,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v3
with:
name: ubuntu-latest-3.7
name: ubuntu-latest-3.7
path: /tmp/o37
- uses: actions/download-artifact@v3
with:
Expand All @@ -324,15 +316,19 @@ jobs:
path: /tmp/o39
- uses: actions/download-artifact@v3
with:
name: ubuntu-latest-3.10.6
name: ubuntu-latest-3.10
path: /tmp/o310
- uses: actions/download-artifact@v3
with:
name: ubuntu-latest-3.11
path: /tmp/o311
- uses: actions/download-artifact@v3
with:
name: macos-latest-3.8
path: /tmp/m38
- uses: actions/download-artifact@v3
with:
name: macos-latest-3.10.6
name: macos-latest-3.10
path: /tmp/m310
- uses: actions/download-artifact@v3
with:
Expand All @@ -347,7 +343,7 @@ jobs:
shell: bash
- name: Combined Deprecation Messages
run: |
sort -f -u /tmp/o37/opt.dep /tmp/o38/opt.dep /tmp/o39/opt.dep /tmp/o310/opt.dep /tmp/m38/opt.dep /tmp/m310/opt.dep /tmp/w38/opt.dep /tmp/w310/opt.dep || true
sort -f -u /tmp/o37/opt.dep /tmp/o38/opt.dep /tmp/o39/opt.dep /tmp/o310/opt.dep /tmp/o311/opt.dep /tmp/m38/opt.dep /tmp/m310/opt.dep /tmp/w38/opt.dep /tmp/w310/opt.dep || true
shell: bash
- name: Coverage combine
run: coverage3 combine /tmp/o37/opt.dat
Expand Down
2 changes: 1 addition & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ pull_request_rules:
actions:
backport:
branches:
- stable/0.4
- stable/0.5
6 changes: 6 additions & 0 deletions .pylintdict
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ args
arxiv
autosummary
backend
backends
barkoutsos
benchmarking
bitstring
Expand Down Expand Up @@ -50,6 +51,7 @@ eckstein
egger
eigen
eigensolver
eigensolvers
eigenstate
entangler
enum
Expand Down Expand Up @@ -81,6 +83,7 @@ hamiltonian
hamiltonians
hastings
hoyer
ibm
ide
imode
init
Expand Down Expand Up @@ -127,7 +130,9 @@ nosignatures
np
num
numpy
numpyminimumeigensolver
october
opflow
optimality
optimizationresult
optimizationresultstatus
Expand Down Expand Up @@ -219,6 +224,7 @@ upperbound
variational
vartype
vqe
vqeresult
writelines
xixj
wavefunction
Expand Down
50 changes: 2 additions & 48 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=no-self-use, # disabled as it is too verbose
fixme, # disabled as TODOs would show up as warnings
disable=fixme, # disabled as TODOs would show up as warnings
protected-access, # disabled as we don't follow the public vs private
# convention strictly
duplicate-code, # disabled as it is too verbose
Expand All @@ -72,9 +71,6 @@ disable=no-self-use, # disabled as it is too verbose
no-else-return, # relax "elif" after a clause with a return
docstring-first-line-empty, # relax docstring style
import-outside-toplevel,
bad-continuation, bad-whitespace, # differences of opinion with black




[REPORTS]
Expand All @@ -84,12 +80,6 @@ disable=no-self-use, # disabled as it is too verbose
# mypackage.mymodule.MyReporterClass.
output-format=text

# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]". This option is deprecated
# and it will be removed in Pylint 2.0.
files-output=no

# Tells whether to display a full report or only the messages
reports=yes

Expand Down Expand Up @@ -138,63 +128,33 @@ property-classes=abc.abstractproperty
# Regular expression matching correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Naming hint for module names
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Regular expression matching correct constant names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Naming hint for constant names
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Regular expression matching correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$

# Naming hint for class names
class-name-hint=[A-Z_][a-zA-Z0-9]+$

# Regular expression matching correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for function names
function-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct method names
method-rgx=(([a-z_][a-z0-9_]{2,49})|(assert[A-Z][a-zA-Z0-9]{2,43})|(test_[_a-zA-Z0-9]{2,}))$

# Naming hint for method names
method-name-hint=[a-z_][a-z0-9_]{2,30}$ or camelCase `assert*` in tests.

# Regular expression matching correct attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for attribute names
attr-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}|ax|dt$

# Naming hint for argument names
argument-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for variable names
variable-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct class attribute names
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Naming hint for class attribute names
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Regular expression matching correct inline iteration names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$

# Naming hint for inline iteration names
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$

# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=^_
Expand Down Expand Up @@ -222,12 +182,6 @@ ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# else.
single-line-if-stmt=no

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,dict-separator

# Maximum number of lines in a module
max-module-lines=1000

Expand Down Expand Up @@ -424,4 +378,4 @@ analyse-fallback-blocks=no

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
overgeneral-exceptions=builtins.Exception
Loading

0 comments on commit 691cb9d

Please sign in to comment.