Skip to content

Commit

Permalink
Subexpression replacements in the Jacobian should be real.
Browse files Browse the repository at this point in the history
  • Loading branch information
moorepants committed Aug 29, 2024
1 parent ddd4880 commit 8ab393c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions opty/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,15 @@ def add_to_cache(node):
)
raise NotImplementedError

# TODO : Ideally a replacement symbol would somehow carry the appropriate
# assumptions that derive from the subexpression it replaces. I add
# real=True here, as we assume all symbols and functions of time are real
# in opty.
replacement_symbols = numbered_symbols(
prefix='z',
cls=sm.Symbol,
exclude=expr.free_symbols,
real=True,
)

expr_to_replacement_cache = {}
Expand Down

0 comments on commit 8ab393c

Please sign in to comment.