@@ -637,6 +637,7 @@ def _get_docplex_optimizer_from_params_bag(
637
637
classical_optimizer ,
638
638
create_mixer ,
639
639
n_reps ,
640
+ qaoa_initial_points ,
640
641
):
641
642
if quantum :
642
643
if create_mixer :
@@ -653,6 +654,7 @@ def _get_docplex_optimizer_from_params_bag(
653
654
quantum_instance = quantum_instance ,
654
655
upper_bound = upper_bound ,
655
656
optimizer = qaoa_optimizer ,
657
+ initial_points = qaoa_initial_points ,
656
658
)
657
659
else :
658
660
logger ._log (f"Using ClassicalOptimizer ({ type (classical_optimizer ).__name__ } )" )
@@ -681,6 +683,8 @@ class QuanticMDM(QuanticClassifierBase):
681
683
Add qaoa_optimizer parameter.
682
684
.. versionchanged:: 0.4.0
683
685
Add QAOA-CV optimization.
686
+ .. versionchanged:: 0.4.1
687
+ Add qaoa_initial_points parameter.
684
688
685
689
Parameters
686
690
----------
@@ -724,6 +728,8 @@ class QuanticMDM(QuanticClassifierBase):
724
728
n_reps : int, default=3
725
729
The number of time the mixer and cost operator are repeated in the QAOA-CV
726
730
circuit.
731
+ qaoa_initial_points : Tuple[int, int], default=[0.0, 0.0].
732
+ Starting parameters (beta and gamma) for the NaiveQAOAOptimizer.
727
733
728
734
See Also
729
735
--------
@@ -760,6 +766,7 @@ def __init__(
760
766
qaoa_optimizer = SLSQP (),
761
767
create_mixer = None ,
762
768
n_reps = 3 ,
769
+ qaoa_initial_points = [0.0 , 0.0 ],
763
770
):
764
771
QuanticClassifierBase .__init__ (
765
772
self , quantum , q_account_token , verbose , shots , None , seed
@@ -771,6 +778,7 @@ def __init__(
771
778
self .qaoa_optimizer = qaoa_optimizer
772
779
self .create_mixer = create_mixer
773
780
self .n_reps = n_reps
781
+ self .qaoa_initial_points = qaoa_initial_points
774
782
775
783
@staticmethod
776
784
def _override_predict_distance (mdm ):
@@ -815,6 +823,7 @@ def _init_algo(self, n_features):
815
823
self .classical_optimizer ,
816
824
self .create_mixer ,
817
825
self .n_reps ,
826
+ self .qaoa_initial_points ,
818
827
)
819
828
set_global_optimizer (self ._optimizer )
820
829
return classifier
@@ -1093,6 +1102,8 @@ class QuanticNCH(QuanticClassifierBase):
1093
1102
Add qaoa_optimizer parameter.
1094
1103
.. versionchanged:: 0.4.0
1095
1104
Add QAOA-CV optimization.
1105
+ .. versionchanged:: 0.4.1
1106
+ Add the qaoa_initial_points parameter.
1096
1107
1097
1108
Parameters
1098
1109
----------
@@ -1141,6 +1152,8 @@ class QuanticNCH(QuanticClassifierBase):
1141
1152
n_reps : int, default=3
1142
1153
The number of time the mixer and cost operator are repeated in the QAOA-CV
1143
1154
circuit.
1155
+ qaoa_initial_points : Tuple[int, int], default=[0.0, 0.0].
1156
+ Starting parameters (beta and gamma) for the NaiveQAOAOptimizer.
1144
1157
1145
1158
References
1146
1159
----------
@@ -1165,6 +1178,7 @@ def __init__(
1165
1178
qaoa_optimizer = SLSQP (),
1166
1179
create_mixer = None ,
1167
1180
n_reps = 3 ,
1181
+ qaoa_initial_points = [0.0 , 0.0 ],
1168
1182
):
1169
1183
QuanticClassifierBase .__init__ (
1170
1184
self , quantum , q_account_token , verbose , shots , None , seed
@@ -1179,6 +1193,7 @@ def __init__(
1179
1193
self .qaoa_optimizer = qaoa_optimizer
1180
1194
self .create_mixer = create_mixer
1181
1195
self .n_reps = n_reps
1196
+ self .qaoa_initial_points = qaoa_initial_points
1182
1197
1183
1198
def _init_algo (self , n_features ):
1184
1199
self ._log ("Nearest Convex Hull Classifier initiating algorithm" )
@@ -1200,6 +1215,7 @@ def _init_algo(self, n_features):
1200
1215
self .classical_optimizer ,
1201
1216
self .create_mixer ,
1202
1217
self .n_reps ,
1218
+ self .qaoa_initial_points ,
1203
1219
)
1204
1220
1205
1221
# sets the optimizer for the distance functions
0 commit comments