Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
227 commits
Select commit Hold shift + click to select a range
e3233b7
Implemented observables_evaluator.py with primitives.
Aug 30, 2022
d71f50b
Added evolvers problems and interfaces to time_evolvers package.
Aug 30, 2022
7a7c82b
Mostly updated trotter_qrte.py to use primitives.
Aug 30, 2022
54afe25
Added observables_evaluator.py that uses primitives.
Sep 1, 2022
d2b67d9
Added observables_evaluator.py that uses primitives.
Sep 1, 2022
c1276d2
Updated trotter_qrte.py to use primitives.
Sep 1, 2022
e06c6c2
Updated imports
Sep 1, 2022
5a9bebe
Updated typehints and limited use of opflow.
Sep 5, 2022
356deae
Updated typehints and limited use of opflow.
Sep 5, 2022
14ba35d
Removed files out of scope for this PR.
Sep 5, 2022
4cf6f61
Added annotations import.
Sep 5, 2022
39c9735
Added observables_evaluator.py with primitives.
Sep 5, 2022
99adde7
Added ListOrDict support to observables_evaluator.py.
Sep 5, 2022
39e7e70
wip qfi
a-matsuo Sep 6, 2022
6462bb0
Included CR suggestions.
Sep 6, 2022
604944c
Applied some CR comments.
Sep 6, 2022
d287c2f
Applied some CR comments.
Sep 6, 2022
23821e0
Added reno.
Sep 7, 2022
80a2e2b
Added reno.
Sep 7, 2022
a2960b2
Accepting Statevector.
Sep 7, 2022
9b5f50a
Added attributes docs.
Sep 7, 2022
4c40e00
Support for 0 operator.
Sep 7, 2022
21ec238
wip qfi
a-matsuo Sep 8, 2022
107dc2b
Merge branch 'main' into evolution-framework-primitives
manoelmarques Sep 8, 2022
2bcf07b
Add pending deprecation
manoelmarques Sep 8, 2022
4adfd1b
Merge branch 'main' into observable-eval-primitives
manoelmarques Sep 8, 2022
387ce78
Add pending deprecation for evolvers
manoelmarques Sep 8, 2022
f5c3eaf
Code refactoring.
Sep 8, 2022
65a2cab
Merge branch 'main' into observable-eval-primitives
Sep 8, 2022
a57b073
Merge remote-tracking branch 'origin/observable-eval-primitives' into…
Sep 8, 2022
553714c
Code refactoring.
Sep 8, 2022
a7e2f60
Renamed classes and linked to algorithms init.
Sep 8, 2022
34c2deb
Merge remote-tracking branch 'origin/evolution-framework-primitives' …
Sep 8, 2022
5c87255
fix docstring
manoelmarques Sep 8, 2022
d03bddf
Improved reno.
Sep 9, 2022
a656db0
Merge branch 'main' into evolution-framework-primitives
Sep 9, 2022
fc842a9
Merge branch 'main' into observable-eval-primitives
Sep 9, 2022
92d6515
Improved reno.
Sep 9, 2022
9ba37ed
Returning variances and shots.
Sep 9, 2022
7680019
Code refactoring.
Sep 9, 2022
1dce473
Black fix.
Sep 9, 2022
24aa2bf
Unit test fix.
Sep 9, 2022
00d9d11
Reduced use of opflow.
Sep 9, 2022
9db1832
Merge branch 'observable-eval-primitives' into varqte-primitives
Sep 9, 2022
e395b93
Drafted conversion to primitives; updated type hints.
Sep 9, 2022
44b7959
Handle empty inputs gracefully.
Sep 9, 2022
12d9a68
Merge branch 'main' into observable-eval-primitives
Sep 9, 2022
d3c601e
Applied CR comments.
Sep 11, 2022
773b124
Applied CR comments.
Sep 11, 2022
6a968f3
Merge remote-tracking branch 'origin/observable-eval-primitives' into…
Sep 11, 2022
4795b45
Add deprecation msg to evolvers package
manoelmarques Sep 12, 2022
ce6d828
Merge branch 'main' into evolution-framework-primitives
Sep 12, 2022
0552379
Merge branch 'main' into evolution-framework-primitives
woodsp-ibm Sep 12, 2022
e25d56c
Merge remote-tracking branch 'upstream/main' into qfi-primitive
a-matsuo Sep 13, 2022
6e834f0
Merge branch 'main' into evolution-framework-primitives
Sep 13, 2022
d9c8d84
Merge branch 'main' into evolution-framework-primitives
Sep 13, 2022
deaf990
Merge branch 'qfi-primitive' of https://github.com/a-matsuo/qiskit-te…
Sep 13, 2022
cc7d678
Merge branch 'main' into evolution-framework-primitives
Sep 13, 2022
757f5c3
Drafted integreation with primitive-based QFI and gradients; reduced …
Sep 14, 2022
7000aff
Merge branch 'evolution-framework-primitives' into varqte-primitives
Sep 14, 2022
7a1ca48
Merge branch 'observable-eval-primitives' into varqte-primitives
Sep 14, 2022
d545967
Import added.
Sep 14, 2022
87da32d
updated
a-matsuo Sep 14, 2022
6f4baf6
added tests
a-matsuo Sep 14, 2022
d618406
updated
a-matsuo Sep 15, 2022
d248e44
Applied CR comments.
Sep 15, 2022
a7e615f
Merge branch 'main' into observable-eval-primitives
Sep 15, 2022
8c4b4a0
updated
a-matsuo Sep 15, 2022
7676027
Merge remote-tracking branch 'upstream/main' into qfi-primitive
a-matsuo Sep 15, 2022
3823788
updated
a-matsuo Sep 15, 2022
5a1e6fb
lin comb qfi
a-matsuo Sep 15, 2022
fad2caa
Eliminated cyclic import.
Sep 15, 2022
07fea57
fix
a-matsuo Sep 16, 2022
8db3e3a
Merge branch 'main' into qfi-primitive
a-matsuo Sep 16, 2022
f30cb66
Draft adjusting code to primitives.
Sep 19, 2022
1d373ec
Code refactoring
Sep 19, 2022
55860f3
Draft adjusted unit tests to primitives.
Sep 19, 2022
6803b81
Merge branch 'observable-eval-primitives' into varqte-primitives
Sep 19, 2022
194d246
Updated init.
Sep 20, 2022
e0f9347
Merge remote-tracking branch 'upstream/main' into qfi-primitive
a-matsuo Sep 20, 2022
af09456
finilizing
a-matsuo Sep 21, 2022
2580571
Merge branch 'qfi-primitive' of github.com:a-matsuo/qiskit-terra into…
a-matsuo Sep 21, 2022
4eb4b43
fix lint
a-matsuo Sep 21, 2022
f8b08b3
started working on block diag qfi
a-matsuo Sep 22, 2022
0fb1f8c
Merge branch 'qfi-primitive' into varqte-primitives
Sep 22, 2022
5aad22c
Updated code to BaseQFI.
Sep 22, 2022
be4e317
Removed opflow from tests, made most VarQITE tests passing correctly.
Sep 22, 2022
7e85e95
Used correct bases in var principles.
Sep 23, 2022
7509a54
Drafted the use of energy term in real case.
Sep 23, 2022
3f77d89
Drafted tests with shot-based primitive.
Sep 23, 2022
a628675
Merge branch 'main' into varqte-primitives
Sep 26, 2022
a2bd837
updated utils
a-matsuo Sep 27, 2022
0c24ac7
fix
a-matsuo Sep 27, 2022
e0a22c8
Merge remote-tracking branch 'upstream/main' into qfi-primitive
a-matsuo Sep 27, 2022
e9f5a70
fix options
a-matsuo Sep 27, 2022
038c494
Merge remote-tracking branch 'upstream/main' into qfi-primitive
a-matsuo Sep 28, 2022
f23bb0a
fix
a-matsuo Sep 28, 2022
39aaad2
lint
a-matsuo Sep 28, 2022
aa7fd84
Merge branch 'main' into qfi-primitive
a-matsuo Sep 28, 2022
dc601ae
fix
a-matsuo Sep 28, 2022
3a1fa23
Merge remote-tracking branch 'upstream/main' into qfi-primitive
a-matsuo Sep 28, 2022
6b5f717
Merge branch 'qfi-primitive' of github.com:a-matsuo/qiskit-terra into…
a-matsuo Sep 28, 2022
e72d266
fix list
a-matsuo Sep 28, 2022
ac6f910
Merge remote-tracking branch 'upstream/main' into qfi-primitive
a-matsuo Sep 30, 2022
59dba58
remove estimator from base qfi
a-matsuo Sep 30, 2022
4906f15
fix
a-matsuo Sep 30, 2022
c4707cf
Merge branch 'main' into qfi-primitive
a-matsuo Sep 30, 2022
0a49bc3
make a directory for gradient tests
a-matsuo Sep 30, 2022
ce6d933
added option to baseqfi + fied shots behavior
a-matsuo Oct 3, 2022
bfa8117
fixed qfi's derivative type complex
a-matsuo Oct 3, 2022
945146d
Merge remote-tracking branch 'upstream/main' into qfi-primitive
a-matsuo Oct 3, 2022
3f1520c
Merge remote-tracking branch 'upstream/main' into qfi-primitive
a-matsuo Oct 4, 2022
cd2c4d1
fix
a-matsuo Oct 4, 2022
37ac562
fix
a-matsuo Oct 4, 2022
7d864a6
Merge branch 'qfi-primitive' into varqte-primitives
Oct 4, 2022
2b98806
make parameter_values back to float
a-matsuo Oct 4, 2022
558159f
Code and docs refactoring.
Oct 4, 2022
76d8afc
Merge branch 'main' into qfi-primitive
a-matsuo Oct 4, 2022
ad075f2
Merge branch 'qfi-primitive' into varqte-primitives
Oct 5, 2022
897274b
Merge branch 'main' into varqte-primitives
Oct 5, 2022
63bd2e9
Made VarQRTE work correctly.
Oct 6, 2022
df8e721
Support BaseOperator in VarQRTE.
Oct 6, 2022
edab9c7
Merge branch 'main' into varqte-primitives
Oct 6, 2022
688fa63
Finished VarQITE tests.
Oct 6, 2022
144b213
Finished VarQRTE tests.
Oct 6, 2022
8fbecb8
Added reno.
Oct 7, 2022
4e3b066
Updated algorithms init.
Oct 7, 2022
31f5cd5
Code and docs refactoring.
Oct 7, 2022
a8334de
Code refactoring.
Oct 10, 2022
e54bf72
Revert "Code refactoring."
Oct 10, 2022
f90817c
Merge branch 'main' into varqte-primitives
Oct 10, 2022
4bd254e
Code refactoring.
Oct 13, 2022
f635c80
Merge branch 'main' into qfi-primitive
a-matsuo Oct 26, 2022
fb56a60
Merge branch 'main' into qfi-primitive
a-matsuo Oct 27, 2022
03e94e1
updated
a-matsuo Oct 27, 2022
03642ef
fix lint
a-matsuo Oct 27, 2022
f0e05df
updated
a-matsuo Oct 28, 2022
d5db261
updated
a-matsuo Oct 28, 2022
7c8e127
Merge remote-tracking branch 'upstream/main' into qfi-primitive
a-matsuo Oct 28, 2022
a5bcda4
Merge branch 'main' into qfi-primitive
a-matsuo Oct 31, 2022
d7638fb
Merge branch 'main' into varqte-primitives
Nov 1, 2022
abed536
Merge branch 'qfi-primitive' into varqte-primitives
Nov 1, 2022
fdc799a
Merge branch 'main' into varqte-primitives
Nov 1, 2022
1d64f95
Update qiskit/algorithms/time_evolvers/variational/__init__.py
Nov 7, 2022
e2fdc58
Update qiskit/algorithms/time_evolvers/variational/variational_princi…
Nov 7, 2022
5d5b1a3
Removed unused error calculator.
Nov 7, 2022
58815e3
Dropped BaseOperator type for ansatz.
Nov 7, 2022
a8a1582
Code refactoring.
Nov 7, 2022
212697a
Validation of gradient types added.
Nov 8, 2022
612b8ac
Added support for time-dep Hamiltonians.
Nov 8, 2022
e99863d
Made initial parameters required.
Nov 9, 2022
0004771
Merge branch 'main' into varqte-primitives
Nov 11, 2022
a9fcfd1
Re-added optional estimator for aux ops.
Nov 11, 2022
241a01e
Added comments; improved exception handling.
Nov 14, 2022
9db31b8
Added supports_observables method.
Nov 18, 2022
354d0e0
Merge branch 'main' into varqte-primitives
manoelmarques Dec 1, 2022
c017374
fix import cycles
manoelmarques Dec 1, 2022
15ee5ff
fix docstring titles
manoelmarques Dec 1, 2022
d896402
change imports in unit tests
manoelmarques Dec 1, 2022
0e01c59
Merge branch 'main' into varqte-primitives
manoelmarques Dec 1, 2022
f948c43
Merge branch 'main' into varqte-primitives
manoelmarques Dec 1, 2022
d81f58b
fix docs
manoelmarques Dec 1, 2022
94a7549
Merge remote-tracking branch 'origin/varqte-primitives' into varqte-p…
Dec 5, 2022
25eb5be
Merge branch 'main' into varqte-primitives
Dec 5, 2022
7d894b1
Removed dead code.
Dec 5, 2022
58ac535
Fixed bug with binding time parameter.
Dec 14, 2022
8aca46e
Added time-dependent VarQRTE unit test.
Dec 14, 2022
b2a4d5b
Merge branch 'main' into varqte-primitives
Dec 14, 2022
4b61f6f
Updated tests after main marge.
Dec 14, 2022
d9ed4ff
Added time-dependent VarQITE unit test.
Dec 14, 2022
c31722a
Merge branch 'main' into varqte-primitives
Dec 15, 2022
1a533b2
Merge branch 'main' into varqte-primitives
Cryoris Jan 9, 2023
a873193
Merge branch 'main' into varqte-primitives
ElePT Jan 9, 2023
cb87796
add test for time dep hamiltonian
Cryoris Jan 9, 2023
1e8d8d5
Merge branch 'varqte-primitives' of github.com:dlasecki/qiskit-terra …
Cryoris Jan 9, 2023
48de331
Add varqte_result, update varqite tests
ElePT Jan 10, 2023
4a060cb
Update var_qrte test
ElePT Jan 10, 2023
46f1dca
Merge branch 'main' into varqte-primitives
ElePT Jan 10, 2023
a6b7a98
Fix lint
ElePT Jan 11, 2023
e7372a9
Fix test
ElePT Jan 11, 2023
3a49b17
Merge branch 'varqte-primitives' of https://github.com/dlasecki/qiski…
ElePT Jan 11, 2023
f78f1a6
Remove opflow dependencies
ElePT Jan 11, 2023
3e02bbd
Fix lint
ElePT Jan 11, 2023
e7e50c6
Remove redundant typehints
ElePT Jan 11, 2023
c7ac12f
Add parameters, times, observables to result
ElePT Jan 17, 2023
82f9791
Fix lint
ElePT Jan 17, 2023
34481b4
Unwrap PauliSumOp in VarQTE
ElePT Jan 17, 2023
3fb65fd
Fix tests
ElePT Jan 17, 2023
0ef417f
Replace QFI with QGT
ElePT Jan 17, 2023
300b0a7
Update copyright
ElePT Jan 17, 2023
91b436d
Merge branch 'main' into varqte-primitives
ElePT Jan 17, 2023
9c05a89
Merge branch 'varqte-primitives' of https://github.com/dlasecki/qiski…
ElePT Jan 17, 2023
5df893b
Update tests with QGT
ElePT Jan 17, 2023
8537757
Update imports
ElePT Jan 17, 2023
22df5f1
Update error message
ElePT Jan 17, 2023
79c37a3
Address cyclic import
ElePT Jan 17, 2023
d64fb77
Merge branch 'varqte-primitives' of https://github.com/dlasecki/qiski…
ElePT Jan 17, 2023
4545eeb
Fix black
ElePT Jan 17, 2023
68566f5
Fix cyclic imports
ElePT Jan 17, 2023
54f1f84
Fix linebreak
Cryoris Jan 17, 2023
95e63bc
Update qiskit/algorithms/time_evolvers/variational/var_qte.py
ElePT Jan 17, 2023
6ef31bd
Update qiskit/algorithms/time_evolvers/variational/__init__.py
ElePT Jan 17, 2023
654aec5
Apply suggestions documentation
ElePT Jan 17, 2023
4b783f6
Merge branch 'varqte-primitives' of https://github.com/dlasecki/qiski…
ElePT Jan 17, 2023
bce66f1
Update qiskit/algorithms/time_evolvers/variational/solvers/ode/ode_fu…
ElePT Jan 17, 2023
d51df1a
Update qiskit/algorithms/time_evolvers/time_evolution_result.py
ElePT Jan 17, 2023
181aef0
Update qiskit/algorithms/time_evolvers/variational/var_qte.py
ElePT Jan 18, 2023
8f46bb0
Update qiskit/algorithms/time_evolvers/variational/variational_princi…
ElePT Jan 18, 2023
6d0cdbc
Update qiskit/algorithms/time_evolvers/variational/variational_princi…
ElePT Jan 18, 2023
59a037f
Apply review comments
ElePT Jan 18, 2023
6ed3188
Update qiskit/algorithms/time_evolvers/variational/solvers/var_qte_li…
ElePT Jan 18, 2023
1a908d1
Update qiskit/algorithms/time_evolvers/variational/solvers/var_qte_li…
ElePT Jan 18, 2023
1daf212
Apply review Julien
ElePT Jan 18, 2023
b683151
Merge branch 'main' into varqte-primitives
ElePT Jan 18, 2023
7e6a41d
Update qiskit/algorithms/time_evolvers/variational/solvers/var_qte_li…
ElePT Jan 18, 2023
4916caf
Update qiskit/algorithms/time_evolvers/variational/solvers/var_qte_li…
ElePT Jan 18, 2023
bfe556d
Update qiskit/algorithms/time_evolvers/variational/solvers/var_qte_li…
ElePT Jan 18, 2023
5c09c3b
Update qiskit/algorithms/time_evolvers/variational/variational_princi…
ElePT Jan 18, 2023
2f5c3f9
Update qiskit/algorithms/time_evolvers/variational/variational_princi…
ElePT Jan 18, 2023
51995f1
Update qiskit/algorithms/time_evolvers/variational/solvers/var_qte_li…
ElePT Jan 18, 2023
0702db1
Update qiskit/algorithms/time_evolvers/variational/var_qite.py
ElePT Jan 18, 2023
37fa093
Apply latest suggestions
ElePT Jan 18, 2023
f33cdd2
Merge branch 'varqte-primitives' of https://github.com/dlasecki/qisk…
ElePT Jan 18, 2023
7d64831
Change typehint
ElePT Jan 18, 2023
94c9b13
Fix lint
ElePT Jan 18, 2023
d55e9d4
Fix unit test
ElePT Jan 18, 2023
e35dfbf
Merge branch 'main' into varqte-primitives
mergify[bot] Jan 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 45 additions & 20 deletions qiskit/algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@
:toctree: ../stubs/
:nosignatures:

