Commit 4979c086 authored by Pumpe, Daniel (dpumpe)'s avatar Pumpe, Daniel (dpumpe)
Browse files

tests for ComposedOperator

parent abb04e8f
Pipeline #12414 passed with stage
in 4 minutes and 55 seconds
......@@ -16,19 +16,19 @@ from test.common import expand
class ComposedOperator_Tests(unittest.TestCase):
spaces = generate_spaces()
@expand(product([spaces], [spaces]))
@expand(product(spaces, spaces))
def test_property(self, space1, space2):
rand1 = Field.from_random('normal', domain=space1)
rand2 = Field.from_random('normal', domain=space2)
op1 = DiagonalOperator(space1, diagonal=rand1)
op2 = DiagonalOperator(space2, diagonal=rand2)
op = ComposedOperator((op1, op2))
if op.domain != (op1.domain, op2.domain):
if op.domain != (op1.domain[0], op2.domain[0]):
raise TypeError
if op.unitary != False:
raise ValueError
@expand(product([spaces],[spaces]))
@expand(product(spaces,spaces))
def test_times_adjoint_times(self, space1, space2):
diag1 = Field.from_random('normal', domain=space1)
diag2 = Field.from_random('normal', domain=space2)
......@@ -44,7 +44,7 @@ class ComposedOperator_Tests(unittest.TestCase):
tt2 = rand1.dot(op.adjoint_times(rand2))
assert_approx_equal(tt1, tt2)
@expand(product([spaces], [spaces]))
@expand(product(spaces, spaces))
def test_times_inverse_times(self, space1, space2):
diag1 = Field.from_random('normal', domain=space1)
diag2 = Field.from_random('normal', domain=space2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment