@@ -273,8 +273,7 @@ class LowLevelQNNQiskit(LowLevelQNNBase):
273273 operator (Union[ObservableBase,list]): Operator that is used in the expectation
274274 value of the QNN. Can be a list for multiple outputs.
275275 executor (Executor) : Executor that is used for the evaluation of the QNN
276- optree_caching : Caching of the optree expressions (default = True recommended)
277- result_caching : Caching of the result for each `x`, `param`, `param_op` combination
276+ caching : Caching of the result for each `x`, `param`, `param_op` combination
278277 (default = True)
279278
280279 Attributes:
@@ -300,17 +299,15 @@ def __init__(
300299 parameterized_quantum_circuit : EncodingCircuitBase ,
301300 operator : Union [ObservableBase , list ],
302301 executor : Executor ,
303- optree_caching = True ,
304- result_caching = True ,
302+ caching = True ,
305303 ) -> None :
306304
307305 parameterized_quantum_circuit = TranspiledEncodingCircuit (
308306 parameterized_quantum_circuit , executor .backend
309307 )
310308 super ().__init__ (parameterized_quantum_circuit , operator , executor )
311309
312- self ._optree_caching = optree_caching
313- self ._result_caching = result_caching
310+ self .caching = caching
314311
315312 # Set-Up Executor
316313 if self ._executor .optree_executor == "estimator" :
@@ -405,8 +402,8 @@ def _initilize_derivative(self):
405402 self ._observable .set_map (self ._pqc .qubit_map , self ._pqc .num_physical_qubits )
406403 num_qubits_operator = self ._observable .num_qubits
407404
408- self .operator_derivatives = ObservableDerivatives (self ._observable , self . _optree_caching )
409- self .pqc_derivatives = EncodingCircuitDerivatives (self ._pqc , self . _optree_caching )
405+ self .operator_derivatives = ObservableDerivatives (self ._observable )
406+ self .pqc_derivatives = EncodingCircuitDerivatives (self ._pqc )
410407
411408 if self ._pqc .num_virtual_qubits != num_qubits_operator :
412409 raise ValueError ("Number of Qubits are not the same!" )
@@ -937,7 +934,7 @@ def add_to_real_todo_dic(item: Expec, real_todo_dic, value_dict):
937934
938935 # return dictionary for input data, it will be empty
939936 # if the combination of x,param,param_op is touched the first time
940- if self ._result_caching == True :
937+ if self .caching == True :
941938 caching_tuple = (
942939 to_tuple (x ),
943940 to_tuple (param ),
@@ -1120,7 +1117,7 @@ def add_to_real_todo_dic(item: Expec, real_todo_dic, value_dict):
11201117 value_dict ["param_op" ] = param_op
11211118
11221119 # Store the updated dictionary for the theta value
1123- if self ._result_caching :
1120+ if self .caching :
11241121 self .result_container [caching_tuple ] = value_dict
11251122
11261123 return value_dict
0 commit comments