RealEvolver
ImaginaryEvolver
TrotterQRTE
EvolutionResult
EvolutionProblem
RealEvolver
ImaginaryEvolver
TrotterQRTE
EvolutionResult
EvolutionProblem


Time Evolvers
Expand All @@ -142,18 +142,31 @@
:toctree: ../stubs/
:nosignatures:

RealTimeEvolver
ImaginaryTimeEvolver
PVQD
PVQDResult
TimeEvolutionResult
TimeEvolutionProblem
SciPyImaginaryEvolver
SciPyRealEvolver
RealTimeEvolver
ImaginaryTimeEvolver
TimeEvolutionResult
TimeEvolutionProblem
PVQD
PVQDResult
SciPyImaginaryEvolver
SciPyRealEvolver
VarQITE
VarQRTE


Variational Quantum Time Evolution
++++++++++++++++++++++++++++++++++

Classes used by variational quantum time evolution algorithms - VarQITE and VarQRTE.

.. autosummary::
:toctree: ../stubs/

time_evolvers.variational


Trotterization-based Quantum Real Time Evolution
------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++

Package for primitives-enabled Trotterization-based quantum time evolution algorithm - TrotterQRTE.

Expand Down Expand Up @@ -308,10 +321,6 @@
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 @@ -351,8 +360,20 @@
from .observables_evaluator import estimate_observables
from .evolvers.trotterization import TrotterQRTE

