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

fix cross reference of classes from terra #499

Closed
Closed
6 changes: 3 additions & 3 deletions qiskit_machine_learning/algorithms/classifiers/vqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SLSQP here could be written as :class:`~qiskit.algorithms.optimizers.SLSQP` since this is the actual optimizer class it defaults to. This default is actually done in TrainableModel class where it could be altered the same way,

Expand Down
6 changes: 3 additions & 3 deletions qiskit_machine_learning/algorithms/regressors/vqr.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ 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.TwoLayerQNN`. If ``None`` is given,
the ``ZZFeatureMap`` is used if the number of qubits is larger than 1. For a single
qubit regression problem the ``ZFeatureMap`` circuit 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 regression problem the :class:`~qiskit.circuit.library.ZZFeatureMap` circuit is used per default.
ansatz: The (parametrized) circuit to be used as an ansatz for the underlying
:class:`~qiskit_machine_learning.neural_networks.TwoLayerQNN`. If ``None`` is given
then the ``RealAmplitudes`` circuit is used.
then the :class:`~qiskit.circuit.library.RealAmplitudes` circuit is used.
observable: The observable to be measured in the underlying TwoLayerQNN. If ``None``,
use the default from the TwoLayerQNN, i.e., :math:`Z^{\otimes num\_qubits}`.
loss: A target loss function to be used in training. Default is squared error.
Expand Down
2 changes: 1 addition & 1 deletion qiskit_machine_learning/neural_networks/two_layer_qnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(
is given, raises an exception. The number of qubits in the feature map and ansatz
are adjusted to this number if required.
feature_map: The (parametrized) circuit to be used as a feature map. If ``None`` is given,
the ``ZZFeatureMap`` is used if the number of qubits is larger than 1. For
the `:class:`~qiskit.circuit.library.ZZFeatureMap` is used if the number of qubits is larger than 1. For
a single qubit two-layer QNN the ``ZFeatureMap`` circuit is used per default.
ansatz: The (parametrized) circuit to be used as an ansatz. If ``None`` is given,
the ``RealAmplitudes`` circuit is used.
Expand Down
6 changes: 3 additions & 3 deletions qiskit_machine_learning/utils/adjust_num_qubits.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ def derive_num_qubits_feature_map_ansatz(

If the number of qubits is not ``None``, then the feature map and ansatz are adjusted to this
number of qubits if required. If such an adjustment fails, an error is raised.
Also, if the feature map or ansatz or both are ``None``, then ``ZZFeatureMap`` and
``RealAmplitudes`` are created respectively. If there's just one qubit, ``ZFeatureMap`` is
Also, if the feature map or ansatz or both are ``None``, then :class:`~qiskit.circuit.library.ZZFeatureMap` and
:class:`~qiskit.circuit.library.RealAmplitudes` are created respectively. If there's just one qubit, ``ZFeatureMap`` is
created instead.

If the number of qubits is ``None``, then the number of qubits is derived from the feature map
or ansatz. Both the feature map and ansatz in this case must have the same number of qubits.
If the number of qubits of the feature map is not the same as the number of qubits of
the ansatz, an error is raised. If only one of the feature map and ansatz are ``None``, then
``ZZFeatureMap`` or ``RealAmplitudes`` are created respectively.
:class:`~qiskit.circuit.library.ZZFeatureMap` or :class:`~qiskit.circuit.library.RealAmplitudes` are created respectively.

If all the parameters are none an error is raised.

Expand Down