def test_valid_3(self) -> None: u1 = UnitaryMatrix.random(3) u2 = UnitaryMatrix.random(2) ub = UnitaryBuilder(3) ub.apply_left(u1, [0, 1, 2]) assert ub.get_unitary() == u1 ub.apply_left(u2, [1, 2]) prod = u1 @ np.kron(np.identity(2), u2.get_numpy()) assert ub.get_unitary() == prod
def test_valid_1(self) -> None: u1 = UnitaryMatrix.random(3) ub = UnitaryBuilder(3) ub.apply_left(u1, [0, 1, 2]) assert ub.get_unitary() == u1