from .time_evolvers.pvqd import PVQD, PVQDResult
from .time_evolvers.classical_methods import SciPyRealEvolver, SciPyImaginaryEvolver
from .time_evolvers import (
ImaginaryTimeEvolver,
RealTimeEvolver,
TimeEvolutionProblem,
TimeEvolutionResult,
PVQD,
PVQDResult,
SciPyImaginaryEvolver,
SciPyRealEvolver,
VarQITE,
VarQRTE,
VarQTE,
VarQTEResult,
)

__all__ = [
"AlgorithmJob",
Expand Down Expand Up @@ -413,4 +434,8 @@
"AlgorithmError",
"eval_observables",
"estimate_observables",
"VarQITE",
"VarQRTE",
"VarQTE",
"VarQTEResult",
]
3 changes: 2 additions & 1 deletion qiskit/algorithms/gradients/base_estimator_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import numpy as np

from qiskit.algorithms import AlgorithmJob
from qiskit.circuit import Parameter, ParameterExpression, QuantumCircuit
from qiskit.opflow import PauliSumOp
from qiskit.primitives import BaseEstimator
Expand All @@ -40,6 +39,8 @@
_make_gradient_parameter_values,
)

from ..algorithm_job import AlgorithmJob


class BaseEstimatorGradient(ABC):
"""Base class for an ``EstimatorGradient`` to compute the gradients of the expectation value."""
Expand Down
3 changes: 2 additions & 1 deletion qiskit/algorithms/gradients/base_qgt.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from qiskit.providers import Options
from qiskit.transpiler.passes import TranslateParameterizedGates

from .. import AlgorithmJob
from .qgt_result import QGTResult
from .utils import (
DerivativeType,
Expand All @@ -38,6 +37,8 @@
_make_gradient_parameter_values,
)

from ..algorithm_job import AlgorithmJob


class BaseQGT(ABC):
r"""Base class to computes the Quantum Geometric Tensor (QGT) given a pure,
Expand Down
3 changes: 2 additions & 1 deletion qiskit/algorithms/gradients/base_sampler_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from collections.abc import Sequence
from copy import copy

from qiskit.algorithms import AlgorithmJob
from qiskit.circuit import Parameter, ParameterExpression, QuantumCircuit
from qiskit.primitives import BaseSampler
from qiskit.primitives.utils import _circuit_key
Expand All @@ -36,6 +35,8 @@
_make_gradient_parameter_values,
)

from ..algorithm_job import AlgorithmJob


class BaseSamplerGradient(ABC):
"""Base class for a ``SamplerGradient`` to compute the gradients of the sampling probability."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import numpy as np

from qiskit.algorithms import AlgorithmError
from qiskit.circuit import Parameter, QuantumCircuit
from qiskit.opflow import PauliSumOp
from qiskit.primitives import BaseEstimator
Expand All @@ -29,6 +28,8 @@
from .base_estimator_gradient import BaseEstimatorGradient
from .estimator_gradient_result import EstimatorGradientResult

