diff --git a/docs/conf.py b/docs/conf.py index ed865d6f9..4c239b619 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -138,15 +138,8 @@ translations_list = [ ("en", "English"), - ("bn_BN", "Bengali"), - ("fr_FR", "French"), - ("hi_IN", "Hindi"), ("ja_JP", "Japanese"), - ("ko_KR", "Korean"), - ("ru_RU", "Russian"), ("es_UN", "Spanish"), - ("ta_IN", "Tamil"), - ("tr_TR", "Turkish"), ] language = "en" diff --git a/qiskit_machine_learning/kernels/algorithms/quantum_kernel_trainer.py b/qiskit_machine_learning/kernels/algorithms/quantum_kernel_trainer.py index 8dc172ba4..d6af61a4c 100644 --- a/qiskit_machine_learning/kernels/algorithms/quantum_kernel_trainer.py +++ b/qiskit_machine_learning/kernels/algorithms/quantum_kernel_trainer.py @@ -1,6 +1,6 @@ # This code is part of a Qiskit project. # -# (C) Copyright IBM 2021, 2023. +# (C) Copyright IBM 2021, 2024. # # 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 @@ -13,7 +13,6 @@ """Quantum Kernel Trainer""" from __future__ import annotations -import copy from functools import partial from typing import Sequence @@ -198,13 +197,17 @@ def fit( msg = "Quantum kernel cannot be fit because there are no user parameters specified." raise ValueError(msg) - # Bind inputs to objective function - output_kernel = copy.deepcopy(self._quantum_kernel) - # Randomly initialize the initial point if one was not passed if self._initial_point is None: self._initial_point = algorithm_globals.random.random(num_params) + # Bind inputs to objective function + output_kernel = type(self._quantum_kernel)( + feature_map=self._quantum_kernel.feature_map, + training_parameters=self._quantum_kernel.training_parameters, + ) + output_kernel.assign_training_parameters(parameter_values=self.initial_point) + # Perform kernel optimization loss_function = partial( self._loss.evaluate, quantum_kernel=self.quantum_kernel, data=data, labels=labels