Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3151 by [email protected]: Symbol needs an Hermitian assumption
http://code.google.com/p/sympy/issues/detail?id=3151

There should be a wait to assume that conjugate(A) == A. It used to be that you could assume real, noncommutative symbols but this is now forbidden.

$ ipython
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
Type "copyright", "credits" or "license" for more information.

IPython 0.10.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import sympy

In [2]: sympy.__version__
Out[2]: '0.7.1-git'

In [3]: A=sympy.Symbol('A', commutative=False, real=True)
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)

/home/jrioux/git/sympy/<ipython console> in <module>()

/home/jrioux/git/sympy/sympy/core/symbol.py in __new__(cls, name, **assumptions)
     69                 return Dummy(name, **assumptions)
     70         assumptions.setdefault('commutative', True)
---> 71         return Symbol.__xnew_cached_(cls, name, **assumptions)
     72
     73     def __new_stage2__(cls, name, **assumptions):

/home/jrioux/git/sympy/sympy/core/cache.pyc in wrapper(*args, **kw_args)
     89         except KeyError:
     90             pass
---> 91         func_cache_it_cache[k] = r = func(*args, **kw_args)
     92         return r
     93     return wrapper

/home/jrioux/git/sympy/sympy/core/symbol.py in __new_stage2__(cls, name, **assumptions)
     73     def __new_stage2__(cls, name, **assumptions):
     74         assert isinstance(name, str),repr(type(name))
---> 75         obj = Expr.__new__(cls, **assumptions)
     76         obj.name = name
     77         return obj

/home/jrioux/git/sympy/sympy/core/basic.pyc in __new__(cls, *args, **assumptions)
    145     def __new__(cls, *args, **assumptions):
    146         obj = object.__new__(cls)
--> 147         obj._init_assumptions(assumptions)
    148
    149         obj._mhash = None # will be set by __hash__ method.

/home/jrioux/git/sympy/sympy/core/assumptions.py in _init_assumptions(self, assumptions)
    243         # fully derived assumptions?

    244         if assumptions:
--> 245             self._learn_new_facts(assumptions)
    246             #                      ^

247 # FIXME this is slow | another NOTE: speeding this up is *not*


/home/jrioux/git/sympy/sympy/core/assumptions.py in _learn_new_facts(self, facts)
    424             base = base.copy()
    425             self._assumptions = base
    426         # NOTE it modifies base inplace

--> 427         _assume_rules.deduce_all_facts(facts, base)
    428

/home/jrioux/git/sympy/sympy/core/facts.pyc in deduce_all_facts(self, facts, base)
    598                 if k in new_facts:
599 assert new_facts[k] is None or new_facts[k] == v, \ --> 600 ('inconsistency between facts', new_facts, k, v) 601 # performance-wise it is important not to fire implied rules

602 # for already-seen fact -- we already did them all.


AssertionError: ('inconsistency between facts', {'real': True, 'imaginary': False, 'comparable': False, 'complex': True, 'commutative': True}, 'commutative', False)


--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to