from ..exceptions import AlgorithmError

if sys.version_info >= (3, 8):
# pylint: disable=no-name-in-module, ungrouped-imports
from typing import Literal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@

import numpy as np

from qiskit.algorithms import AlgorithmError
from qiskit.circuit import Parameter, QuantumCircuit
from qiskit.primitives import BaseSampler
from qiskit.providers import Options

from .base_sampler_gradient import BaseSamplerGradient
from .sampler_gradient_result import SamplerGradientResult

from ..exceptions import AlgorithmError

if sys.version_info >= (3, 8):
# pylint: disable=no-name-in-module, ungrouped-imports
from typing import Literal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import numpy as np

from qiskit.algorithms import AlgorithmError
from qiskit.circuit import Parameter, QuantumCircuit
from qiskit.opflow import PauliSumOp
from qiskit.primitives import BaseEstimator
Expand All @@ -31,6 +30,8 @@
from .estimator_gradient_result import EstimatorGradientResult
from .utils import DerivativeType, _make_lin_comb_gradient_circuit, _make_lin_comb_observables

from ..exceptions import AlgorithmError


class LinCombEstimatorGradient(BaseEstimatorGradient):
"""Compute the gradients of the expectation values.
Expand Down
3 changes: 2 additions & 1 deletion qiskit/algorithms/gradients/lin_comb_qgt.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import numpy as np

from qiskit.algorithms import AlgorithmError
from qiskit.circuit import Parameter, QuantumCircuit
from qiskit.primitives import BaseEstimator
from qiskit.primitives.utils import _circuit_key
Expand All @@ -31,6 +30,8 @@
from .qgt_result import QGTResult
from .utils import DerivativeType, _make_lin_comb_qgt_circuit, _make_lin_comb_observables

from ..exceptions import AlgorithmError


class LinCombQGT(BaseQGT):
"""Computes the Quantum Geometric Tensor (QGT) given a pure, parameterized quantum state.
Expand Down
3 changes: 2 additions & 1 deletion qiskit/algorithms/gradients/lin_comb_sampler_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from collections import defaultdict
from typing import Sequence

