-
Notifications
You must be signed in to change notification settings - Fork 331
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
fix cross reference of classes from terra #499
Changes from all commits
4b24b02
6e1ff4d
c936389
5be3ccc
01f6539
f95ca64
42f2cb4
9034fb9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,11 +84,13 @@ def __init__( | |
|
||
Raises: | ||
ValueError: | ||
- if ``quantum_kernel`` is passed and ``precomputed`` is set to ``True``. To use | ||
a precomputed kernel, ``quantum_kernel`` has to be of the ``None`` type. | ||
- if :class:`~qiskit_machine_learning.kernels.FidelityQuantumKernel` is passed and | ||
``precomputed`` is set to ``True``. To use a precomputed kernel, | ||
:class:`~qiskit_machine_learning.kernels.FidelityQuantumKernel` has to be of | ||
the ``None`` type. | ||
TypeError: | ||
- if ``quantum_kernel`` neither instance of | ||
:class:`~qiskit_machine_learning.kernels.BaseKernel` nor ``None``. | ||
- if :class:`~qiskit_machine_learning.kernels.FidelityQuantumKernel` neither instance | ||
of :class:`~qiskit_machine_learning.kernels.BaseKernel` nor ``None``. | ||
Comment on lines
91
to
+93
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This I think can be completely removed - the code did raise a TypeError but that seems to have been removed in a recent change since things are now more general around a BaseKernel rather than what was there before. On thing I do note is that is that this routine raises a ValueError if C <= 0 i.e. not a positive number, which is not included above. |
||
""" | ||
|
||
if precomputed: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,11 +66,12 @@ def __init__( | |
are adjusted to this number if required. | ||
feature_map: The (parametrized) circuit to be used as a feature map for the underlying | ||
:class:`~qiskit_machine_learning.neural_networks.CircuitQNN`. If ``None`` is given, | ||
the ``ZZFeatureMap`` is used if the number of qubits is larger than 1. For a single | ||
qubit classification problem the ``ZFeatureMap`` is used per default. | ||
the :class:`~qiskit.circuit.library.ZZFeatureMap` is used if the number of qubits | ||
is larger than 1. For a single qubit classification problem the | ||
:class:`~qiskit.circuit.library.ZZFeatureMap` is used per default. | ||
ansatz: The (parametrized) circuit to be used as an ansatz for the underlying | ||
:class:`~qiskit_machine_learning.neural_networks.CircuitQNN`. If ``None`` is given | ||
then the ``RealAmplitudes`` circuit is used. | ||
then the :class:`~qiskit.circuit.library.RealAmplitudes` circuit is used. | ||
loss: A target loss function to be used in training. Default value is ``cross_entropy``. | ||
optimizer: An instance of an optimizer to be used in training. When ``None`` defaults | ||
to SLSQP. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SLSQP here could be written as |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change to make things specific makes it incorrect. The
quantum_kernel
parameter must be None if you say you will use aprecomputed
kernel when that parameter is True. A quantum_kernel by type just has to be subclass of BaseKernel - so by making some specific reference it changes the meaning somewhat.Now its true that if precomputed is False and you do not pass a quantum_kernel, i.e. you leave it at None, then it creates an instance of that specific subclass - but overall its not limited to that. Arguably this default when None and precomputed is False ought to be noted in the docstring above.