Skip to content

Commit

Permalink
Merge pull request #216 from moorepants/make-zees-real
Browse files Browse the repository at this point in the history
Subexpression replacements in the Jacobian should be real.
  • Loading branch information
moorepants authored Aug 29, 2024
2 parents ddd4880 + 8ab393c commit 0cc6f8b
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 0cc6f8b

Please sign in to comment.