from qiskit.algorithms import AlgorithmError
from qiskit.circuit import Parameter, QuantumCircuit
from qiskit.primitives import BaseSampler
from qiskit.primitives.utils import _circuit_key
Expand All @@ -28,6 +27,8 @@
from .sampler_gradient_result import SamplerGradientResult
from .utils import _make_lin_comb_gradient_circuit

from ..exceptions import AlgorithmError


class LinCombSamplerGradient(BaseSamplerGradient):
"""Compute the gradients of the sampling probability.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

from typing import Sequence

from qiskit.algorithms import AlgorithmError
from qiskit.circuit import Parameter, QuantumCircuit
from qiskit.opflow import PauliSumOp
from qiskit.quantum_info.operators.base_operator import BaseOperator
Expand All @@ -26,6 +25,8 @@
from .estimator_gradient_result import EstimatorGradientResult
from .utils import _make_param_shift_parameter_values

from ..exceptions import AlgorithmError


class ParamShiftEstimatorGradient(BaseEstimatorGradient):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
from collections import defaultdict
from typing import Sequence

from qiskit.algorithms import AlgorithmError
from qiskit.circuit import Parameter, QuantumCircuit

from .base_sampler_gradient import BaseSamplerGradient
from .sampler_gradient_result import SamplerGradientResult
from .utils import _make_param_shift_parameter_values

from ..exceptions import AlgorithmError


class ParamShiftSamplerGradient(BaseSamplerGradient):
"""
Expand Down
5 changes: 3 additions & 2 deletions qiskit/algorithms/gradients/qfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
from collections.abc import Sequence
from copy import copy

