Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .pylintdict
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ cobyla
codebase
codec
coeffs
coles
colin
combinatorial
computable
concha
config
configs
Expand Down Expand Up @@ -335,6 +337,7 @@ msg
multiclass
multinomial
multioutput
multipartite
mxd
mypy
nabla
Expand Down Expand Up @@ -511,7 +514,7 @@ scipy
sdg
seealso
semidefinite
sep
sep
seperate
seperable
serializable
Expand Down
24 changes: 12 additions & 12 deletions qiskit_machine_learning/datasets/entanglement_concentration.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@ def entanglement_concentration_data(
| tuple[list[Statevector], np.ndarray, list[Statevector], np.ndarray, np.ndarray]
):
r"""
Generates a dataset that comprises of Quantum States with two different
amounts of Concentration Of Entanglement (CE) and their corresponding class labels.
Generates a dataset that comprises Quantum States with two different
amounts of Concentration of Entanglement (CE) and their corresponding class labels.
These states are generated by the effect of two different pre-trained ansatz
on fully seperable input states according to the procedure outlined in [1]. Pre-trained
data in courtesy of L Schatzki et el [3]. The datapoints can be fully separated using
on fully separable input states according to the procedure outlined in [1]. Pre-trained
data in courtesy of L Schatzki et al [3]. The datapoints can be fully separated using
the SWAP test outlined in [2]. First, input states are randomly generated from a
uniform distribution, using a sampling method determined by the ``sampling_method``
argument. Next, based on the ``mode`` argument, two pre-trained circuits "A" and "B"
argument. Next, based on the ``mode`` argument, two pre-trained circuits, "A" and "B"
are used for generating datapoints.


CE can be interpreted as a measure of correlation between the different qubits.
The ``mode`` argument supports two options. ``"easy"`` gives datapoints with high CE
difference hence being easy to seperate. ``"hard"`` mode gives closer CE values.
difference, hence being easy to separate. ``"hard"`` mode gives closer CE values.
The user's classifiers can be benchmarked against these modes for their ability to
separate the data into two classes based on CE.

Expand Down Expand Up @@ -152,21 +152,21 @@ def entanglement_concentration_data(
raise ValueError("Invalid sampling method. Must be 'isotropic' or 'cardinal'")
if sampling_method == "cardinal" and n_points >= (6**n):
raise ValueError(
"""Cardinal Sampling cannot generate a large number of unique
datapoints due to the limited number of combinations possible.
"""Cardinal Sampling cannot generate a large number of unique
datapoints due to the limited number of combinations possible.
Try "isotropic" sampling method"""
)
if formatting not in {"statevector", "ndarray"}:
raise ValueError(
"""Formatting must be "statevector" or "ndarray". Please check for
"""Formatting must be "statevector" or "ndarray". Please check for
case sensitivity."""
)

# Warnings
if sampling_method == "cardinal" and n_points > (3**n):
warnings.warn(
"""Cardinal Sampling for large number of samples is not recommended
and can lead to an arbitrarily large generation time due to
"""Cardinal Sampling for large number of samples is not recommended
and can lead to an arbitrarily large generation time due to
repeating datapoints. Try "isotropic" sampling method""",
UserWarning,
)
Expand Down Expand Up @@ -244,7 +244,7 @@ def _assign_parameters(
expected = 3 * depth * n_qubits
if len(weights) != expected:
raise ValueError(
"""Parameter mismatch – please reinstall the latest 'qiskit-machine-learning'
"""Parameter mismatch – please reinstall the latest 'qiskit-machine-learning'
package (or update the model files).""",
)

Expand Down
6 changes: 5 additions & 1 deletion qiskit_machine_learning/gradients/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of a Qiskit project.
#
# (C) Copyright IBM 2022, 2024.
# (C) Copyright IBM 2022, 2025.
#
# 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 @@ -71,6 +71,8 @@
from .base.sampler_gradient_result import SamplerGradientResult
from .spsa.spsa_estimator_gradient import SPSAEstimatorGradient
from .spsa.spsa_sampler_gradient import SPSASamplerGradient
from .lin_comb.lin_comb_qgt import LinCombQGT
from .qfi import QFI

__all__ = [
"BaseEstimatorGradient",
Expand All @@ -84,4 +86,6 @@
"SamplerGradientResult",
"SPSAEstimatorGradient",
"SPSASamplerGradient",
"LinCombQGT",
"QFI",
]
Loading