Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fidelity interface using primitives #8303

Merged
merged 106 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from 98 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
a7ca007
fidelity_poc
gentinettagian Jun 19, 2022
aeaf9bf
Merge pull request #3 from gentinettagian/fidelity-primitive
gentinettagian Jun 29, 2022
8d3e65f
init stuff
gentinettagian Jun 30, 2022
12a9746
simplified design
gentinettagian Jul 4, 2022
1c84828
unittests
gentinettagian Jul 4, 2022
ded7d16
unittest working
gentinettagian Jul 4, 2022
e362b5e
optional parameters
gentinettagian Jul 4, 2022
78e83ef
typo
gentinettagian Jul 4, 2022
4be8015
documentation
gentinettagian Jul 5, 2022
26754be
Update test/python/primitives/fidelity/test_fidelity.py
gentinettagian Jul 6, 2022
b346945
Update qiskit/primitives/fidelity/base_fidelity.py
gentinettagian Jul 6, 2022
282c301
black
gentinettagian Jul 7, 2022
c712adf
Merge branch 'Qiskit:main' into fidelity-primitive
gentinettagian Jul 7, 2022
a8a0831
import order in test fixed
gentinettagian Jul 7, 2022
05c662d
Merge branch 'fidelity-primitive' of https://github.com/ElePT/qiskit-…
gentinettagian Jul 7, 2022
9e62012
Merge branch 'main' into fidelity-primitive
gentinettagian Jul 8, 2022
d2d3e80
docstring fixed
gentinettagian Jul 8, 2022
cfa470c
Update qiskit/primitives/fidelity/base_fidelity.py
gentinettagian Jul 16, 2022
c6534c7
context removed
gentinettagian Jul 18, 2022
de2f6d9
Reset branch
ElePT Jul 18, 2022
b57b86e
Add init
ElePT Jul 18, 2022
4504de3
Fix inits
ElePT Jul 18, 2022
4840bdc
merged force push
gentinettagian Jul 18, 2022
45767df
lint fixes
gentinettagian Jul 19, 2022
07b33a1
removed abstractmethod label for set_circuits
gentinettagian Jul 21, 2022
c192e3f
added support for setting only one circuit
gentinettagian Jul 27, 2022
e44305c
new unittest
gentinettagian Jul 27, 2022
6d6fbc2
Move fidelities to algorithms
ElePT Jul 28, 2022
0a9f6cb
Merge branch 'main' of https://github.com/ElePT/qiskit-terra into fid…
ElePT Aug 16, 2022
0153e5c
Update interface with new design doc
ElePT Aug 16, 2022
87a7578
Fix docstrings and unit tests
ElePT Aug 16, 2022
6b2186f
Add evaluate
ElePT Aug 16, 2022
1ebdbb1
Adapt signature run
ElePT Aug 16, 2022
2552ece
Make job async
ElePT Aug 17, 2022
edb3bf9
Fix types
ElePT Aug 17, 2022
53d67d7
Remove async, cache circuits
ElePT Aug 18, 2022
ad19d14
Update evaluate method, replace use of np
ElePT Aug 19, 2022
945fdfc
Remove circuits from init
ElePT Aug 23, 2022
198a3af
Add async, tests, update docstrings
ElePT Aug 23, 2022
d449e16
Add default run options
ElePT Aug 23, 2022
5f99811
change names, abstract methods, improve docstrings
ElePT Aug 23, 2022
9105b30
Merge branch 'main' into fidelity-primitive
ElePT Aug 24, 2022
dedc3ae
Update docstrings, typing
ElePT Aug 24, 2022
15db133
Merge branch 'fidelity-primitive' of https://github.com/ElePT/qiskit-…
ElePT Aug 24, 2022
4cd4007
Fix style
ElePT Aug 24, 2022
20f63b0
Update qiskit/algorithms/fidelities/base_fidelity.py
ElePT Aug 24, 2022
cb4fda1
Update qiskit/algorithms/fidelities/base_fidelity.py
ElePT Aug 24, 2022
1ab8025
Make async
ElePT Aug 24, 2022
ff9c069
Fix conflict
ElePT Aug 24, 2022
925c753
Add FidelityResult
ElePT Aug 25, 2022
f5d5745
Update qiskit/algorithms/fidelities/__init__.py
ElePT Aug 26, 2022
a19450e
Add to algorithms init
ElePT Aug 26, 2022
dfc09f2
Rename classes
ElePT Aug 26, 2022
0a1c2ab
Fix conflict
ElePT Aug 26, 2022
d563479
Apply review comments
ElePT Aug 29, 2022
7cafe12
Update preprocessing
ElePT Aug 29, 2022
e97b551
Update docstrings
ElePT Aug 29, 2022
06a35ff
Move run to base class
ElePT Aug 29, 2022
1dfdd25
Remove left/right params
ElePT Aug 29, 2022
6f89e6b
Apply reviews steve/julien/hamamura
ElePT Aug 29, 2022
147005d
Fix typo
ElePT Aug 29, 2022
dd47043
Style changes
ElePT Aug 29, 2022
e4275a4
Allow different num.params in circuit 1 and 2
ElePT Aug 29, 2022
c654e79
Fix unittest typo
ElePT Aug 29, 2022
5df3d29
Fix black
ElePT Aug 30, 2022
6f21679
Fix docs
ElePT Aug 30, 2022
342a6b3
Fix style/docstrings
ElePT Aug 30, 2022
a3d3e59
Add AlgorithmJob
ElePT Aug 31, 2022
5efcd71
Add truncate, fix result docstring
ElePT Aug 31, 2022
35b858d
Completely remove left-right
ElePT Aug 31, 2022
66dbce6
Add comments
ElePT Aug 31, 2022
b8b18cd
Make create circuit public
ElePT Aug 31, 2022
dcf306e
Remove empty param distinction
ElePT Aug 31, 2022
65dbefa
Update qiskit/algorithms/state_fidelities/base_state_fidelity.py
ElePT Aug 31, 2022
6f30d0f
change list preprocessing
ElePT Aug 31, 2022
b2726ee
Merge branch 'fidelity-primitive' of https://github.com/ElePT/qiskit-…
ElePT Aug 31, 2022
ab4b1d0
Update qiskit/algorithms/algorithm_job.py
ElePT Aug 31, 2022
8549ce3
Update qiskit/algorithms/state_fidelities/base_state_fidelity.py
ElePT Sep 1, 2022
061f17b
Update qiskit/algorithms/state_fidelities/base_state_fidelity.py
ElePT Sep 1, 2022
789f9db
Apply comments Steve
ElePT Sep 1, 2022
e70342d
Merge branch 'fidelity-primitive' of https://github.com/ElePT/qiskit-…
ElePT Sep 1, 2022
30bf3ac
Update qiskit/algorithms/state_fidelities/base_state_fidelity.py
ElePT Sep 1, 2022
4e7df61
Update qiskit/algorithms/state_fidelities/base_state_fidelity.py
ElePT Sep 1, 2022
05c0f1f
Update test/python/algorithms/state_fidelities/test_compute_uncompute.py
ElePT Sep 1, 2022
1ff7848
Style changes
ElePT Sep 1, 2022
567d31c
Update qiskit/algorithms/state_fidelities/base_state_fidelity.py
ElePT Sep 1, 2022
82cf020
Merge branch 'fidelity-primitive' of https://github.com/ElePT/qiskit-…
ElePT Sep 1, 2022
e0c653a
Apply comments Julien
ElePT Sep 1, 2022
8d220e4
Style fix
ElePT Sep 1, 2022
7de5e2d
Fix bug for lists of numpy values
ElePT Sep 1, 2022
817c8f7
Support single circuits
ElePT Sep 1, 2022
d5bbba6
Support single circuits
ElePT Sep 1, 2022
5e5a012
Add fidelity interface using primitives
ElePT Sep 2, 2022
9809e51
Apply reviews
ElePT Sep 2, 2022
21960b3
Fix docs
ElePT Sep 2, 2022
2a32785
Fix docs
ElePT Sep 2, 2022
3f3d5d9
Fix docs
ElePT Sep 2, 2022
637e63e
Fix lint
ElePT Sep 2, 2022
78d6b79
Update qiskit/algorithms/state_fidelities/base_state_fidelity.py
ElePT Sep 2, 2022
f17c92f
Update qiskit/algorithms/state_fidelities/base_state_fidelity.py
ElePT Sep 2, 2022
5cda299
Update qiskit/algorithms/state_fidelities/compute_uncompute.py
ElePT Sep 2, 2022
f812476
Update releasenotes/notes/add-fidelity-interface-primitives-dc543d079…
ElePT Sep 2, 2022
c6f25c1
Update qiskit/algorithms/state_fidelities/__init__.py
ElePT Sep 2, 2022
d745b4e
Update qiskit/algorithms/state_fidelities/base_state_fidelity.py
ElePT Sep 2, 2022
9fc65ce
Update qiskit/algorithms/state_fidelities/base_state_fidelity.py
ElePT Sep 2, 2022
d6dfcdc
Merge branch 'main' into fidelity-primitive
mergify[bot] Sep 2, 2022
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
26 changes: 24 additions & 2 deletions qiskit/algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,18 @@
IterativePhaseEstimation