from qiskit.algorithms import AlgorithmError
from qiskit.circuit import Parameter, QuantumCircuit
from qiskit.providers import Options

from .. import AlgorithmJob
from .base_qgt import BaseQGT
from .lin_comb_estimator_gradient import DerivativeType
from .qfi_result import QFIResult

from ..algorithm_job import AlgorithmJob
from ..exceptions import AlgorithmError


class QFI(ABC):
r"""Computes the Quantum Fisher Information (QFI) given a pure,
Expand Down
3 changes: 2 additions & 1 deletion qiskit/algorithms/gradients/spsa_estimator_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import numpy as np

from qiskit.algorithms import AlgorithmError
from qiskit.circuit import Parameter, QuantumCircuit
from qiskit.opflow import PauliSumOp
from qiskit.primitives import BaseEstimator
Expand All @@ -28,6 +27,8 @@
from .base_estimator_gradient import BaseEstimatorGradient
from .estimator_gradient_result import EstimatorGradientResult

from ..exceptions import AlgorithmError


class SPSAEstimatorGradient(BaseEstimatorGradient):
"""
Expand Down
3 changes: 2 additions & 1 deletion qiskit/algorithms/gradients/spsa_sampler_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@

import numpy as np

from qiskit.algorithms import AlgorithmError
from qiskit.circuit import Parameter, QuantumCircuit
from qiskit.primitives import BaseSampler
from qiskit.providers import Options

from .base_sampler_gradient import BaseSamplerGradient
from .sampler_gradient_result import SamplerGradientResult

from ..exceptions import AlgorithmError


class SPSASamplerGradient(BaseSamplerGradient):
"""
Expand Down
21 changes: 18 additions & 3 deletions qiskit/algorithms/time_evolvers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2022.
# (C) Copyright IBM 2022, 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 @@ -12,10 +12,25 @@

"""Quantum Time Evolution package."""

from .time_evolution_result import TimeEvolutionResult
from .imaginary_time_evolver import ImaginaryTimeEvolver
from .real_time_evolver import RealTimeEvolver
from .time_evolution_problem import TimeEvolutionProblem
from .time_evolution_result import TimeEvolutionResult
from .pvqd import PVQD, PVQDResult
from .classical_methods import SciPyImaginaryEvolver, SciPyRealEvolver
from .variational import VarQITE, VarQRTE, VarQTE, VarQTEResult

__all__ = [
"TimeEvolutionResult",
"ImaginaryTimeEvolver",
"RealTimeEvolver",
"TimeEvolutionProblem",
"TimeEvolutionResult",
"PVQD",
"PVQDResult",
"SciPyImaginaryEvolver",
"SciPyRealEvolver",
"VarQITE",
"VarQRTE",
"VarQTE",
"VarQTEResult",
]
4 changes: 2 additions & 2 deletions qiskit/algorithms/time_evolvers/time_evolution_result.py
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 @@ -32,7 +32,7 @@ class TimeEvolutionResult(AlgorithmResult):
observables (ListOrDict[tuple[np.ndarray, np.ndarray]] | None): Optional list of
observables for which expected on an evolved state are calculated at each timestep.
These values are in fact lists of tuples formatted as (mean, standard deviation).
times (np.array | None): Optional list of times at wich each observable has been evaluated.
times (np.array | None): Optional list of times at which each observable has been evaluated.
"""

def __init__(
Expand Down
Loading