Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normal.free_symbols vs Indexed.free_symbols #21435

Open
smichr opened this issue May 5, 2021 · 0 comments
Open

Normal.free_symbols vs Indexed.free_symbols #21435

smichr opened this issue May 5, 2021 · 0 comments

Comments

@smichr
Copy link
Member

smichr commented May 5, 2021

This is related to #14899. Compare Normal and Indexed response to free symbols queries:

>>> from sympy.stats import Normal
>>> X = Normal('X', 2, 4)
>>> [(i,type(i)) for i in X.free_symbols]
[(X, <class 'sympy.stats.rv.RandomSymbol'>)]
>>> [(i,type(i)) for i in X.expr_free_symbols]
[(X, <class 'sympy.core.symbol.Symbol'>)]

vs

>>> Fx = IndexedBase("F")[x]
>>> [(i,type(i)) for i in Fx.expr_free_symbols]
[(F[x], <class 'sympy.tensor.indexed.Indexed'>)]
>>> [(i,type(i)) for i in Fx.free_symbols]
[(F[x], <class 'sympy.tensor.indexed.Indexed'>), (x, <class 'sympy.core.symbol.Symbol'>), (F, <class 'sympy.core.symbol.Symbol'>)]

It seems like Normal should give this:

>> [(i,type(i)) for i in X.expr_free_symbols]
[(X, <class 'sympy.stats.rv.RandomSymbol'>)]
>> [(i,type(i)) for i in X.free_symbols]
[(X, <class 'sympy.stats.rv.RandomSymbol'>), (X, <class 'sympy.core.symbol.Symbol'>)]
@smichr smichr changed the title Normal free_symbols vs expr_free_symbols Normal.free_symbols vs Indexed.free_symbols May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants