Пример #1
0
    def test_identity_roots_incorrect(self) -> None:
        dimension = 2
        t = Unitary(dimension, np.array([[1, 0], [0, np.exp(1j * np.pi / 4)]]))
        t_entry = UnitarySequenceEntry(t, [0])
        sequence = UnitarySequence(dimension, np.repeat(t_entry, 7))

        assert sequence.get_dimension() == dimension
        assert sequence.get_length() == 7
        assert not sequence.product().close_to(np.identity(dimension))
Пример #2
0
    def test_default(self) -> None:
        dimension = 2
        sequence = UnitarySequence(dimension)

        assert sequence.get_dimension() == dimension
        assert sequence.product().close_to(np.identity(dimension))