| 85 | |
| 86 | |
| 87 | class All(Superposition): |
| 88 | def _comp(self,other,op): |
| 89 | r = super(All,self)._comp(other,op) |
| 90 | if len(r) == len(self): |
| 91 | return r |
| 92 | else: |
| 93 | return All() |
| 94 | |
| 95 | def __eq__(self,other): |
| 96 | if isinstance(other,Set): |
| 97 | r = Set(self) & other |
| 98 | if len(r) == len(self): |
| 99 | return All(r) |
| 100 | else: |
| 101 | return All() |
| 102 | elif len(self) == 1 and self.eigenstates()[0] == other: |
| 103 | print 'in elif' |
| 104 | return All(self) |
| 105 | else: |
| 106 | return All() |
| 107 | |
| 108 | if __name__ == '__main__': |
| 109 | a = Superposition(1,2,3) |
no outgoing calls
no test coverage detected