Skip to content

Commit

Permalink
Merge branch 'main' into controlflow/stochastic_swap
Browse files Browse the repository at this point in the history
  • Loading branch information
ewinston authored Aug 12, 2022
2 parents 09f8490 + 82e38d1 commit 9a0ad5c
Show file tree
Hide file tree
Showing 114 changed files with 4,898 additions and 869 deletions.
6 changes: 4 additions & 2 deletions .azure/docs-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ jobs:

- bash: |
set -e
python -m pip install --upgrade pip setuptools wheel
pip install -U tox
python -m pip install --upgrade pip 'setuptools<64.0.0' wheel -c constraints.txt
pip install -U tox -c constraints.txt
sudo apt-get update
sudo apt-get install -y graphviz
displayName: 'Install dependencies'
- bash: |
tox -edocs
displayName: 'Run Docs build'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- task: ArchiveFiles@2
inputs:
Expand Down
4 changes: 3 additions & 1 deletion .azure/lint-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ jobs:

- bash: |
set -e
python -m pip install --upgrade pip setuptools wheel virtualenv
python -m pip install --upgrade pip 'setuptools<64.0.0' wheel virtualenv -c constraints.txt
virtualenv test-job
source test-job/bin/activate
pip install -U -r requirements.txt -r requirements-dev.txt -c constraints.txt
pip install -U -c constraints.txt -e .
pip install -U "qiskit-aer" -c constraints.txt
python setup.py build_ext --inplace
displayName: 'Install dependencies'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- bash: |
set -e
Expand Down
7 changes: 6 additions & 1 deletion .azure/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- bash: |
set -e
python -m pip install --upgrade pip setuptools wheel virtualenv
python -m pip install --upgrade pip 'setuptools<64.0.0' wheel virtualenv -c constraints.txt
virtualenv test-job
displayName: "Prepare venv"
Expand All @@ -82,6 +82,9 @@ jobs:
pip install -U -r requirements.txt -r requirements-dev.txt -c constraints.txt
pip install -U -c constraints.txt -e .
displayName: "Install Terra directly"
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- bash: |
set -e
Expand Down Expand Up @@ -165,6 +168,8 @@ jobs:
sudo apt-get install -y graphviz pandoc
image_tests/bin/pip check
displayName: 'Install dependencies'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- bash: image_tests/bin/python -m unittest discover -v test/ipynb
displayName: 'Run image test'
4 changes: 3 additions & 1 deletion .azure/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ jobs:

- bash: |
set -e
python -m pip install --upgrade pip setuptools wheel virtualenv
python -m pip install --upgrade pip 'setuptools<64.0.0' wheel virtualenv -c constraints.txt
virtualenv test-job
source test-job/bin/activate
pip install -U -r requirements.txt -r requirements-dev.txt -c constraints.txt
pip install -U -c constraints.txt -e .
python setup.py build_ext --inplace
pip check
displayName: 'Install dependencies'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- bash: |
set -e
Expand Down
4 changes: 3 additions & 1 deletion .azure/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- bash: |
set -e
python -m pip install --upgrade pip setuptools wheel virtualenv
python -m pip install --upgrade pip 'setuptools<64.0.0' wheel virtualenv -c constraints.txt
virtualenv test-job
source test-job/Scripts/activate
pip install -r requirements.txt -r requirements-dev.txt -c constraints.txt
Expand All @@ -39,6 +39,8 @@ jobs:
python setup.py build_ext --inplace
pip check
displayName: 'Install dependencies'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- bash: |
set -e
Expand Down
2 changes: 2 additions & 0 deletions .azure/tutorials-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
sudo apt-get install -y graphviz pandoc
pip check
displayName: 'Install dependencies'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- bash: |
set -e
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
run: pip install tox coveragepy-lcov
- name: Run coverage report
run: tox -ecoverage
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- name: Convert to lcov
run: coveragepy-lcov --output_file_path coveralls.info
- name: Coveralls
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/randomized_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
pip install -c constraints.txt -e .
pip install "qiskit-ibmq-provider" -c constraints.txt
pip install "qiskit-aer"
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- name: Run randomized tests
run: make test_randomized
- name: Create comment on failed test run
Expand Down
20 changes: 16 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ numpy = "0.16.2"
rand = "0.8"
rand_pcg = "0.3"
rand_distr = "0.4.3"
ahash = "0.7.6"
ahash = "0.8.0"
num-complex = "0.4"
num-bigint = "0.4"

Expand All @@ -24,7 +24,7 @@ version = "0.16.5"
features = ["extension-module", "hashbrown", "num-complex", "num-bigint"]

[dependencies.ndarray]
version = "^0.15.0"
version = "^0.15.6"
features = ["rayon"]

[dependencies.hashbrown]
Expand Down
4 changes: 4 additions & 0 deletions constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ pyparsing<3.0.0
# to work with the new jinja version (the jinja maintainers aren't going to
# fix things) pin to the previous working version.
jinja2==3.0.3

# setuptools 64.0.0 breaks editable installs. Pin to an old version until
# see https://github.com/pypa/setuptools/issues/3498
setuptools==63.3.0
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "wheel", "setuptools-rust"]
requires = ["setuptools", "wheel", "setuptools-rust<1.5.0"]
build-backend = "setuptools.build_meta"

[tool.black]
Expand Down
5 changes: 5 additions & 0 deletions qiskit/algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@
RealEvolver
ImaginaryEvolver
TrotterQRTE
PVQD
PVQDResult
EvolutionResult
EvolutionProblem
Expand Down Expand Up @@ -246,6 +248,7 @@
from .exceptions import AlgorithmError
from .aux_ops_evaluator import eval_observables
from .evolvers.trotterization import TrotterQRTE
from .evolvers.pvqd import PVQD, PVQDResult

__all__ = [
"AlgorithmResult",
Expand Down Expand Up @@ -292,6 +295,8 @@
"PhaseEstimationScale",
"PhaseEstimation",
"PhaseEstimationResult",
"PVQD",
"PVQDResult",
"IterativePhaseEstimation",
"AlgorithmError",
"eval_observables",
Expand Down
6 changes: 4 additions & 2 deletions qiskit/algorithms/evolvers/evolution_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(
self,
hamiltonian: OperatorBase,
time: float,
initial_state: Union[StateFn, QuantumCircuit],
initial_state: Optional[Union[StateFn, QuantumCircuit]] = None,
aux_operators: Optional[ListOrDict[OperatorBase]] = None,
truncation_threshold: float = 1e-12,
t_param: Optional[Parameter] = None,
Expand All @@ -41,7 +41,9 @@ def __init__(
Args:
hamiltonian: The Hamiltonian under which to evolve the system.
time: Total time of evolution.
initial_state: Quantum state to be evolved.
initial_state: The quantum state to be evolved for methods like Trotterization.
For variational time evolutions, where the evolution happens in an ansatz,
this argument is not required.
aux_operators: Optional list of auxiliary operators to be evaluated with the
evolved ``initial_state`` and their expectation values returned.
truncation_threshold: Defines a threshold under which values can be assumed to be 0.
Expand Down
18 changes: 18 additions & 0 deletions qiskit/algorithms/evolvers/pvqd/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2022.
#
# 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
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""The projected Variational Quantum Dynamic (p-VQD) module."""

from .pvqd_result import PVQDResult
from .pvqd import PVQD

__all__ = ["PVQD", "PVQDResult"]
Loading

0 comments on commit 9a0ad5c

Please sign in to comment.