State Fidelities
----------------

Algorithms that compute the fidelity of pairs of quantum states.

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

state_fidelities

Exceptions
==========
----------

.. autosummary::
:toctree: ../stubs/
Expand All @@ -219,8 +229,19 @@
:toctree: ../stubs/

eval_observables
"""

Utility classes
---------------

Utility classes used by algorithms (mainly for type-hinting purposes).

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

AlgorithmJob

"""
from .algorithm_job import AlgorithmJob
ElePT marked this conversation as resolved.
Show resolved Hide resolved
from .algorithm_result import AlgorithmResult
from .evolvers import EvolutionResult, EvolutionProblem
from .evolvers.real_evolver import RealEvolver
Expand Down Expand Up @@ -267,6 +288,7 @@
from .evolvers.pvqd import PVQD, PVQDResult

__all__ = [
"AlgorithmJob",
"AlgorithmResult",
"VariationalAlgorithm",
"VariationalResult",
Expand Down
24 changes: 24 additions & 0 deletions qiskit/algorithms/algorithm_job.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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.

"""
AlgorithmJob class
"""
from qiskit.primitives.primitive_job import PrimitiveJob


class AlgorithmJob(PrimitiveJob):
"""
This empty class is introduced for typing purposes.
"""

pass
41 changes: 41 additions & 0 deletions qiskit/algorithms/state_fidelities/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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.
"""
=====================================================================
State Fidelity Interfaces (:mod:`qiskit.algorithms.state_fidelities`)
=====================================================================

.. currentmodule:: qiskit.algorithms.state_fidelities

State Fidelities
================

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

BaseStateFidelity
ComputeUncompute

Results
=======

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

StateFidelityResult
ElePT marked this conversation as resolved.
Show resolved Hide resolved
"""

from .base_state_fidelity import BaseStateFidelity
from .compute_uncompute import ComputeUncompute
from .state_fidelity_result import StateFidelityResult

__all__ = ["BaseStateFidelity", "ComputeUncompute", "StateFidelityResult"]
Loading