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 committed Sep 30, 2022
2 parents cb32908 + 3c9d8d5 commit 8ec9259
Show file tree
Hide file tree
Showing 399 changed files with 18,643 additions and 6,514 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ qiskit/utils/ @Qiskit/terra-core @manoelmarques @woodsp-ibm
providers/ @Qiskit/terra-core @jyu00
quantum_info/ @Qiskit/terra-core @ikkoham
qpy/ @Qiskit/terra-core @nkanazawa1989
pulse/ @Qiskit/terra-core @eggerdj @nkanazawa1989 @danpuzzuoli
scheduler/ @Qiskit/terra-core @eggerdj @nkanazawa1989 @danpuzzuoli
pulse/ @Qiskit/terra-core @eggerdj @nkanazawa1989 @wshanks
scheduler/ @Qiskit/terra-core @eggerdj @nkanazawa1989 @wshanks
visualization/ @Qiskit/terra-core @nonhermitian @nkanazawa1989
primitives/ @Qiskit/terra-core @ikkoham @t-imamichi
# Override the release notes directories to have _no_ code owners, so any review
Expand Down
52 changes: 47 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,56 @@ jobs:
name: Install Python
with:
python-version: '3.8'
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: default
components: llvm-tools-preview
- name: Install dependencies
run: pip install tox coveragepy-lcov
- name: Run coverage report
run: tox -ecoverage
run: |
pip install coveragepy-lcov
sudo apt-get install lcov
- name: Download grcov for rust coverage
run: curl -L https://github.com/mozilla/grcov/releases/download/v0.8.11/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar xj
- name: Build and install qiskit-terra
run: pip install -e .
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "qiskit-%p-%m.profraw"
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
- name: Convert to lcov
run: coveragepy-lcov --output_file_path coveralls.info
- name: Generate unittest coverage report
run: |
set -e
pip install -r requirements-dev.txt qiskit-aer
stestr run
./grcov . --binary-path ./target/debug/ -s . --llvm --parallel -t lcov --branch --ignore-not-existing --ignore "/*" -o ./rust_unittest.info
mkdir rust_lcov
mv ./rust_unittest.info rust_lcov/.
rm *profraw
env:
QISKIT_TEST_CAPTURE_STREAMS: 1
QISKIT_PARALLEL: FALSE
PYTHON: "coverage3 run --source qiskit --parallel-mode"
- name: Generate parallel_map test
run: |
set -e
coverage3 run --source qiskit --parallel-mode ./tools/verify_parallel_map.py
./grcov . --binary-path ./target/debug/ -s . --llvm --parallel -t lcov --branch --ignore-not-existing --ignore "/*" -o ./rust_parallel_map.info
mv rust_lcov/rust_unittest.info .
env:
QISKIT_TEST_CAPTURE_STREAMS: 1
QISKIT_PARALLEL: FALSE
PYTHON: "coverage3 run --source qiskit --parallel-mode"
- name: Convert to lcov and combine data
run: |
set -e
coverage3 combine
coveragepy-lcov --output_file_path python.info
lcov --add-tracefile python.info -a rust_unittest.info -a rust_parallel_map.info -o combined.info
lcov --remove combined.info "target/*" -o coveralls.info
- name: Coveralls
uses: coverallsapp/github-action@master
with:
Expand Down
7 changes: 5 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ parameters:
type: string
default: "1.56.1"


# These two versions of Python can be chosen somewhat arbitrarily, but we get
# slightly better coverage per PR if they're neither the maximum nor minimum
# supported versions.
Expand All @@ -65,6 +64,10 @@ parameters:
type: string
default: "3.8"

- name: "documentationPythonVersion"
displayName: "Version of Python to use to build Sphinx documentation"
type: string
default: "3.9"

# Conditional compilation logic. This is all the logic for "what to run"; each
# stage in turn delegates to various templates in ".azure" that provide the
Expand Down Expand Up @@ -143,7 +146,7 @@ stages:

- template: ".azure/docs-linux.yml"
parameters:
pythonVersion: ${{ parameters.minimumPythonVersion }}
pythonVersion: ${{ parameters.documentationPythonVersion }}

