Skip to content

Commit

Permalink
Changed operate_on to apply_op
Browse files Browse the repository at this point in the history
  • Loading branch information
gdevanla committed May 30, 2012
1 parent 662a833 commit 6d66a1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sympy/physics/quantum/density.py
Expand Up @@ -78,7 +78,7 @@ def get_prob(self, index):
prob = self.args[index][1]
return prob

def operate_on(self, op):
def apply_op(self, op):
"""op operates on each individual state"""
new_args = [(op*state, prob) for (state, prob) in self.args]
return Density(*new_args)
Expand Down
4 changes: 2 additions & 2 deletions sympy/physics/quantum/tests/test_density.py
Expand Up @@ -28,9 +28,9 @@ def test_doit():
assert (0.5*(PxKet(x*y)*Dagger(PxKet(x*y))) +
0.5*(XKet(x*y)*Dagger(XKet(x*y)))) == d_with_sym.doit()

def test_operate_on():
def test_apply_op():
d = Density([Ket(0), 0.5], [Ket(1), 0.5])
assert d.operate_on(XOp()) == Density([XOp()*Ket(0), 0.5],
assert d.apply_op(XOp()) == Density([XOp()*Ket(0), 0.5],
[XOp()*Ket(1), 0.5])

def test_represent():
Expand Down

0 comments on commit 6d66a1b

Please sign in to comment.