@@ -55,6 +55,14 @@ class ReducedFunctional(object):
55
55
respect to which to take the derivative. By default, the derivative
56
56
is taken with respect to all controls. If present, it overwrites
57
57
derivative_cb_pre and derivative_cb_post.
58
+ scale (float): A scaling factor applied to the functional and its
59
+ gradient with respect to the control.
60
+ tape (Tape): A tape object that the reduced functional will use to
61
+ evaluate the functional and its gradients (or derivatives).
62
+ eval_cb_pre (function): Callback function before evaluating the
63
+ functional. Input is a list of Controls.
64
+ eval_cb_pos (function): Callback function after evaluating the
65
+ functional. Inputs are the functional value and a list of Controls.
58
66
derivative_cb_pre (function): Callback function before evaluating
59
67
derivatives. Input is a list of Controls.
60
68
Should return a list of Controls (usually the same
@@ -64,6 +72,10 @@ class ReducedFunctional(object):
64
72
list of functional derivatives, list of functional values.
65
73
Should return a list of derivatives (usually the same
66
74
list as the input) to be returned from self.derivative.
75
+ hessian_cb_pre (function): Callback function before evaluating the Hessian.
76
+ Input is a list of Controls.
77
+ hessian_cb_post (function): Callback function after evaluating the Hessian.
78
+ Inputs are the functional, a list of Hessian, and controls.
67
79
"""
68
80
69
81
def __init__ (self , functional , controls ,
@@ -211,7 +223,7 @@ def __call__(self, values):
211
223
raise TypeError (
212
224
f"The control at index { i } must be an `OverloadedType` object "
213
225
f"with the same type as the control, which is { control_type } "
214
- )
226
+ )
215
227
# Call callback.
216
228
self .eval_cb_pre (self .controls .delist (values ))
217
229
0 commit comments