- template: ".azure/test-linux.yml"
parameters:
Expand Down
96 changes: 76 additions & 20 deletions qiskit/algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@
MaximumLikelihoodAmplitudeEstimationResult
Eigensolvers
------------
Eigen Solvers
-------------
Algorithms to find eigenvalues of an operator. For chemistry these can be used to find excited
states of a molecule, and qiskit-nature has some algorithms that leverage chemistry specific
knowledge to do this in that application domain.
knowledge to do this in that application domain. These algorithms are pending deprecation.
One should instead make use of the Eigensolver classes in the section below, which leverage
Runtime primitives.
.. autosummary::
:toctree: ../stubs/
Expand All @@ -92,22 +94,28 @@
NumPyEigensolver
VQD
VQDResult
Eigensolvers
------------
Variational Quantum Time Evolution
----------------------------------
Classes used by variational quantum time evolution algorithms - VarQITE and VarQRTE.
Algorithms to find eigenvalues of an operator. For chemistry these can be used to find excited
states of a molecule, and qiskit-nature has some algorithms that leverage chemistry specific
knowledge to do this in that application domain.
.. autosummary::
:toctree: ../stubs/
evolvers.variational
eigensolvers
Evolvers
--------
Pending deprecation: This package has been superseded by the package below. It will be
deprecated in a future release and subsequently removed after that:
`Time Evolvers`_
Algorithms to evolve quantum states in time. Both real and imaginary time evolution is possible
with algorithms that support them. For machine learning, Quantum Imaginary Time Evolution might be
used to train Quantum Boltzmann Machine Neural Networks for example.
Expand All @@ -119,14 +127,40 @@
RealEvolver
ImaginaryEvolver
TrotterQRTE
VarQITE
VarQRTE
PVQD
PVQDResult
EvolutionResult
EvolutionProblem
Time Evolvers
-------------
Primitives-enabled algorithms to evolve quantum states in time. Both real and imaginary time
evolution is possible with algorithms that support them. For machine learning, Quantum Imaginary
Time Evolution might be used to train Quantum Boltzmann Machine Neural Networks for example.
.. autosummary::
:toctree: ../stubs/
:nosignatures:
RealTimeEvolver
ImaginaryTimeEvolver
PVQD
PVQDResult
TimeEvolutionResult
TimeEvolutionProblem
Trotterization-based Quantum Real Time Evolution
------------------------------------------------
Package for primitives-enabled Trotterization-based quantum time evolution algorithm - TrotterQRTE.
.. autosummary::
:toctree: ../stubs/
time_evolvers.trotterization
Factorizers
-----------
Expand Down Expand Up @@ -163,10 +197,12 @@
linear_solvers
Minimum Eigensolvers
--------------------
Minimum Eigen Solvers
---------------------
Algorithms that can find the minimum eigenvalue of an operator.
These algorithms are pending deprecation. One should instead make use of the
Minimum Eigensolver classes in the section below, which leverage Runtime primitives.
.. autosummary::
:toctree: ../stubs/
Expand All @@ -183,6 +219,16 @@
QAOA
VQE
Minimum Eigensolvers
--------------------
Algorithms that can find the minimum eigenvalue of an operator and leverage primitives.
.. autosummary::
:toctree: ../stubs/
minimum_eigensolvers
Optimizers
----------
Expand Down Expand Up @@ -222,6 +268,7 @@
state_fidelities
Exceptions
----------
Expand All @@ -240,6 +287,8 @@
:toctree: ../stubs/
eval_observables
estimate_observables
Utility classes
---------------
Expand All @@ -257,6 +306,10 @@
from .evolvers import EvolutionResult, EvolutionProblem
from .evolvers.real_evolver import RealEvolver
from .evolvers.imaginary_evolver import ImaginaryEvolver
from .time_evolvers.imaginary_time_evolver import ImaginaryTimeEvolver
from .time_evolvers.real_time_evolver import RealTimeEvolver
from .time_evolvers.time_evolution_problem import TimeEvolutionProblem
from .time_evolvers.time_evolution_result import TimeEvolutionResult
from .variational_algorithm import VariationalAlgorithm, VariationalResult
from .amplitude_amplifiers import Grover, GroverResult, AmplificationProblem, AmplitudeAmplifier
from .amplitude_estimators import (
Expand Down Expand Up @@ -293,11 +346,10 @@
)
from .exceptions import AlgorithmError
from .aux_ops_evaluator import eval_observables
from .observables_evaluator import estimate_observables
from .evolvers.trotterization import TrotterQRTE
from .evolvers.variational.var_qite import VarQITE
from .evolvers.variational.var_qrte import VarQRTE

from .evolvers.pvqd import PVQD, PVQDResult
from .time_evolvers.pvqd import PVQD, PVQDResult

__all__ = [
"AlgorithmJob",
Expand All @@ -322,11 +374,13 @@
"NumPyEigensolver",
"RealEvolver",
"ImaginaryEvolver",
"RealTimeEvolver",
"ImaginaryTimeEvolver",
"TrotterQRTE",
"VarQITE",
"VarQRTE",
"EvolutionResult",
"EvolutionProblem",
"TimeEvolutionResult",
"TimeEvolutionProblem",
"LinearSolverResult",
"Eigensolver",
"EigensolverResult",
Expand All @@ -344,6 +398,7 @@
"HamiltonianPhaseEstimation",
"HamiltonianPhaseEstimationResult",
"VQD",
"VQDResult",
"PhaseEstimationScale",
"PhaseEstimation",
"PhaseEstimationResult",
Expand All @@ -352,4 +407,5 @@
"IterativePhaseEstimation",
"AlgorithmError",
"eval_observables",
"estimate_observables",
]
2 changes: 2 additions & 0 deletions qiskit/algorithms/amplitude_amplifiers/amplitude_amplifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def __init__(self) -> None:
self._top_measurement = None
self._assignment = None
self._oracle_evaluation = None
self._circuit_results = None
self._max_probability = None

@property
def top_measurement(self) -> Optional[str]:
Expand Down
Loading

0 comments on commit 8ec9259

Please sign in to comment.